Maintain default behavior for Item#canPlayerBreakBlockWhileHolding() (#6128)
This commit is contained in:
parent
0f888dde49
commit
bb83e11a7c
|
@ -531,9 +531,10 @@ public class ForgeHooks
|
||||||
// Logic from tryHarvestBlock for pre-canceling the event
|
// Logic from tryHarvestBlock for pre-canceling the event
|
||||||
boolean preCancelEvent = false;
|
boolean preCancelEvent = false;
|
||||||
ItemStack itemstack = entityPlayer.getHeldItemMainhand();
|
ItemStack itemstack = entityPlayer.getHeldItemMainhand();
|
||||||
if (gameType.isCreative() && !itemstack.isEmpty()
|
if (!itemstack.isEmpty() && !itemstack.getItem().canPlayerBreakBlockWhileHolding(world.getBlockState(pos), world, pos, entityPlayer))
|
||||||
&& !itemstack.getItem().canPlayerBreakBlockWhileHolding(world.getBlockState(pos), world, pos, entityPlayer))
|
{
|
||||||
preCancelEvent = true;
|
preCancelEvent = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (gameType.hasLimitedInteractions())
|
if (gameType.hasLimitedInteractions())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue