Beispiel #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!");
    }
  }
Beispiel #2
0
 @Override
 public Map getMapExact(String name) {
   Validate.notNull(name, "name can not be null");
   name = name.toLowerCase().replace(" ", "_");
   for (Map map : this.getMaps()) {
     if (map.getName().toLowerCase().equals(name)) {
       return map;
     }
   }
   return null;
 }