Beispiel #1
0
  public void setDifficultyForAllWorlds(EnumDifficulty difficulty) {
    for (int var2 = 0; var2 < this.worldServers.length; ++var2) {
      WorldServer var3 = this.worldServers[var2];

      if (var3 != null) {
        if (var3.getWorldInfo().isHardcoreModeEnabled()) {
          var3.getWorldInfo().setDifficulty(EnumDifficulty.HARD);
          var3.setAllowedSpawnTypes(true, true);
        } else if (this.isSinglePlayer()) {
          var3.getWorldInfo().setDifficulty(difficulty);
          var3.setAllowedSpawnTypes(var3.getDifficulty() != EnumDifficulty.PEACEFUL, true);
        } else {
          var3.getWorldInfo().setDifficulty(difficulty);
          var3.setAllowedSpawnTypes(this.allowSpawnMonsters(), this.canSpawnAnimals);
        }
      }
    }
  }