From cf366b9c3bf4c700bfe867e5baef390391cbf67d Mon Sep 17 00:00:00 2001 From: koolkrafter5 Date: Wed, 27 May 2026 13:34:14 -0400 Subject: [PATCH] Do the laggy permission check for bound tools last after all other checks --- .../WayofTime/alchemicalWizardry/common/items/BoundAxe.java | 4 ++-- .../alchemicalWizardry/common/items/BoundPickaxe.java | 3 +-- .../alchemicalWizardry/common/items/BoundShovel.java | 3 ++- .../complex/effect/impactEffects/tool/DigAreaEffect.java | 5 ++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java index 75a1c57d7..dd4b922ce 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundAxe.java @@ -103,7 +103,6 @@ public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer play int z = posZ + k; Block block = world.getBlock(x, y, z); int meta = world.getBlockMetadata(x, y, z); - if (BoundPickaxe.checkPermissions(world, x, y, z, block, meta, player)) continue; if (block == null || block.getBlockHardness(world, x, y, z) == -1 || !world.canMineBlock(player, x, y, z)) { @@ -111,7 +110,8 @@ public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer play } // getStrVsBlock - if (func_150893_a(item, block) <= 1f && !(block instanceof BlockLeavesBase)) { + if ((func_150893_a(item, block) <= 1f && !(block instanceof BlockLeavesBase)) + || BoundPickaxe.checkPermissions(world, x, y, z, block, meta, player)) { continue; } if (silkTouch && block.canSilkHarvest(world, player, x, y, z, meta)) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java index 7f20a7f10..f63b444c2 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java @@ -111,7 +111,6 @@ public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer play int z = posZ + k; Block block = world.getBlock(x, y, z); int meta = world.getBlockMetadata(x, y, z); - if (checkPermissions(world, x, y, z, block, meta, player)) continue; if (block == null || block.getBlockHardness(world, x, y, z) == -1 || !world.canMineBlock(player, x, y, z)) { @@ -119,7 +118,7 @@ public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer play } // getStrVsBlock - if (func_150893_a(item, block) <= 1f) { + if (func_150893_a(item, block) <= 1f || checkPermissions(world, x, y, z, block, meta, player)) { continue; } if (silkTouch && block.canSilkHarvest(world, player, x, y, z, meta)) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java index 80a4f7b2a..051101bf9 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundShovel.java @@ -114,7 +114,8 @@ public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer play } // getStrVsBlock - if (func_150893_a(item, block) <= 1f) { + if (func_150893_a(item, block) <= 1f + || BoundPickaxe.checkPermissions(world, x, y, z, block, meta, player)) { continue; } if (silkTouch && block.canSilkHarvest(world, player, x, y, z, meta)) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/DigAreaEffect.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/DigAreaEffect.java index 9f79c7757..55f636b16 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/DigAreaEffect.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/tool/DigAreaEffect.java @@ -62,9 +62,8 @@ public void breakBlock(ItemStack container, World world, EntityPlayer player, fl float localHardness = block.getBlockHardness(world, x, y, z); - if (localHardness - this.getHardnessDifference() > blockHardness - || BoundPickaxe.checkPermissions(world, x, y, z, block, meta, player) - || localHardness < 0) { + if (localHardness < 0 || localHardness - this.getHardnessDifference() > blockHardness + || BoundPickaxe.checkPermissions(world, x, y, z, block, meta, player)) { return; }