Fixed radius selections not supporting negative heights

This commit is contained in:
Intelli 2021-12-21 15:31:08 -07:00
parent 204d6c8d5f
commit c1eecefa6f
4 changed files with 15 additions and 15 deletions

View File

@ -464,7 +464,7 @@ public class CoreProtectAPI extends Queue {
int xMax = location.getBlockX() + radius; int xMax = location.getBlockX() + radius;
int zMin = location.getBlockZ() - radius; int zMin = location.getBlockZ() - radius;
int zMax = location.getBlockZ() + radius; int zMax = location.getBlockZ() + radius;
argRadius = new Integer[] { radius, xMin, xMax, -1, -1, zMin, zMax, 0 }; argRadius = new Integer[] { radius, xMin, xMax, null, null, zMin, zMax, 0 };
} }
if (lookup == 1) { if (lookup == 1) {

View File

@ -563,12 +563,12 @@ public class CommandHandler implements CommandExecutor {
rcount++; rcount++;
} }
if (location != null) { if (location != null) {
int xmin = location.getBlockX() - r_x; Integer xmin = location.getBlockX() - r_x;
int xmax = location.getBlockX() + r_x; Integer xmax = location.getBlockX() + r_x;
int ymin = -1; Integer ymin = null;
int ymax = -1; Integer ymax = null;
int zmin = location.getBlockZ() - r_z; Integer zmin = location.getBlockZ() - r_z;
int zmax = location.getBlockZ() + r_z; Integer zmax = location.getBlockZ() + r_z;
if (r_y > -1) { if (r_y > -1) {
ymin = location.getBlockY() - r_y; ymin = location.getBlockY() - r_y;
ymax = location.getBlockY() + r_y; ymax = location.getBlockY() + r_y;

View File

@ -157,7 +157,7 @@ public class RollbackRestoreCommand {
int xmax = location.getBlockX() + DEFAULT_RADIUS; int xmax = location.getBlockX() + DEFAULT_RADIUS;
int zmin = location.getBlockZ() - DEFAULT_RADIUS; int zmin = location.getBlockZ() - DEFAULT_RADIUS;
int zmax = location.getBlockZ() + DEFAULT_RADIUS; int zmax = location.getBlockZ() + DEFAULT_RADIUS;
argRadius = new Integer[] { DEFAULT_RADIUS, xmin, xmax, -1, -1, zmin, zmax, 0 }; argRadius = new Integer[] { DEFAULT_RADIUS, xmin, xmax, null, null, zmin, zmax, 0 };
} }
// if (arg_radius==-2)arg_radius = -1; // if (arg_radius==-2)arg_radius = -1;

View File

@ -484,15 +484,15 @@ public class Lookup extends Queue {
} }
if (radius != null) { if (radius != null) {
int xmin = radius[1]; Integer xmin = radius[1];
int xmax = radius[2]; Integer xmax = radius[2];
int ymin = radius[3]; Integer ymin = radius[3];
int ymax = radius[4]; Integer ymax = radius[4];
int zmin = radius[5]; Integer zmin = radius[5];
int zmax = radius[6]; Integer zmax = radius[6];
String queryY = ""; String queryY = "";
if (ymin > -1 && ymax > -1) { if (ymin != null && ymax != null) {
queryY = " y >= '" + ymin + "' AND y <= '" + ymax + "' AND"; queryY = " y >= '" + ymin + "' AND y <= '" + ymax + "' AND";
} }