Skip to content

Commit

Permalink
No more vines on volcanoes.
Browse files Browse the repository at this point in the history
  • Loading branch information
whichonespink44 committed Dec 27, 2016
1 parent 4796a13 commit 1597c0e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/main/java/rtg/world/biome/deco/DecoJungleLilypadVines.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
Expand Down Expand Up @@ -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));
}
}
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/rtg/world/gen/feature/WorldGenVinesRTG.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit 1597c0e

Please sign in to comment.