Maintain default behavior for Item#canPlayerBreakBlockWhileHolding() (#6128)
This commit is contained in:
parent
0f888dde49
commit
bb83e11a7c
1 changed files with 3 additions and 2 deletions
|
@ -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())
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue