From 359e374c096bf8ed59089a9486f85838e6dfd400 Mon Sep 17 00:00:00 2001 From: Cheeserolls Date: Thu, 28 May 2015 23:05:11 +0100 Subject: [PATCH] Add shortcut constructor for GeneratorDoubleFlora using vanilla BlockDoublePlant types --- .../common/world/feature/GeneratorDoubleFlora.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/biomesoplenty/common/world/feature/GeneratorDoubleFlora.java b/src/main/java/biomesoplenty/common/world/feature/GeneratorDoubleFlora.java index 88297493a..f78e9ebc0 100644 --- a/src/main/java/biomesoplenty/common/world/feature/GeneratorDoubleFlora.java +++ b/src/main/java/biomesoplenty/common/world/feature/GeneratorDoubleFlora.java @@ -18,7 +18,9 @@ import biomesoplenty.common.block.BlockDoubleDecoration; import biomesoplenty.common.util.biome.GeneratorUtils; import biomesoplenty.common.util.config.BOPConfig.IConfigObj; import net.minecraft.block.Block; +import net.minecraft.block.BlockDoublePlant; import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; import net.minecraft.util.BlockPos; import net.minecraft.world.World; @@ -41,6 +43,12 @@ public class GeneratorDoubleFlora extends GeneratorCustomizable this(amountPerChunk, BOPBlocks.double_plant.getDefaultState().withProperty(BlockBOPDoublePlant.VARIANT, type).withProperty(BlockBOPDoublePlant.HALF, BlockDoubleDecoration.Half.LOWER), BOPBlocks.double_plant.getDefaultState().withProperty(BlockBOPDoublePlant.VARIANT, type).withProperty(BlockBOPDoublePlant.HALF, BlockDoubleDecoration.Half.UPPER), generationAttempts); } + // convenient shortcut constructor for use with a vanilla BlockDoublePlant variant + public GeneratorDoubleFlora(int amountPerChunk, BlockDoublePlant.EnumPlantType type, int generationAttempts) + { + this(amountPerChunk, Blocks.double_plant.getStateFromMeta(type.getMeta()), Blocks.double_plant.getStateFromMeta(8), generationAttempts); + } + public GeneratorDoubleFlora(int amountPerChunk, IBlockState bottomState, IBlockState topState, int generationAttempts) { this.amountPerChunk = amountPerChunk;