Fix shimmering mushrooms popping off at strange times

This commit is contained in:
Vincent Lee committed 2017-03-14 18:45:00 -05:00
1 parent ea24ca751c
commit 886ed03510
1 file changed
+13 -7
@@ -100,15 +100,21 @@ public class BlockModMushroom extends BlockMushroom implements IInfusionStabilis
@Override
public void updateTick(@Nonnull World world, @Nonnull BlockPos pos, IBlockState state, Random rand) {} // Prevent spreading
// [VanillaCopy] super, cleaned up and without light level requirement
@Override
public boolean canPlaceBlockAt(World world, BlockPos pos) {
if(pos.getY() >= 0 && pos.getY() < 256) {
IBlockState state = world.getBlockState(pos.down());
Block block = state.getBlock();
return block == Blocks.MYCELIUM || block == Blocks.DIRT && state.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.PODZOL || block.canSustainPlant(state, world, pos.down(), EnumFacing.UP, this);
public boolean canBlockStay(@Nonnull World worldIn, BlockPos pos, IBlockState state)
{
if (pos.getY() >= 0 && pos.getY() < 256)
{
IBlockState iblockstate = worldIn.getBlockState(pos.down());
return iblockstate.getBlock() == Blocks.MYCELIUM
|| (iblockstate.getBlock() == Blocks.DIRT && iblockstate.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.PODZOL
|| iblockstate.getBlock().canSustainPlant(iblockstate, worldIn, pos.down(), net.minecraft.util.EnumFacing.UP, this));
}
else
{
return false;
}
return false;
}
@SideOnly(Side.CLIENT)