Do the laggy permission check for bound tools last after all other checks (#134)

This commit is contained in:
koolkrafter5 authored and GitHub committed 2026-05-27 20:07:46 +02:00
1 parent fe7b382b6a
commit 2026024920
4 files changed
+7 -8

No files matched your search

@@ -103,7 +103,6 @@ public class BoundAxe extends ItemAxe implements IBindable {
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 class BoundAxe extends ItemAxe implements IBindable {
}
// 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)) {
@@ -111,7 +111,6 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable {
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 class BoundPickaxe extends ItemPickaxe implements IBindable {
}
// 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)) {
@@ -114,7 +114,8 @@ public class BoundShovel extends ItemSpade implements IBindable {
}
// 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)) {
@@ -62,9 +62,8 @@ public class DigAreaEffect implements IDigAreaEffect {
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;
}