Fixed a crash when mining the mimic block.

This commit is contained in:
WayofTime 2016-08-14 19:16:31 -04:00
parent a2f89687be
commit 211d3906a4

View file

@ -72,6 +72,17 @@ public class BlockMimic extends BlockStringContainer implements IVariantProvider
return FULL_BLOCK_AABB; return FULL_BLOCK_AABB;
} }
@Override
public int getMetaFromState(IBlockState state)
{
if (state.getBlock() == this)
{
return super.getMetaFromState(state);
}
return state.getBlock().getMetaFromState(state);
}
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
{ {