fix: OOB on core exist and complete (happen when bot switch to dimensions like nether and/or the end)

This commit is contained in:
ChomeNS
2025-05-21 18:15:42 +07:00
parent 8ab00505e4
commit cdaa82bdfa

View File

@@ -377,9 +377,11 @@ public class CorePlugin implements Listener {
for (int y = from.getY(); y <= to.getY(); y++) {
for (int z = from.getZ(); z <= to.getZ(); z++) {
for (int x = from.getX(); x <= to.getX(); x++) {
final int block = bot.world.getBlock(x, y, z);
try {
final int block = bot.world.getBlock(x, y, z);
if (!isCommandBlockState(block)) return false;
if (!isCommandBlockState(block)) return false;
} catch (final Exception ignored) { }
}
}
}
@@ -398,9 +400,11 @@ public class CorePlugin implements Listener {
for (int y = from.getY(); y <= to.getY(); y++) {
for (int z = from.getZ(); z <= to.getZ(); z++) {
for (int x = from.getX(); x <= to.getX(); x++) {
final int block = bot.world.getBlock(x, y, z);
try {
final int block = bot.world.getBlock(x, y, z);
if (isCommandBlockState(block)) return true;
if (isCommandBlockState(block)) return true;
} catch (final Exception ignored) { }
}
}
}