Ejemplo n.º 1
0
  @Override
  public void updateCurrentMap() {
    // check if currently running...
    this.current = this.getNextMap();
    Rotation rotation = MiniGameServer.ONLINE.getRotation();

    boolean nextMap = false;
    for (int i = 0; i < rotation.getMaps().size(); i++) {
      Map map = (Map) rotation.getMaps().toArray()[i];
      if (nextMap) {
        this.setNextMap(map);
        return;
      } else if (map.equals(this.current)) { // TODO uuid
        nextMap = true;
      }
    }

    if (nextMap) {
      this.setNextMap(null);
    } else if (this.current.equals(Arcade.getMaps().getCurrentMap())) {
      this.setNextMap(
          (Map) rotation.getMaps().toArray()[this.random.nextInt(rotation.getMaps().size())]);
    } else if (this.getNextMap().getName().equals(this.current.getName())) {
      this.setNextMap(null);
      Log.log(
          Level.SEVERE,
          "Aby plugin Arcade dzialal prawidlowo wymagane sa minimum 2 rotacyjne mapy!");
    }
  }
Ejemplo n.º 2
0
  @Override
  public void setWorlds(WorldManager worlds) {
    Validate.notNull(worlds, "worlds can not be null");
    this.worlds = worlds;

    try {
      Rotation rotation = MiniGameServer.ONLINE.getRotation();
      if (this.getNextMap() != null) {
        this.getWorlds().load(this.getNextMap());
      } else if (rotation.getMaps().isEmpty()) {
        Log.log(
            Level.SEVERE, "Brak map w rotacji serwera " + MiniGameServer.ONLINE.getShoot().getID());
      } else {
        for (Map map : rotation.getMaps()) {
          if (!(map instanceof NotLoadedMap)) {
            this.setNextMap(map);
            Arcade.getServer().getScheduler().runCycle(0);
            return;
          }
        }
      }
    } catch (IOException ex) {
      new CrashHandler("cycling", ex).crash();
    }
  }
Ejemplo n.º 3
0
  @Override
  public void debug(Level level, String message) {
    Validate.notNull(message);

    if (level == null) {
      level = Level.INFO;
    }

    Log.log(level, message);
  }