From 96b530d56bfcf30ba3a1220aaf2ab7c6ddbd98ea Mon Sep 17 00:00:00 2001 From: Adubbz Date: Mon, 17 Mar 2014 20:25:01 +1100 Subject: [PATCH] Forgot to readd the workaround for the Already Decorating! nonsense --- .../biomesoplenty/common/biomes/BOPBiome.java | 5 ++-- .../decoration/BOPDecorationManager.java | 29 ++++++++++++++----- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/main/java/biomesoplenty/common/biomes/BOPBiome.java b/src/main/java/biomesoplenty/common/biomes/BOPBiome.java index 62afb0a49..305e6de85 100644 --- a/src/main/java/biomesoplenty/common/biomes/BOPBiome.java +++ b/src/main/java/biomesoplenty/common/biomes/BOPBiome.java @@ -4,6 +4,7 @@ import biomesoplenty.common.world.decoration.BOPDecorationManager; import biomesoplenty.common.world.decoration.BOPWorldFeatures; import biomesoplenty.common.world.decoration.IBOPBiome; import biomesoplenty.common.world.features.WorldGenBOPFlora; +import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.gen.feature.WorldGenerator; @@ -22,7 +23,7 @@ public abstract class BOPBiome extends BiomeGenBase implements IBOPBiome bopWorldFeatures = BOPDecorationManager.getBiomeFeatures(biomeID); } - /*@Override + @Override public void decorate(World world, Random random, int x, int z) { try @@ -41,7 +42,7 @@ public abstract class BOPBiome extends BiomeGenBase implements IBOPBiome e.printStackTrace(); } } - }*/ + } @Override public WorldGenBOPFlora getRandomWorldGenForBOPFlowers(Random random) diff --git a/src/main/java/biomesoplenty/common/world/decoration/BOPDecorationManager.java b/src/main/java/biomesoplenty/common/world/decoration/BOPDecorationManager.java index 5766e89c1..0b185017c 100644 --- a/src/main/java/biomesoplenty/common/world/decoration/BOPDecorationManager.java +++ b/src/main/java/biomesoplenty/common/world/decoration/BOPDecorationManager.java @@ -26,20 +26,35 @@ public class BOPDecorationManager implements IWorldGenerator for (String featureName : biomeFeatures.getFeatureNames()) { + try + { if (featureName.equals("bopFlowersPerChunk")) { if (!TerrainGen.decorate(world, random, chunkX, chunkZ, DecorateBiomeEvent.Decorate.EventType.FLOWERS)) continue; } - WorldGenFieldAssociation.WorldFeature worldFeature = WorldGenFieldAssociation.getAssociatedFeature(featureName); + WorldGenFieldAssociation.WorldFeature worldFeature = WorldGenFieldAssociation.getAssociatedFeature(featureName); - if (worldFeature != null) - { - IBOPWorldGenerator worldGenerator = worldFeature.getBOPWorldGenerator(); - - if (worldGenerator != null) + if (worldFeature != null) { - worldGenerator.setupGeneration(world, random, biome, featureName, chunkX, chunkZ); + IBOPWorldGenerator worldGenerator = worldFeature.getBOPWorldGenerator(); + + if (worldGenerator != null) + { + worldGenerator.setupGeneration(world, random, biome, featureName, chunkX, chunkZ); + } + } + } + catch (Exception e) + { + Throwable cause = e.getCause(); + + if (e.getMessage() != null && e.getMessage().equals("Already decorating!!") || (cause != null && cause.getMessage() != null && cause.getMessage().equals("Already decorating!!"))) + { + } + else + { + e.printStackTrace(); } } }