From 1597c0ebdd7359590749b20da8f523ca6a812a16 Mon Sep 17 00:00:00 2001 From: WhichOnesPink Date: Tue, 27 Dec 2016 00:51:22 +0000 Subject: [PATCH] No more vines on volcanoes. --- .../biome/deco/DecoJungleLilypadVines.java | 12 ----------- .../world/gen/feature/WorldGenVinesRTG.java | 20 +++++++++++++++++++ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/main/java/rtg/world/biome/deco/DecoJungleLilypadVines.java b/src/main/java/rtg/world/biome/deco/DecoJungleLilypadVines.java index 9150df2ae..80e4ebed5 100644 --- a/src/main/java/rtg/world/biome/deco/DecoJungleLilypadVines.java +++ b/src/main/java/rtg/world/biome/deco/DecoJungleLilypadVines.java @@ -10,7 +10,6 @@ import net.minecraftforge.event.terraingen.TerrainGen; import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LILYPAD; -import rtg.api.RTGAPI; import rtg.api.world.RTGWorld; import rtg.world.biome.realistic.RealisticBiomeBase; import rtg.world.gen.feature.WorldGenVinesRTG; @@ -20,11 +19,6 @@ */ public class DecoJungleLilypadVines extends DecoBase { - private static final Block volcanoBlock = Block.getBlockFromName(RTGAPI.config().VOLCANO_BLOCK_ID.get()); - private static final Block volcanoMix1Block = Block.getBlockFromName(RTGAPI.config().VOLCANO_MIX1_BLOCK_ID.get()); - private static final Block volcanoMix2Block = Block.getBlockFromName(RTGAPI.config().VOLCANO_MIX2_BLOCK_ID.get()); - private static final Block volcanoMix3Block = Block.getBlockFromName(RTGAPI.config().VOLCANO_MIX3_BLOCK_ID.get()); - public DecoJungleLilypadVines() { super(); @@ -60,12 +54,6 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i for (int h44 = 100; h44 > 0; h44--) { - vb = rtgWorld.world.getBlockState(new BlockPos(j6, h44, k10)).getBlock(); - - if (vb == volcanoBlock || vb == volcanoMix1Block || vb == volcanoMix2Block || vb == volcanoMix3Block) { - return; - } - worldgeneratorVines.generate(rtgWorld.world, rand, new BlockPos(j6, z52, k10)); } } diff --git a/src/main/java/rtg/world/gen/feature/WorldGenVinesRTG.java b/src/main/java/rtg/world/gen/feature/WorldGenVinesRTG.java index 3e5116767..22089a5b8 100644 --- a/src/main/java/rtg/world/gen/feature/WorldGenVinesRTG.java +++ b/src/main/java/rtg/world/gen/feature/WorldGenVinesRTG.java @@ -12,6 +12,8 @@ import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; +import rtg.api.RTGAPI; + public class WorldGenVinesRTG extends WorldGenerator { protected Block vineBlock; @@ -21,6 +23,11 @@ public class WorldGenVinesRTG extends WorldGenerator { protected PropertyBool propSouth; protected PropertyBool propWest; + private static final Block volcanoBlock = Block.getBlockFromName(RTGAPI.config().VOLCANO_BLOCK_ID.get()); + private static final Block volcanoMix1Block = Block.getBlockFromName(RTGAPI.config().VOLCANO_MIX1_BLOCK_ID.get()); + private static final Block volcanoMix2Block = Block.getBlockFromName(RTGAPI.config().VOLCANO_MIX2_BLOCK_ID.get()); + private static final Block volcanoMix3Block = Block.getBlockFromName(RTGAPI.config().VOLCANO_MIX3_BLOCK_ID.get()); + public WorldGenVinesRTG() { this.vineBlock = Blocks.VINE; @@ -50,6 +57,19 @@ public boolean generate(World worldIn, Random rand, BlockPos position) { if (worldIn.isAirBlock(position)) { + Block north = worldIn.getBlockState(position.north()).getBlock(); + Block south = worldIn.getBlockState(position.south()).getBlock(); + Block east = worldIn.getBlockState(position.east()).getBlock(); + Block west = worldIn.getBlockState(position.west()).getBlock(); + + // No vines on volcanoes. + if (north == volcanoBlock || north == volcanoMix1Block || north == volcanoMix2Block || north == volcanoMix3Block + || south == volcanoBlock || south == volcanoMix1Block || south == volcanoMix2Block || south == volcanoMix3Block + || east == volcanoBlock || east == volcanoMix1Block || east == volcanoMix2Block || east == volcanoMix3Block + || west == volcanoBlock || west == volcanoMix1Block || west == volcanoMix2Block || west == volcanoMix3Block) { + return false; + } + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL.facings()) { if (this.vineBlock.canPlaceBlockOnSide(worldIn, position, enumfacing)) {