Fix SelectAdjacent but make it a touch slower

This commit is contained in:
2025-07-31 16:25:05 +02:00
parent 33e9b3409f
commit 8076f31a19
2 changed files with 10 additions and 10 deletions
@@ -112,12 +112,12 @@ public class SelectAdjacent implements Listener {
FlatteningWrapper.impl.setSelection(player, minPoint, maxPoint); FlatteningWrapper.impl.setSelection(player, minPoint, maxPoint);
WorldEditRenderer.renderPlayer(player); WorldEditRenderer.renderPlayer(player);
boolean finished = toCalc.stream().allMatch(location -> { // boolean finished = toCalc.stream().allMatch(location -> {
return location.getBlockX() >= minX && location.getBlockY() >= minY && location.getBlockZ() >= minZ && // return location.getBlockX() >= minX && location.getBlockY() >= minY && location.getBlockZ() >= minZ &&
location.getBlockX() <= maxX && location.getBlockY() <= maxY && location.getBlockZ() <= maxZ; // location.getBlockX() <= maxX && location.getBlockY() <= maxY && location.getBlockZ() <= maxZ;
}); // });
if (finished || seen.size() > MAX_BLOCKS) { if (toCalc.isEmpty() || seen.size() > MAX_BLOCKS) {
bukkitTask.cancel(); bukkitTask.cancel();
player.sendTitle("§aDone", "§e" + volume + " §7Blocks", 0, 20, 5); player.sendTitle("§aDone", "§e" + volume + " §7Blocks", 0, 20, 5);
} }
@@ -108,12 +108,12 @@ public class SelectAdjacent implements Listener {
WORLDEDIT_PLUGIN.getSession(player).setRegionSelector(BUKKITWORLD, new CuboidRegionSelector(BUKKITWORLD, BlockVector3.at(minX, minY, minZ), BlockVector3.at(maxX, maxY, maxZ))); WORLDEDIT_PLUGIN.getSession(player).setRegionSelector(BUKKITWORLD, new CuboidRegionSelector(BUKKITWORLD, BlockVector3.at(minX, minY, minZ), BlockVector3.at(maxX, maxY, maxZ)));
WorldEditRenderer.renderPlayer(player); WorldEditRenderer.renderPlayer(player);
boolean finished = toCalc.stream().allMatch(location -> { // boolean finished = toCalc.stream().allMatch(location -> {
return location.getBlockX() >= minX && location.getBlockY() >= minY && location.getBlockZ() >= minZ && // return location.getBlockX() >= minX && location.getBlockY() >= minY && location.getBlockZ() >= minZ &&
location.getBlockX() <= maxX && location.getBlockY() <= maxY && location.getBlockZ() <= maxZ; // location.getBlockX() <= maxX && location.getBlockY() <= maxY && location.getBlockZ() <= maxZ;
}); // });
if (finished || seen.size() > MAX_BLOCKS) { if (toCalc.isEmpty() || seen.size() > MAX_BLOCKS) {
bukkitTask.cancel(); bukkitTask.cancel();
player.sendTitle("§aDone", "§e" + volume + " §7Blocks", 0, 20, 5); player.sendTitle("§aDone", "§e" + volume + " §7Blocks", 0, 20, 5);
} }