public WorldInfo(NBTTagCompound par1NBTTagCompound) {
    terrainType = WorldType.DEFAULT;
    generatorOptions = "";
    theGameRules = new GameRules();
    randomSeed = par1NBTTagCompound.getLong("RandomSeed");

    if (par1NBTTagCompound.hasKey("generatorName")) {
      String s = par1NBTTagCompound.getString("generatorName");
      terrainType = WorldType.parseWorldType(s);

      if (terrainType == null) {
        terrainType = WorldType.DEFAULT;
      } else if (terrainType.isVersioned()) {
        int i = 0;

        if (par1NBTTagCompound.hasKey("generatorVersion")) {
          i = par1NBTTagCompound.getInteger("generatorVersion");
        }

        terrainType = terrainType.getWorldTypeForGeneratorVersion(i);
      }

      if (par1NBTTagCompound.hasKey("generatorOptions")) {
        generatorOptions = par1NBTTagCompound.getString("generatorOptions");
      }
    }

    theGameType = EnumGameType.getByID(par1NBTTagCompound.getInteger("GameType"));

    if (par1NBTTagCompound.hasKey("MapFeatures")) {
      mapFeaturesEnabled = par1NBTTagCompound.getBoolean("MapFeatures");
    } else {
      if (useNBXlite) {
        mapFeaturesEnabled = ODNBXlite.Generator == ODNBXlite.GEN_NEWBIOMES;
      } else {
        mapFeaturesEnabled = false;
      }
    }

    spawnX = par1NBTTagCompound.getInteger("SpawnX");
    spawnY = par1NBTTagCompound.getInteger("SpawnY");
    spawnZ = par1NBTTagCompound.getInteger("SpawnZ");
    totalTime = par1NBTTagCompound.getLong("Time");

    if (par1NBTTagCompound.hasKey("DayTime")) {
      worldTime = par1NBTTagCompound.getLong("DayTime");
    } else {
      worldTime = totalTime;
    }

    lastTimePlayed = par1NBTTagCompound.getLong("LastPlayed");
    sizeOnDisk = par1NBTTagCompound.getLong("SizeOnDisk");
    levelName = par1NBTTagCompound.getString("LevelName");
    saveVersion = par1NBTTagCompound.getInteger("version");
    rainTime = par1NBTTagCompound.getInteger("rainTime");
    raining = par1NBTTagCompound.getBoolean("raining");
    thunderTime = par1NBTTagCompound.getInteger("thunderTime");
    thundering = par1NBTTagCompound.getBoolean("thundering");
    hardcore = par1NBTTagCompound.getBoolean("hardcore");

    if (par1NBTTagCompound.hasKey("initialized")) {
      initialized = par1NBTTagCompound.getBoolean("initialized");
    } else {
      initialized = true;
    }

    if (par1NBTTagCompound.hasKey("allowCommands")) {
      allowCommands = par1NBTTagCompound.getBoolean("allowCommands");
    } else {
      allowCommands = theGameType == EnumGameType.CREATIVE;
    }
    if (useNBXlite) {
      nbxlite = par1NBTTagCompound.hasKey("NBXlite");
      if (nbxlite) {
        NBTTagCompound nbxliteTag = par1NBTTagCompound.getCompoundTag("NBXlite");
        mapGen = ODNBXlite.getGen(nbxliteTag.getString("Generator"), 0);
        mapGenExtra = ODNBXlite.getGen(nbxliteTag.getString("Generator"), 1);
        snowCovered = ODNBXlite.getGen(nbxliteTag.getString("Generator"), 2) > 0;
        flags = nbxliteTag.getString("Flags");
        if (nbxliteTag.getInteger("Version") < 3) {
          if (nbxliteTag.getString("Generator").endsWith("/jungle")) {
            flags += (flags.length() <= 0) ? "jungle" : ";jungle";
          }
          if (nbxliteTag.getBoolean("NewOres")) {
            flags += (flags.length() <= 0) ? "newores" : ";newores";
          }
        }
        if (nbxliteTag.getInteger("Version") < 4) {
          if (mapGen == ODNBXlite.GEN_NEWBIOMES
              || mapGen == ODNBXlite.GEN_OLDBIOMES
                  && (mapGenExtra == ODNBXlite.FEATURES_BETA15
                      || mapGenExtra == ODNBXlite.FEATURES_BETA173)) {
            flags += (flags.length() <= 0) ? "weather" : ";weather";
          }
        }
        if (nbxliteTag.getInteger("Version") < 5) {
          structures = ODNBXlite.getDefaultStructures(mapFeaturesEnabled, mapGen, mapGenExtra);
        } else {
          structures = new boolean[ODNBXlite.STRUCTURES.length];
          NBTTagCompound structuresTag = nbxliteTag.getCompoundTag("Structures");
          for (int i = 0; i < structures.length; i++) {
            structures[i] = structuresTag.getBoolean(ODNBXlite.STRUCTURES[i]);
          }
        }
        NBTTagCompound themeTag = nbxliteTag.getCompoundTag("Theme");
        if (mapGen == ODNBXlite.GEN_BIOMELESS) {
          mapTheme = themeTag.getInteger("Generation");
          if (nbxliteTag.getInteger("Version") < 2) {
            if (mapTheme == 2) {
              mapTheme = 3;
            } else if (mapTheme == 3) {
              mapTheme = 2;
            }
          }
        } else {
          mapTheme = ODNBXlite.THEME_NORMAL;
        }
        cloudheight = themeTag.getFloat("CloudHeight");
        skybrightness = themeTag.getInteger("SkyBrightness");
        skycolor = themeTag.getInteger("SkyColor");
        fogcolor = themeTag.getInteger("FogColor");
        cloudcolor = themeTag.getInteger("CloudColor");
        if (mapGen == ODNBXlite.GEN_BIOMELESS) {
          if (mapGenExtra == ODNBXlite.FEATURES_INDEV
              || mapGenExtra == ODNBXlite.FEATURES_CLASSIC) {
            NBTTagCompound finiteTag = nbxliteTag.getCompoundTag("Indev");
            indevX = finiteTag.getInteger("X");
            indevY = finiteTag.getInteger("Y");
            indevZ = finiteTag.getInteger("Z");
            surrgroundtype = finiteTag.getInteger("SurroundingGroundType");
            surrwatertype = finiteTag.getInteger("SurroundingWaterType");
            surrgroundheight = finiteTag.getInteger("SurroundingGroundHeight");
            surrwaterheight = finiteTag.getInteger("SurroundingWaterHeight");
            mapType = finiteTag.getInteger("Type");
          }
        }
      }
      if (par1NBTTagCompound.hasKey("snowCovered")) {
        snowCovered = par1NBTTagCompound.getBoolean("snowCovered");
        ODNBXlite.SnowCovered = snowCovered;
      }
      if (par1NBTTagCompound.hasKey("SnowCovered")) {
        snowCovered = par1NBTTagCompound.getBoolean("SnowCovered");
        ODNBXlite.SnowCovered = snowCovered;
      }
    }

    if (par1NBTTagCompound.hasKey("Player")) {
      playerTag = par1NBTTagCompound.getCompoundTag("Player");
      dimension = playerTag.getInteger("Dimension");
    }

    if (par1NBTTagCompound.hasKey("GameRules")) {
      theGameRules.readGameRulesFromNBT(par1NBTTagCompound.getCompoundTag("GameRules"));
    }
  }