Maintain default behavior for Item#canPlayerBreakBlockWhileHolding() (#6128)

This commit is contained in:
Nightenom authored and LexManos committed 2019-09-16 13:36:43 -07:00
1 parent 0f888dde49
commit bb83e11a7c
1 file changed
+3 -2
@@ -531,9 +531,10 @@ public class ForgeHooks
// Logic from tryHarvestBlock for pre-canceling the event
boolean preCancelEvent = false;
ItemStack itemstack = entityPlayer.getHeldItemMainhand();
if (gameType.isCreative() && !itemstack.isEmpty()
&& !itemstack.getItem().canPlayerBreakBlockWhileHolding(world.getBlockState(pos), world, pos, entityPlayer))
if (!itemstack.isEmpty() && !itemstack.getItem().canPlayerBreakBlockWhileHolding(world.getBlockState(pos), world, pos, entityPlayer))
{
preCancelEvent = true;
}
if (gameType.hasLimitedInteractions())
{