From 970a47d8565abb283945cc0afeeb6fc6a020e3ac Mon Sep 17 00:00:00 2001 From: Adubbz Date: Mon, 13 Jan 2014 13:17:23 +1100 Subject: [PATCH] Attempting to fix block placement issues --- .../world/DecorateBiomeEventHandler.java | 13 +++--------- .../DecorationModificationEventHandler.java | 20 ++++++++----------- .../world/decoration/BOPWorldFeatures.java | 4 ++-- 3 files changed, 13 insertions(+), 24 deletions(-) diff --git a/src/main/java/biomesoplenty/common/eventhandler/world/DecorateBiomeEventHandler.java b/src/main/java/biomesoplenty/common/eventhandler/world/DecorateBiomeEventHandler.java index 3ab6a12a2..eb6658000 100644 --- a/src/main/java/biomesoplenty/common/eventhandler/world/DecorateBiomeEventHandler.java +++ b/src/main/java/biomesoplenty/common/eventhandler/world/DecorateBiomeEventHandler.java @@ -6,12 +6,9 @@ import java.lang.reflect.Field; import java.util.Random; import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeDecorator; import net.minecraft.world.biome.BiomeGenBase; -import net.minecraft.world.gen.feature.WorldGenLakes; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.event.terraingen.DecorateBiomeEvent; -import net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate; import net.minecraftforge.event.terraingen.TerrainGen; import biomesoplenty.common.world.decoration.BOPWorldFeatures; import biomesoplenty.common.world.decoration.ForcedDecorators; @@ -20,12 +17,11 @@ import biomesoplenty.common.world.generation.ForcedBOPWorldGenerators; import biomesoplenty.common.world.generation.IWorldGeneratorBOP; import biomesoplenty.common.world.generation.WorldGenFieldAssociation; import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.ReflectionHelper; public class DecorateBiomeEventHandler { @SubscribeEvent - public void onBiomeDecorate(DecorateBiomeEvent.Post event) + public void onBiomeDecorate(DecorateBiomeEvent.Pre event) { World world = event.world; @@ -33,11 +29,8 @@ public class DecorateBiomeEventHandler int chunkZ = event.chunkZ; Random random = event.rand; - - int x = chunkX; - int z = chunkZ; - BiomeGenBase biome = world.getBiomeGenForCoordsBody(x + 8, z + 8); + BiomeGenBase biome = world.getBiomeGenForCoordsBody(chunkX + 16, chunkZ + 16); IBOPDecoration bopDecoration = null; @@ -82,7 +75,7 @@ public class DecorateBiomeEventHandler if (worldGeneratorBOP != null) { - worldGeneratorBOP.doGeneration(world, random, worldGeneratorField, worldGenerator, biome, bopDecoration, x, z); + worldGeneratorBOP.doGeneration(world, random, worldGeneratorField, worldGenerator, biome, bopDecoration, chunkX, chunkZ); } } } diff --git a/src/main/java/biomesoplenty/common/eventhandler/world/DecorationModificationEventHandler.java b/src/main/java/biomesoplenty/common/eventhandler/world/DecorationModificationEventHandler.java index d52940e93..326dbc322 100644 --- a/src/main/java/biomesoplenty/common/eventhandler/world/DecorationModificationEventHandler.java +++ b/src/main/java/biomesoplenty/common/eventhandler/world/DecorationModificationEventHandler.java @@ -19,6 +19,12 @@ public class DecorationModificationEventHandler @SubscribeEvent public void modifyDecor(Decorate event) { + if (event.type == Decorate.EventType.LAKE) + { + event.setResult(Result.DENY); + return; + } + World world = event.world; int chunkX = event.chunkX; @@ -26,10 +32,7 @@ public class DecorationModificationEventHandler Random random = event.rand; - int x = chunkX + 8; - int z = chunkZ + 8; - - BiomeGenBase biome = world.getBiomeGenForCoordsBody(x, z); + BiomeGenBase biome = world.getBiomeGenForCoordsBody(chunkX + 16, chunkZ + 16); IBOPDecoration bopDecoration = null; if (biome instanceof IBOPDecoration) @@ -50,10 +53,6 @@ public class DecorationModificationEventHandler event.setResult(Result.DENY); } } - else if (event.type == Decorate.EventType.LAKE) - { - event.setResult(Result.DENY); - } } } @@ -67,10 +66,7 @@ public class DecorationModificationEventHandler Random random = event.rand; - int x = chunkX + 8; - int z = chunkZ + 8; - - BiomeGenBase biome = world.getBiomeGenForCoordsBody(x, z); + BiomeGenBase biome = world.getBiomeGenForCoordsBody(chunkX + 16, chunkZ + 16); IBOPDecoration bopDecoration = null; if (biome instanceof IBOPDecoration) diff --git a/src/main/java/biomesoplenty/common/world/decoration/BOPWorldFeatures.java b/src/main/java/biomesoplenty/common/world/decoration/BOPWorldFeatures.java index 6135970e6..ab5d095a8 100644 --- a/src/main/java/biomesoplenty/common/world/decoration/BOPWorldFeatures.java +++ b/src/main/java/biomesoplenty/common/world/decoration/BOPWorldFeatures.java @@ -13,8 +13,8 @@ public class BOPWorldFeatures public boolean generateAsh = false; public boolean generateMelons = false; - public int waterPoolsPerChunk = 0; - public int lavaPoolsPerChunk = 0; + public int waterPoolsPerChunk = 50; + public int lavaPoolsPerChunk = 20; public int waterLakesPerChunk = 0; public int lavaLakesPerChunk = 0;