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

This commit is contained in:
Nightenom 2019-09-16 22:36:43 +02:00 committed by LexManos
parent 0f888dde49
commit bb83e11a7c
1 changed files with 3 additions and 2 deletions

View File

@ -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())
{