mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-14 01:04:24 +00:00
Maintain default behavior for Item#canPlayerBreakBlockWhileHolding() (#6128)
This commit is contained in:
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())
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user