From a71195616853491c5b7df5c39e7ad4f270e5e0e9 Mon Sep 17 00:00:00 2001 From: Adubbz Date: Sun, 2 Feb 2014 12:19:54 +1100 Subject: [PATCH] Added support for registering non-overworld biomes --- .../java/biomesoplenty/BiomesOPlenty.java | 7 +- .../biomesoplenty/api/BOPBiomeHelper.java | 30 +++- .../common/blocks/BlockPromisedPortal.java | 2 +- .../BOPConfigurationBiomeGen.java | 20 ++- .../BOPConfigurationStrongholds.java | 2 +- .../structures/BOPConfigurationVillages.java | 2 +- .../biomesoplenty/common/core/BOPBiomes.java | 142 +++++++++--------- .../common/core/BOPDimensions.java | 32 ++++ .../common/core/BOPEntities.java | 4 +- .../world/VillageMaterialEventHandler.java | 52 +++---- .../common/utils/BiomeUtils.java | 16 ++ .../common/world/WorldProviderPromised.java | 8 +- .../common/world/layer/GenLayerBiomeBOP.java | 4 +- .../world/layer/GenLayerBiomesCustom.java | 15 +- .../layer/hell/BiomeLayerHellBiomes.java | 8 +- 15 files changed, 213 insertions(+), 131 deletions(-) create mode 100644 src/main/java/biomesoplenty/common/core/BOPDimensions.java create mode 100644 src/main/java/biomesoplenty/common/utils/BiomeUtils.java diff --git a/src/main/java/biomesoplenty/BiomesOPlenty.java b/src/main/java/biomesoplenty/BiomesOPlenty.java index d32f5c8da..c3bd196bd 100644 --- a/src/main/java/biomesoplenty/BiomesOPlenty.java +++ b/src/main/java/biomesoplenty/BiomesOPlenty.java @@ -12,6 +12,7 @@ import biomesoplenty.common.core.BOPArmor; import biomesoplenty.common.core.BOPBiomes; import biomesoplenty.common.core.BOPBlocks; import biomesoplenty.common.core.BOPCrafting; +import biomesoplenty.common.core.BOPDimensions; import biomesoplenty.common.core.BOPEntities; import biomesoplenty.common.core.BOPFluids; import biomesoplenty.common.core.BOPItems; @@ -90,10 +91,8 @@ public class BiomesOPlenty packetPipeline.initalize(); TreecapitatorIntegration.init(); - DimensionManager.unregisterProviderType(-1); - DimensionManager.registerProviderType(-1, WorldProviderBopHell.class, true); - //DimensionManager.registerProviderType(BOPConfigurationIDs.promisedLandDimID, WorldProviderPromised.class, false); - //DimensionManager.registerDimension(BOPConfigurationIDs.promisedLandDimID, BOPConfigurationIDs.promisedLandDimID); + + BOPDimensions.init(); } @EventHandler diff --git a/src/main/java/biomesoplenty/api/BOPBiomeHelper.java b/src/main/java/biomesoplenty/api/BOPBiomeHelper.java index 47937586a..b2412853c 100644 --- a/src/main/java/biomesoplenty/api/BOPBiomeHelper.java +++ b/src/main/java/biomesoplenty/api/BOPBiomeHelper.java @@ -2,6 +2,7 @@ package biomesoplenty.api; import java.util.HashMap; import java.util.List; +import java.util.Map.Entry; import net.minecraft.util.WeightedRandom; import net.minecraft.world.biome.BiomeGenBase; @@ -9,25 +10,38 @@ import net.minecraft.world.biome.BiomeGenBase; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.text.WordUtils; +import biomesoplenty.common.configuration.BOPConfigurationIDs; import biomesoplenty.common.world.layer.GenLayerBiomeBOP; public class BOPBiomeHelper { - public static HashMap biomeList = new HashMap(); + public static HashMap[] biomeLists = new HashMap[256]; + + public static void init() + { + biomeLists[-1 + 1] = new HashMap(); + biomeLists[0 + 1] = new HashMap(); + biomeLists[BOPConfigurationIDs.promisedLandDimID + 1] = new HashMap(); + } + + public static void registerBiome(BOPBiomeEntry biome, int dimID, String name) + { + biomeLists[dimID + 1].put(name, biome); + } public static void registerBiome(BOPBiomeEntry biome, String name) { - biomeList.put(name, biome); + registerBiome(biome, 0, name); + } + + public static BiomeGenBase get(int dimID, String name) + { + return biomeLists[dimID + 1].get("biomesoplenty:" + name).biome; } public static BiomeGenBase get(String name) { - return biomeList.get(name).biome; - } - - public static BiomeGenBase getBOPBiome(String name) - { - return get("biomesoplenty:" + name); + return get(0, name); } public static String convertBiomeName(String originalName) diff --git a/src/main/java/biomesoplenty/common/blocks/BlockPromisedPortal.java b/src/main/java/biomesoplenty/common/blocks/BlockPromisedPortal.java index 1b71155bb..f7273695d 100644 --- a/src/main/java/biomesoplenty/common/blocks/BlockPromisedPortal.java +++ b/src/main/java/biomesoplenty/common/blocks/BlockPromisedPortal.java @@ -78,7 +78,7 @@ public class BlockPromisedPortal extends Block EntityPlayerMP thePlayer = (EntityPlayerMP) entity; if (entity.dimension != BOPConfigurationIDs.promisedLandDimID) { - //thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, BOPConfigurationIDs.promisedLandDimID, new TeleporterPromised(thePlayer.mcServer.worldServerForDimension(BOPConfigurationIDs.promisedLandDimID))); + thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, BOPConfigurationIDs.promisedLandDimID, new TeleporterPromised(thePlayer.mcServer.worldServerForDimension(BOPConfigurationIDs.promisedLandDimID))); } else { diff --git a/src/main/java/biomesoplenty/common/configuration/BOPConfigurationBiomeGen.java b/src/main/java/biomesoplenty/common/configuration/BOPConfigurationBiomeGen.java index 8d3e2c2d5..55af868d2 100644 --- a/src/main/java/biomesoplenty/common/configuration/BOPConfigurationBiomeGen.java +++ b/src/main/java/biomesoplenty/common/configuration/BOPConfigurationBiomeGen.java @@ -14,6 +14,7 @@ import biomesoplenty.api.BOPBiomeHelper.BOPBiomeEntry; import biomesoplenty.api.BOPBiomeHelper.TemperatureType; import biomesoplenty.common.core.BOPBiomes; import biomesoplenty.common.world.layer.GenLayerBiomeBOP; +import biomesoplenty.common.world.layer.hell.BiomeLayerHellBiomes; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.FMLLog; @@ -45,15 +46,28 @@ public class BOPConfigurationBiomeGen try { config.load(); - - for (BOPBiomeEntry entry : BOPBiomeHelper.biomeList.values()) + + for (BOPBiomeEntry entry : BOPBiomeHelper.biomeLists[-1 + 1].values()) { BiomeGenBase biome = entry.biome; String name = biome.biomeName; String convertedName = BOPBiomeHelper.convertBiomeName(name); - if (config.get("Biomes To Generate (There must be at least one from each category)", name + " (" + WordUtils.capitalize(entry.temperatureType.toString().toLowerCase()) + ")", !disabledBiomes.contains(convertedName)).getBoolean(!disabledBiomes.contains(convertedName))) + if (config.get("Nether Biomes To Generate (There must be at least one from each category)", name, !disabledBiomes.contains(convertedName)).getBoolean(!disabledBiomes.contains(convertedName))) + { + BiomeLayerHellBiomes.netherBiomes.add(biome); + } + } + + for (BOPBiomeEntry entry : BOPBiomeHelper.biomeLists[0 + 1].values()) + { + BiomeGenBase biome = entry.biome; + + String name = biome.biomeName; + String convertedName = BOPBiomeHelper.convertBiomeName(name); + + if (config.get("Overworld Biomes To Generate (There must be at least one from each category)", name + " (" + WordUtils.capitalize(entry.temperatureType.toString().toLowerCase()) + ")", !disabledBiomes.contains(convertedName)).getBoolean(!disabledBiomes.contains(convertedName))) { if (BOPBiomes.onlyBiome != null ? entry == BOPBiomes.onlyBiome : true) { diff --git a/src/main/java/biomesoplenty/common/configuration/structures/BOPConfigurationStrongholds.java b/src/main/java/biomesoplenty/common/configuration/structures/BOPConfigurationStrongholds.java index 93d9ec102..000fb464f 100644 --- a/src/main/java/biomesoplenty/common/configuration/structures/BOPConfigurationStrongholds.java +++ b/src/main/java/biomesoplenty/common/configuration/structures/BOPConfigurationStrongholds.java @@ -111,7 +111,7 @@ public class BOPConfigurationStrongholds { config.load(); - for (BOPBiomeEntry entry : BOPBiomeHelper.biomeList.values()) + for (BOPBiomeEntry entry : BOPBiomeHelper.biomeLists[0 + 1].values()) { BiomeGenBase biome = entry.biome; diff --git a/src/main/java/biomesoplenty/common/configuration/structures/BOPConfigurationVillages.java b/src/main/java/biomesoplenty/common/configuration/structures/BOPConfigurationVillages.java index 3347b1c57..62e11144d 100644 --- a/src/main/java/biomesoplenty/common/configuration/structures/BOPConfigurationVillages.java +++ b/src/main/java/biomesoplenty/common/configuration/structures/BOPConfigurationVillages.java @@ -106,7 +106,7 @@ public class BOPConfigurationVillages villageDistance = config.get("Biomes O\' Plenty World Type Settings", "Distance between villages", 32, "In Vanilla it is set to 32").getInt(); if (villageDistance < 8) villageDistance = 8; - for (BOPBiomeEntry entry : BOPBiomeHelper.biomeList.values()) + for (BOPBiomeEntry entry : BOPBiomeHelper.biomeLists[0 + 1].values()) { BiomeGenBase biome = entry.biome; diff --git a/src/main/java/biomesoplenty/common/core/BOPBiomes.java b/src/main/java/biomesoplenty/common/core/BOPBiomes.java index 4aceeaef0..2dec64dfb 100644 --- a/src/main/java/biomesoplenty/common/core/BOPBiomes.java +++ b/src/main/java/biomesoplenty/common/core/BOPBiomes.java @@ -1,5 +1,7 @@ package biomesoplenty.common.core; +import static biomesoplenty.common.configuration.BOPConfigurationIDs.promisedLandDimID; + import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.WorldChunkManager; import net.minecraftforge.common.BiomeDictionary; @@ -82,6 +84,7 @@ public class BOPBiomes public static void init() { + BOPBiomeHelper.init(); registerBiomes(); addBiomesToDictionary(); addSpawnBiomes(); @@ -173,9 +176,9 @@ public class BOPBiomes registerBiome(new BOPBiomeEntry(new BiomeGenWetland(BOPConfigurationIDs.wetlandID).setBiomeName("Wetland"), TemperatureType.WARM, 50)); registerBiome(new BOPBiomeEntry(new BiomeGenWoodland(BOPConfigurationIDs.woodlandID).setBiomeName("Woodland"), TemperatureType.WARM, 50)); - //registerBiome(new BOPBiomeEntry(new BiomeGenPromisedLandForest(BOPConfigurationIDs.wonderousWoodsID).setBiomeName("Wonderous Woods"), TemperatureType.WARM, 50)); - //registerBiome(new BOPBiomeEntry(new BiomeGenPromisedLandPlains(BOPConfigurationIDs.majesticMeadowID).setBiomeName("Majestic Meadow"), TemperatureType.WARM, 50)); - //registerBiome(new BOPBiomeEntry(new BiomeGenPromisedLandSwamp(BOPConfigurationIDs.blessedBogID).setBiomeName("Blessed Bog"), TemperatureType.WARM, 50)); + registerBiome(new BOPBiomeEntry(new BiomeGenPromisedLandForest(BOPConfigurationIDs.wonderousWoodsID).setBiomeName("Wonderous Woods"), TemperatureType.WARM, 50), promisedLandDimID); + registerBiome(new BOPBiomeEntry(new BiomeGenPromisedLandPlains(BOPConfigurationIDs.majesticMeadowID).setBiomeName("Majestic Meadow"), TemperatureType.WARM, 50), promisedLandDimID); + registerBiome(new BOPBiomeEntry(new BiomeGenPromisedLandSwamp(BOPConfigurationIDs.blessedBogID).setBiomeName("Blessed Bog"), TemperatureType.WARM, 50), promisedLandDimID); } private static void addSpawnBiomes() @@ -192,7 +195,7 @@ public class BOPBiomes } else { - for (BOPBiomeEntry entry : BOPBiomeHelper.biomeList.values()) + for (BOPBiomeEntry entry : BOPBiomeHelper.biomeLists[0 + 1].values()) { addSpawnBiome(entry.biome); } @@ -201,67 +204,67 @@ public class BOPBiomes private static void addBiomesToDictionary() { - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("alps"), Type.FROZEN, Type.MOUNTAIN); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("alps"), Type.FROZEN, Type.MOUNTAIN); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("alpsBase"), Type.FROZEN, Type.MOUNTAIN, Type.FOREST); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("alpsForest"), Type.FROZEN, Type.MOUNTAIN); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("arctic"), Type.FROZEN, Type.WASTELAND); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("arctic"), Type.FROZEN, Type.WASTELAND); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("autumnHills"), Type.FOREST, Type.HILLS); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("badlands"), Type.DESERT, Type.WASTELAND); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("bambooForest"), Type.JUNGLE, Type.FOREST); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("bayou"), Type.SWAMP, Type.WATER); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("bambooForest"), Type.JUNGLE, Type.FOREST); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("bayou"), Type.SWAMP, Type.WATER); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("beachGravel"), Type.BEACH); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("beachOvergrown"), Type.BEACH, Type.FOREST); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("birchForest"), Type.FOREST); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("bog"), Type.SWAMP, Type.FOREST); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("borealForest"), Type.FOREST); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("brushland"), Type.DESERT, Type.FOREST, Type.PLAINS); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("bog"), Type.SWAMP, Type.FOREST); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("borealForest"), Type.FOREST); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("brushland"), Type.DESERT, Type.FOREST, Type.PLAINS); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("canyon"), Type.DESERT, Type.MOUNTAIN, Type.HILLS); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("canyon"), Type.DESERT, Type.MOUNTAIN, Type.HILLS); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("canyonRavine"), Type.DESERT, Type.HILLS); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("chaparral"), Type.PLAINS); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("cherryBlossomGrove"), Type.MAGICAL, Type.FOREST); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("coniferousForest"), Type.FOREST, Type.HILLS); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("snowyConiferousForest"), Type.FROZEN, Type.FOREST, Type.HILLS); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("crag"), Type.WASTELAND, Type.MOUNTAIN); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("deadForest"), Type.FOREST); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("chaparral"), Type.PLAINS); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("cherryBlossomGrove"), Type.MAGICAL, Type.FOREST); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("coniferousForest"), Type.FOREST, Type.HILLS); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("snowyConiferousForest"), Type.FROZEN, Type.FOREST, Type.HILLS); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("crag"), Type.WASTELAND, Type.MOUNTAIN); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("deadForest"), Type.FOREST); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("deadForestSnow"), Type.FOREST, Type.FROZEN); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("deadlands"), Type.WASTELAND); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("deadSwamp"), Type.SWAMP); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("deciduousForest"), Type.FOREST); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("dunes"), Type.BEACH, Type.DESERT, Type.HILLS); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("fen"), Type.FOREST, Type.SWAMP); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("flowerField"), Type.PLAINS); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("deadSwamp"), Type.SWAMP); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("deciduousForest"), Type.FOREST); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("dunes"), Type.BEACH, Type.DESERT, Type.HILLS); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("fen"), Type.FOREST, Type.SWAMP); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("flowerField"), Type.PLAINS); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("fieldForest"), Type.PLAINS, Type.FOREST); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("frostForest"), Type.FROZEN, Type.FOREST); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("frostForest"), Type.FROZEN, Type.FOREST); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("fungiForest"), Type.MAGICAL, Type.MUSHROOM, Type.FOREST, Type.SWAMP); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("garden"), Type.MAGICAL, Type.PLAINS); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("glacier"), Type.FROZEN, Type.HILLS); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("grassland"), Type.PLAINS, Type.SWAMP, Type.HILLS); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("grove"), Type.FOREST, Type.PLAINS); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("heathland"), Type.PLAINS); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("highland"), Type.HILLS, Type.MOUNTAIN); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("grassland"), Type.PLAINS, Type.SWAMP, Type.HILLS); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("grove"), Type.FOREST, Type.PLAINS); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("heathland"), Type.PLAINS); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("highland"), Type.HILLS, Type.MOUNTAIN); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("hotSprings"), Type.HILLS, Type.FOREST, Type.WATER); // BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("icyHills"), Type.FROZEN, Type.HILLS); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("jadeCliffs"), Type.FOREST, Type.MOUNTAIN); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("lavenderFields"), Type.PLAINS); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("lushDesert"), Type.DESERT, Type.FOREST); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("lushSwamp"), Type.SWAMP, Type.WATER); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("jadeCliffs"), Type.FOREST, Type.MOUNTAIN); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("lavenderFields"), Type.PLAINS); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("lushDesert"), Type.DESERT, Type.FOREST); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("lushSwamp"), Type.SWAMP, Type.WATER); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("mangrove"), Type.WATER, Type.FOREST); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("mapleWoods"), Type.FOREST); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("marsh"), Type.SWAMP, Type.WATER); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("mapleWoods"), Type.FOREST); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("marsh"), Type.SWAMP, Type.WATER); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("meadow"), Type.FOREST, Type.PLAINS); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("meadow"), Type.FOREST, Type.PLAINS); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("meadowForest"), Type.FOREST, Type.PLAINS); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("mesa"), Type.DESERT, Type.WASTELAND, Type.MOUNTAIN); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("moor"), Type.HILLS, Type.SWAMP); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("mountain"), Type.MOUNTAIN); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("moor"), Type.HILLS, Type.SWAMP); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("mountain"), Type.MOUNTAIN); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("mysticGrove"), Type.MAGICAL, Type.FOREST); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("mysticGrove"), Type.MAGICAL, Type.FOREST); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("mysticGroveThin"), Type.MAGICAL, Type.FOREST); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("netherBase"), Type.NETHER); @@ -277,61 +280,61 @@ public class BOPBiomes //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("oceanCoral"), Type.WATER); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("oceanKelp"), Type.WATER, Type.FOREST); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("ominousWoods"), Type.MAGICAL); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("ominousWoods"), Type.MAGICAL); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("ominousWoodsThick"), Type.MAGICAL); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("orchard"), Type.FOREST, Type.PLAINS); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("outback"), Type.DESERT, Type.PLAINS); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("outback"), Type.DESERT, Type.PLAINS); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("overgrownGreens"), Type.JUNGLE, Type.PLAINS); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("pasture"), Type.PLAINS); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("pasture"), Type.PLAINS); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("pastureThin"), Type.PLAINS); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("pastureMeadow"), Type.PLAINS, Type.FOREST); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("polar"), Type.FROZEN, Type.WATER); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("prairie"), Type.PLAINS); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("prairie"), Type.PLAINS); - //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("wonderousWoods"), Type.FOREST, Type.MAGICAL); - //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("majesticMeadow"), Type.PLAINS, Type.MAGICAL); - //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("promisedLandShrub"), Type.PLAINS, Type.FOREST, Type.MAGICAL); - //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("blessedBog"), Type.SWAMP, Type.MAGICAL); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get(promisedLandDimID, "wonderousWoods"), Type.FOREST, Type.MAGICAL); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get(promisedLandDimID, "majesticMeadow"), Type.PLAINS, Type.MAGICAL); + //BiomeDictionary.registerBiomeType(BOPBiomeHelper.get(promisedLandDimID, "promisedLandShrub"), Type.PLAINS, Type.FOREST, Type.MAGICAL); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get(promisedLandDimID, "blessedBog"), Type.SWAMP, Type.MAGICAL); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("quagmire"), Type.WASTELAND, Type.SWAMP); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("rainforest"), Type.JUNGLE, Type.HILLS, Type.FOREST); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("redwoodForest"), Type.FOREST); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("sacredSprings"), Type.MOUNTAIN, Type.FOREST, Type.MAGICAL); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("quagmire"), Type.WASTELAND, Type.SWAMP); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("rainforest"), Type.JUNGLE, Type.HILLS, Type.FOREST); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("redwoodForest"), Type.FOREST); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("sacredSprings"), Type.MOUNTAIN, Type.FOREST, Type.MAGICAL); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("savanna"), Type.DESERT, Type.PLAINS); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("savannaPlateau"), Type.DESERT, Type.PLAINS, Type.HILLS); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("scrubland"), Type.DESERT, Type.PLAINS); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("seasonalForest"), Type.FOREST); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("seasonalForest"), Type.FOREST); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("seasonalSpruceForest"), Type.FOREST); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("shield"), Type.FOREST, Type.WATER); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("shield"), Type.FOREST, Type.WATER); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("shrubland"), Type.PLAINS); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("shrubland"), Type.PLAINS); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("shrublandForest"), Type.PLAINS); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("silkglades"), Type.SWAMP, Type.WASTELAND); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("sludgepit"), Type.SWAMP, Type.FOREST, Type.WASTELAND); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("spruceWoods"), Type.FOREST); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("silkglades"), Type.SWAMP, Type.WASTELAND); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("sludgepit"), Type.SWAMP, Type.FOREST, Type.WASTELAND); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("spruceWoods"), Type.FOREST); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("steppe"), Type.PLAINS, Type.DESERT); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("temperateRainforest"), Type.FOREST, Type.HILLS); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("thicket"), Type.PLAINS, Type.FOREST); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("temperateRainforest"), Type.FOREST, Type.HILLS); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("thicket"), Type.PLAINS, Type.FOREST); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("timber"), Type.FOREST); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("timber"), Type.FOREST); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("timberThin"), Type.FOREST); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("tropicalRainforest"), Type.JUNGLE); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("tropicalRainforest"), Type.JUNGLE); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("tropics"), Type.JUNGLE, Type.WATER); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("tropics"), Type.JUNGLE, Type.WATER); //BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("tropicsMountain"), Type.JUNGLE, Type.WATER); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("tundra"), Type.FROZEN, Type.WASTELAND); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("volcano"), Type.WASTELAND, Type.MOUNTAIN); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("wasteland"), Type.WASTELAND); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("wetland"), Type.SWAMP, Type.FOREST); - BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("woodland"), Type.FOREST); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("tundra"), Type.FROZEN, Type.WASTELAND); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("volcano"), Type.WASTELAND, Type.MOUNTAIN); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("wasteland"), Type.WASTELAND); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("wetland"), Type.SWAMP, Type.FOREST); + BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("woodland"), Type.FOREST); } public static void registerOnlyBiome(BOPBiomeEntry biome) @@ -345,9 +348,14 @@ public class BOPBiomes BOPBiomeHelper.registerBiome(biome, "minecraft:" + BOPBiomeHelper.convertBiomeName(biome.biome.biomeName)); } + public static void registerBiome(BOPBiomeEntry biome, int dimID) + { + BOPBiomeHelper.registerBiome(biome, dimID, "biomesoplenty:" + BOPBiomeHelper.convertBiomeName(biome.biome.biomeName)); + } + public static void registerBiome(BOPBiomeEntry biome) { - BOPBiomeHelper.registerBiome(biome, "biomesoplenty:" + BOPBiomeHelper.convertBiomeName(biome.biome.biomeName)); + registerBiome(biome, 0); } public static void addSpawnBiome(BiomeGenBase biome) diff --git a/src/main/java/biomesoplenty/common/core/BOPDimensions.java b/src/main/java/biomesoplenty/common/core/BOPDimensions.java new file mode 100644 index 000000000..01cd5b8df --- /dev/null +++ b/src/main/java/biomesoplenty/common/core/BOPDimensions.java @@ -0,0 +1,32 @@ +package biomesoplenty.common.core; + +import biomesoplenty.common.configuration.BOPConfigurationIDs; +import biomesoplenty.common.world.WorldProviderBopHell; +import biomesoplenty.common.world.WorldProviderPromised; +import net.minecraftforge.common.DimensionManager; + +public class BOPDimensions +{ + public static void init() + { + unregisterProviders(); + registerProviders(); + registerDimensions(); + } + + private static void unregisterProviders() + { + DimensionManager.unregisterProviderType(-1); + } + + private static void registerProviders() + { + DimensionManager.registerProviderType(-1, WorldProviderBopHell.class, true); + DimensionManager.registerProviderType(BOPConfigurationIDs.promisedLandDimID, WorldProviderPromised.class, false); + } + + private static void registerDimensions() + { + DimensionManager.registerDimension(BOPConfigurationIDs.promisedLandDimID, BOPConfigurationIDs.promisedLandDimID); + } +} diff --git a/src/main/java/biomesoplenty/common/core/BOPEntities.java b/src/main/java/biomesoplenty/common/core/BOPEntities.java index 3fd189d0c..a0e2375d6 100644 --- a/src/main/java/biomesoplenty/common/core/BOPEntities.java +++ b/src/main/java/biomesoplenty/common/core/BOPEntities.java @@ -39,7 +39,7 @@ public class BOPEntities registerEntityEgg(EntityJungleSpider.class, 5147192, 11013646); - EntityRegistry.addSpawn(EntityJungleSpider.class, 8, 1, 3, EnumCreatureType.monster, BOPBiomeHelper.getBOPBiome("bambooForest"), BiomeGenBase.jungle, BOPBiomeHelper.getBOPBiome("tropicalRainforest")/*, Biomes.oasis.get()*/, BOPBiomeHelper.getBOPBiome("tropics")); + EntityRegistry.addSpawn(EntityJungleSpider.class, 8, 1, 3, EnumCreatureType.monster, BOPBiomeHelper.get("bambooForest"), BiomeGenBase.jungle, BOPBiomeHelper.get("tropicalRainforest")/*, Biomes.oasis.get()*/, BOPBiomeHelper.get("tropics")); } if (BOPConfigurationIDs.rosesterID > 0) @@ -60,7 +60,7 @@ public class BOPEntities registerEntityEgg(EntityGlob.class, 6836276, 8414787); - EntityRegistry.addSpawn(EntityGlob.class, 1, 1, 1, EnumCreatureType.creature, BOPBiomeHelper.getBOPBiome("bog"), BOPBiomeHelper.getBOPBiome("deadSwamp"), BOPBiomeHelper.getBOPBiome("fen"), BOPBiomeHelper.getBOPBiome("moor"), BOPBiomeHelper.getBOPBiome("quagmire"), BOPBiomeHelper.getBOPBiome("sludgepit"), BiomeGenBase.swampland); + EntityRegistry.addSpawn(EntityGlob.class, 1, 1, 1, EnumCreatureType.creature, BOPBiomeHelper.get("bog"), BOPBiomeHelper.get("deadSwamp"), BOPBiomeHelper.get("fen"), BOPBiomeHelper.get("moor"), BOPBiomeHelper.get("quagmire"), BOPBiomeHelper.get("sludgepit"), BiomeGenBase.swampland); } if (BOPConfigurationIDs.phantomID > 0) diff --git a/src/main/java/biomesoplenty/common/eventhandler/world/VillageMaterialEventHandler.java b/src/main/java/biomesoplenty/common/eventhandler/world/VillageMaterialEventHandler.java index 003499b82..424f82eb9 100644 --- a/src/main/java/biomesoplenty/common/eventhandler/world/VillageMaterialEventHandler.java +++ b/src/main/java/biomesoplenty/common/eventhandler/world/VillageMaterialEventHandler.java @@ -15,7 +15,7 @@ public class VillageMaterialEventHandler public void getVillageBlockID(BiomeEvent.GetVillageBlockID event) { //Arctic - if (event.biome == BOPBiomeHelper.getBOPBiome("arctic")) + if (event.biome == BOPBiomeHelper.get("arctic")) { //Cobblestone if (event.original == Blocks.cobblestone) @@ -141,7 +141,7 @@ public class VillageMaterialEventHandler }*/ //Brushland - if (event.biome == BOPBiomeHelper.getBOPBiome("brushland")) + if (event.biome == BOPBiomeHelper.get("brushland")) { //Gravel if (event.original == Blocks.gravel) @@ -152,7 +152,7 @@ public class VillageMaterialEventHandler } //Coniferous Forest - if (event.biome == BOPBiomeHelper.getBOPBiome("coniferousForest")) + if (event.biome == BOPBiomeHelper.get("coniferousForest")) { //Cobblestone if (event.original == Blocks.cobblestone) @@ -263,7 +263,7 @@ public class VillageMaterialEventHandler }*/ //Grove - if (event.biome == BOPBiomeHelper.getBOPBiome("grove")) + if (event.biome == BOPBiomeHelper.get("grove")) { //Cobblestone if (event.original == Blocks.cobblestone) @@ -314,7 +314,7 @@ public class VillageMaterialEventHandler } //Heathland - if (event.biome == BOPBiomeHelper.getBOPBiome("heathland")) + if (event.biome == BOPBiomeHelper.get("heathland")) { //Logs if (event.original == Blocks.log) @@ -346,7 +346,7 @@ public class VillageMaterialEventHandler } //Lush Desert - if (event.biome == BOPBiomeHelper.getBOPBiome("lushDesert")) + if (event.biome == BOPBiomeHelper.get("lushDesert")) { //Cobblestone if (event.original == Blocks.cobblestone) @@ -399,7 +399,7 @@ public class VillageMaterialEventHandler } //Lush Swamp - if (event.biome == BOPBiomeHelper.getBOPBiome("lushSwamp")) + if (event.biome == BOPBiomeHelper.get("lushSwamp")) { //Gravel if (event.original == Blocks.cobblestone) @@ -410,7 +410,7 @@ public class VillageMaterialEventHandler } //Maple Woods - if (event.biome == BOPBiomeHelper.getBOPBiome("mapleWoods")) + if (event.biome == BOPBiomeHelper.get("mapleWoods")) { //Wooden Stairs if (event.original == Blocks.oak_stairs) @@ -421,7 +421,7 @@ public class VillageMaterialEventHandler } //Meadow - if (event.biome == BOPBiomeHelper.getBOPBiome("meadow")) + if (event.biome == BOPBiomeHelper.get("meadow")) { //Cobblestone if (event.original == Blocks.cobblestone) @@ -523,7 +523,7 @@ public class VillageMaterialEventHandler }*/ //Outback - if (event.biome == BOPBiomeHelper.getBOPBiome("outback")) + if (event.biome == BOPBiomeHelper.get("outback")) { //Cobblestone if (event.original == Blocks.cobblestone) @@ -620,7 +620,7 @@ public class VillageMaterialEventHandler }*/ //Prairie - if (event.biome == BOPBiomeHelper.getBOPBiome("prairie")) + if (event.biome == BOPBiomeHelper.get("prairie")) { //Gravel if (event.original == Blocks.gravel) @@ -714,7 +714,7 @@ public class VillageMaterialEventHandler }*/ //Snowy Coniferous Forest - if (event.biome == BOPBiomeHelper.getBOPBiome("snowyConiferousForest")) + if (event.biome == BOPBiomeHelper.get("snowyConiferousForest")) { //Cobblestone if (event.original == Blocks.cobblestone) @@ -779,7 +779,7 @@ public class VillageMaterialEventHandler } //Spruce Woods - if (event.biome == BOPBiomeHelper.getBOPBiome("spruceWoods")) + if (event.biome == BOPBiomeHelper.get("spruceWoods")) { //Wooden Stairs if (event.original == Blocks.oak_stairs) @@ -862,7 +862,7 @@ public class VillageMaterialEventHandler }*/ //Tropical Rainforest - if (event.biome == BOPBiomeHelper.getBOPBiome("tropicalRainforest")) + if (event.biome == BOPBiomeHelper.get("tropicalRainforest")) { //Cobblestone if (event.original == Blocks.cobblestone) @@ -920,7 +920,7 @@ public class VillageMaterialEventHandler } //Wetland - if (event.biome == BOPBiomeHelper.getBOPBiome("wetland")) + if (event.biome == BOPBiomeHelper.get("wetland")) { //Cobblestone if (event.original == Blocks.cobblestone) @@ -1000,7 +1000,7 @@ public class VillageMaterialEventHandler }*/ //Coniferous Forest - if (event.biome == BOPBiomeHelper.getBOPBiome("coniferousForest")) + if (event.biome == BOPBiomeHelper.get("coniferousForest")) { //Cobblestone if (event.original == Blocks.cobblestone) @@ -1050,7 +1050,7 @@ public class VillageMaterialEventHandler }*/ //Grove - if (event.biome == BOPBiomeHelper.getBOPBiome("grove")) + if (event.biome == BOPBiomeHelper.get("grove")) { //Cobblestone if (event.original == Blocks.cobblestone) @@ -1089,7 +1089,7 @@ public class VillageMaterialEventHandler } //Heathland - if (event.biome == BOPBiomeHelper.getBOPBiome("heathland")) + if (event.biome == BOPBiomeHelper.get("heathland")) { //Logs if (event.original == Blocks.log) @@ -1107,7 +1107,7 @@ public class VillageMaterialEventHandler } //Lush Desert - if (event.biome == BOPBiomeHelper.getBOPBiome("lushDesert")) + if (event.biome == BOPBiomeHelper.get("lushDesert")) { //Cobblestone if (event.original == Blocks.cobblestone) @@ -1133,7 +1133,7 @@ public class VillageMaterialEventHandler } //Maple Woods - if (event.biome == BOPBiomeHelper.getBOPBiome("mapleWoods")) + if (event.biome == BOPBiomeHelper.get("mapleWoods")) { //Logs if (event.original == Blocks.log) @@ -1151,7 +1151,7 @@ public class VillageMaterialEventHandler } //Meadow - if (event.biome == BOPBiomeHelper.getBOPBiome("meadow")) + if (event.biome == BOPBiomeHelper.get("meadow")) { //Cobblestone if (event.original == Blocks.cobblestone) @@ -1215,7 +1215,7 @@ public class VillageMaterialEventHandler }*/ //Outback - if (event.biome == BOPBiomeHelper.getBOPBiome("outback")) + if (event.biome == BOPBiomeHelper.get("outback")) { //Wooden Planks if (event.original == Blocks.planks) @@ -1244,7 +1244,7 @@ public class VillageMaterialEventHandler }*/ //Snowy Coniferous Forest - if (event.biome == BOPBiomeHelper.getBOPBiome("snowyConiferousForest")) + if (event.biome == BOPBiomeHelper.get("snowyConiferousForest")) { //Cobblestone if (event.original == Blocks.cobblestone) @@ -1276,7 +1276,7 @@ public class VillageMaterialEventHandler } //Spruce Woods - if (event.biome == BOPBiomeHelper.getBOPBiome("spruceWoods")) + if (event.biome == BOPBiomeHelper.get("spruceWoods")) { //Logs if (event.original == Blocks.log) @@ -1294,7 +1294,7 @@ public class VillageMaterialEventHandler } //Tropical Rainforest - if (event.biome == BOPBiomeHelper.getBOPBiome("tropicalRainforest")) + if (event.biome == BOPBiomeHelper.get("tropicalRainforest")) { //Cobblestone if (event.original == Blocks.cobblestone) @@ -1326,7 +1326,7 @@ public class VillageMaterialEventHandler } //Wetland - if (event.biome == BOPBiomeHelper.getBOPBiome("wetland")) + if (event.biome == BOPBiomeHelper.get("wetland")) { //Cobblestone if (event.original == Blocks.cobblestone) diff --git a/src/main/java/biomesoplenty/common/utils/BiomeUtils.java b/src/main/java/biomesoplenty/common/utils/BiomeUtils.java new file mode 100644 index 000000000..061bd04bd --- /dev/null +++ b/src/main/java/biomesoplenty/common/utils/BiomeUtils.java @@ -0,0 +1,16 @@ +package biomesoplenty.common.utils; + +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; + +public class BiomeUtils +{ + public static void setBiomeAt(World world, int x, int z, BiomeGenBase biome) + { + Chunk chunk = world.getChunkFromBlockCoords(x, z); + byte array[] = chunk.getBiomeArray(); + array[(z & 0xf) << 4 | x & 0xf] = (byte)(biome.biomeID & 0xff); + chunk.setBiomeArray(array); + } +} diff --git a/src/main/java/biomesoplenty/common/world/WorldProviderPromised.java b/src/main/java/biomesoplenty/common/world/WorldProviderPromised.java index 7e9c8216f..d8faef635 100644 --- a/src/main/java/biomesoplenty/common/world/WorldProviderPromised.java +++ b/src/main/java/biomesoplenty/common/world/WorldProviderPromised.java @@ -1,5 +1,7 @@ package biomesoplenty.common.world; +import static biomesoplenty.common.configuration.BOPConfigurationIDs.promisedLandDimID; + import org.apache.logging.log4j.Level; import biomesoplenty.api.BOPBiomeHelper; @@ -45,10 +47,8 @@ public class WorldProviderPromised extends WorldProvider @Override public void registerWorldChunkManager() { - if (BOPBiomeHelper.getBOPBiome("wonderousWoods") != null || BOPBiomeHelper.getBOPBiome("majesticMeadow") != null || BOPBiomeHelper.getBOPBiome("blessedBog") != null) - { - worldChunkMgr = new WorldChunkManagerPromised(worldObj); - } + worldChunkMgr = new WorldChunkManagerPromised(worldObj); + dimensionId = BOPConfigurationIDs.promisedLandDimID; } diff --git a/src/main/java/biomesoplenty/common/world/layer/GenLayerBiomeBOP.java b/src/main/java/biomesoplenty/common/world/layer/GenLayerBiomeBOP.java index c45e9cd6d..10f75cebe 100644 --- a/src/main/java/biomesoplenty/common/world/layer/GenLayerBiomeBOP.java +++ b/src/main/java/biomesoplenty/common/world/layer/GenLayerBiomeBOP.java @@ -22,9 +22,9 @@ public class GenLayerBiomeBOP extends GenLayerBiome public static List coldBiomes = new ArrayList(); public static List icyBiomes = new ArrayList(); - public GenLayerBiomeBOP(long par1, GenLayer parentLayer, WorldType worldType) + public GenLayerBiomeBOP(long seed, GenLayer parentLayer, WorldType worldType) { - super(par1, parentLayer, worldType); + super(seed, parentLayer, worldType); } diff --git a/src/main/java/biomesoplenty/common/world/layer/GenLayerBiomesCustom.java b/src/main/java/biomesoplenty/common/world/layer/GenLayerBiomesCustom.java index fbcffa2b6..67234ec56 100644 --- a/src/main/java/biomesoplenty/common/world/layer/GenLayerBiomesCustom.java +++ b/src/main/java/biomesoplenty/common/world/layer/GenLayerBiomesCustom.java @@ -1,5 +1,7 @@ package biomesoplenty.common.world.layer; +import static biomesoplenty.common.configuration.BOPConfigurationIDs.promisedLandDimID; + import org.apache.logging.log4j.Level; import biomesoplenty.api.BOPBiomeHelper; @@ -8,19 +10,22 @@ import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.gen.layer.GenLayer; import net.minecraft.world.gen.layer.IntCache; -public class GenLayerBiomesCustom extends GenLayer { - +public class GenLayerBiomesCustom extends GenLayer +{ protected BiomeGenBase[] allowedBiomes; - public GenLayerBiomesCustom(long seed, GenLayer genlayer) { + public GenLayerBiomesCustom(long seed, GenLayer genlayer) + { super(seed); this.parent = genlayer; } //called from GenLayerCustom.makeTheWorld - public GenLayerBiomesCustom(long seed, WorldType worldType) { + public GenLayerBiomesCustom(long seed, WorldType worldType) + { super(seed); - this.allowedBiomes = new BiomeGenBase[]{BOPBiomeHelper.getBOPBiome("wonderousWoods"), BOPBiomeHelper.getBOPBiome("majesticMeadow"), BOPBiomeHelper.getBOPBiome("blessedBog")}; + + this.allowedBiomes = new BiomeGenBase[]{BOPBiomeHelper.get(promisedLandDimID, "wonderousWoods"), BOPBiomeHelper.get(promisedLandDimID, "majesticMeadow"), BOPBiomeHelper.get(promisedLandDimID, "blessedBog")}; } @Override diff --git a/src/main/java/biomesoplenty/common/world/layer/hell/BiomeLayerHellBiomes.java b/src/main/java/biomesoplenty/common/world/layer/hell/BiomeLayerHellBiomes.java index fd75846f6..5f39da895 100644 --- a/src/main/java/biomesoplenty/common/world/layer/hell/BiomeLayerHellBiomes.java +++ b/src/main/java/biomesoplenty/common/world/layer/hell/BiomeLayerHellBiomes.java @@ -9,19 +9,13 @@ import biomesoplenty.api.BOPBiomeHelper; public class BiomeLayerHellBiomes extends BiomeLayerHell { - private int dimension = 0; - - private static ArrayList netherBiomes = new ArrayList(); + public static ArrayList netherBiomes = new ArrayList(); public BiomeLayerHellBiomes(long par1, BiomeLayerHell par3GenLayer) { super(par1); parent = par3GenLayer; - //NETHER BIOMES - - //add biomes to netherBiomes array here - if (netherBiomes.size() == 0) { netherBiomes.add(BiomeGenBase.hell);