示例#1
0
  public static void onServerChanged(MinecraftServer server, WorldInfo worldInfo) {
    COWorldConfig.clearWorldConfigs();
    ;
    COWorldConfig.loadedOptionOverrides[1] = COWorldConfig.loadedOptionOverrides[2] = null;
    _populatedChunks.clear();

    _server = server;
    BiomeGenBase[] worldBaseDir = BiomeGenBase.biomeList;
    int saveFormat = worldBaseDir.length;

    for (int cfg = 0; cfg < saveFormat; ++cfg) {
      BiomeGenBase ex = worldBaseDir[cfg];

      if (ex != null && ex.theBiomeDecorator != null) {
        patchBiomeDecorator(ex.theBiomeDecorator);
      }
    }

    File saveDir = null;
    ISaveFormat var9 = _server.getActiveAnvilConverter();

    if (var9 != null && var9 instanceof SaveFormatOld) {
      saveDir = ((SaveFormatOld) var9).getSavesDirectory();
    }

    saveDir = new File(saveDir, _server.getFolderName());
    COWorldConfig var10 = null;

    while (var10 == null) {
      try {
        var10 = new COWorldConfig(worldInfo, saveDir);
        COWorldConfig.validateOptions(var10.getConfigOptions(), false);
        COWorldConfig.validateDistributions(var10.getOreDistributions(), false);
      } catch (Exception var7) {

        if (!COErrorHandler.onConfigError(var7)) {
          break;
        }

        var10 = null;
      }
    }
  }