From 4cdbc7c2945045a3348f42d3d24574568a443f04 Mon Sep 17 00:00:00 2001 From: Cheeserolls Date: Thu, 11 Jun 2015 11:26:12 +0100 Subject: [PATCH] Add workaround (temporary I hope) for a forge bug --- src/main/java/biomesoplenty/common/block/BlockBOPGrass.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPGrass.java b/src/main/java/biomesoplenty/common/block/BlockBOPGrass.java index a9a4e198a..e6600f614 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPGrass.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPGrass.java @@ -16,6 +16,7 @@ import biomesoplenty.common.item.ItemBOPBlock; import net.minecraft.block.Block; import net.minecraft.block.BlockDirt; import net.minecraft.block.BlockGrass; +import net.minecraft.block.BlockReed; import net.minecraft.block.BlockTallGrass; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; @@ -113,10 +114,13 @@ public class BlockBOPGrass extends BlockGrass implements IBOPBlock @Override public boolean canSustainPlant(IBlockAccess world, BlockPos pos, EnumFacing direction, net.minecraftforge.common.IPlantable plantable) { + // Workaround for bug in forge - BlockReed calls this function with the wrong block position + if (plantable instanceof BlockReed) {pos = pos.down();} IBlockState state = world.getBlockState(pos); - net.minecraftforge.common.EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction)); + net.minecraftforge.common.EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction)); + switch ((BOPGrassType) state.getValue(VARIANT)) { // smoldering grass supports no plants