From 3a9e20d3874e287d2c4cfc50e3668f28eb6ddbab Mon Sep 17 00:00:00 2001 From: Adubbz Date: Thu, 16 Jan 2014 07:55:17 +1100 Subject: [PATCH] Readded configurable biome size --- .../common/eventhandler/BOPEventHandlers.java | 2 ++ ...java => BOPMapGenVillageEventHandler.java} | 4 +-- .../world/BiomeSizeEventHandler.java | 28 +++++++++++++++++++ .../world/MapGenEventHandler.java | 2 +- 4 files changed, 33 insertions(+), 3 deletions(-) rename src/main/java/biomesoplenty/common/eventhandler/world/{BOPMapGenVillage.java => BOPMapGenVillageEventHandler.java} (83%) create mode 100644 src/main/java/biomesoplenty/common/eventhandler/world/BiomeSizeEventHandler.java diff --git a/src/main/java/biomesoplenty/common/eventhandler/BOPEventHandlers.java b/src/main/java/biomesoplenty/common/eventhandler/BOPEventHandlers.java index 57d0c2729..df36bfdcf 100755 --- a/src/main/java/biomesoplenty/common/eventhandler/BOPEventHandlers.java +++ b/src/main/java/biomesoplenty/common/eventhandler/BOPEventHandlers.java @@ -10,6 +10,7 @@ import biomesoplenty.common.eventhandler.misc.BonemealEventHandler; import biomesoplenty.common.eventhandler.misc.CapeEventHandler; import biomesoplenty.common.eventhandler.potions.PotionParalysisEventHandler; import biomesoplenty.common.eventhandler.potions.PotionPossessionEventHandler; +import biomesoplenty.common.eventhandler.world.BiomeSizeEventHandler; import biomesoplenty.common.eventhandler.world.DecorateBiomeEventHandler; import biomesoplenty.common.eventhandler.world.DecorationModificationEventHandler; import biomesoplenty.common.eventhandler.world.MapGenEventHandler; @@ -30,6 +31,7 @@ public class BOPEventHandlers { MinecraftForge.EVENT_BUS.register(new DecorateBiomeEventHandler()); MinecraftForge.TERRAIN_GEN_BUS.register(new DecorationModificationEventHandler()); + MinecraftForge.TERRAIN_GEN_BUS.register(new BiomeSizeEventHandler()); MinecraftForge.TERRAIN_GEN_BUS.register(new VillageMaterialEventHandler()); MinecraftForge.TERRAIN_GEN_BUS.register(new MapGenEventHandler()); } diff --git a/src/main/java/biomesoplenty/common/eventhandler/world/BOPMapGenVillage.java b/src/main/java/biomesoplenty/common/eventhandler/world/BOPMapGenVillageEventHandler.java similarity index 83% rename from src/main/java/biomesoplenty/common/eventhandler/world/BOPMapGenVillage.java rename to src/main/java/biomesoplenty/common/eventhandler/world/BOPMapGenVillageEventHandler.java index 1a04cd1b4..d90061adf 100644 --- a/src/main/java/biomesoplenty/common/eventhandler/world/BOPMapGenVillage.java +++ b/src/main/java/biomesoplenty/common/eventhandler/world/BOPMapGenVillageEventHandler.java @@ -4,9 +4,9 @@ import net.minecraft.world.gen.structure.MapGenVillage; import biomesoplenty.common.configuration.BOPConfigurationTerrainGen; import cpw.mods.fml.relauncher.ReflectionHelper; -public class BOPMapGenVillage extends MapGenVillage +public class BOPMapGenVillageEventHandler extends MapGenVillage { - public BOPMapGenVillage() + public BOPMapGenVillageEventHandler() { super(); diff --git a/src/main/java/biomesoplenty/common/eventhandler/world/BiomeSizeEventHandler.java b/src/main/java/biomesoplenty/common/eventhandler/world/BiomeSizeEventHandler.java new file mode 100644 index 000000000..f50fd1afa --- /dev/null +++ b/src/main/java/biomesoplenty/common/eventhandler/world/BiomeSizeEventHandler.java @@ -0,0 +1,28 @@ +package biomesoplenty.common.eventhandler.world; + +import net.minecraftforge.event.terraingen.WorldTypeEvent.BiomeSize; +import biomesoplenty.common.configuration.BOPConfigurationTerrainGen; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class BiomeSizeEventHandler +{ + @SubscribeEvent + public void onDetermineBiomeSize(BiomeSize event) + { + if (event.worldType.getWorldTypeName() == "BIOMESOP" || event.worldType.getWorldTypeName() == "ATG") + { + event.newSize = (byte)BOPConfigurationTerrainGen.biomeSize; + + if (BOPConfigurationTerrainGen.netherOverride) + { + //DimensionManager.unregisterProviderType(-1); + //DimensionManager.registerProviderType(-1, WorldProviderBOPhell.class, true); + } + } + else + { + //DimensionManager.unregisterProviderType(-1); + //DimensionManager.registerProviderType(-1, WorldProviderHell.class, true); + } + } +} diff --git a/src/main/java/biomesoplenty/common/eventhandler/world/MapGenEventHandler.java b/src/main/java/biomesoplenty/common/eventhandler/world/MapGenEventHandler.java index e9ea9551a..f4d2d25c2 100644 --- a/src/main/java/biomesoplenty/common/eventhandler/world/MapGenEventHandler.java +++ b/src/main/java/biomesoplenty/common/eventhandler/world/MapGenEventHandler.java @@ -11,7 +11,7 @@ public class MapGenEventHandler { if (event.type == EventType.VILLAGE) { - event.newGen = new BOPMapGenVillage(); + event.newGen = new BOPMapGenVillageEventHandler(); } } }