Fixed bug when your old location was also valid, then you couldn't move.
This commit is contained in:
@@ -183,11 +183,14 @@ public class WorldBorder implements Module, Listener {
|
|||||||
if (info == null || info.isCordanateWithinBounds(to.getBlockX(), to.getBlockZ()))
|
if (info == null || info.isCordanateWithinBounds(to.getBlockX(), to.getBlockZ()))
|
||||||
return to;
|
return to;
|
||||||
else {
|
else {
|
||||||
System.out.println(p.isInsideVehicle());
|
|
||||||
if (p.isInsideVehicle())
|
if (p.isInsideVehicle())
|
||||||
p.getVehicle().remove();
|
p.getVehicle().remove();
|
||||||
ChatAPI.sendActionBar(p, message);
|
ChatAPI.sendActionBar(p, message);
|
||||||
return from;
|
|
||||||
|
if (info.isCordanateWithinBounds(from.getBlockX(), from.getBlockZ()))
|
||||||
|
return from;
|
||||||
|
else
|
||||||
|
return new Location(to.getWorld(), info.getCX(), 80, info.getCZ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,14 @@ public class WorldBorderInfo {
|
|||||||
return x > minX && x < maxX && z > minZ && z < maxZ;
|
return x > minX && x < maxX && z > minZ && z < maxZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getCX() {
|
||||||
|
return cx;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCZ() {
|
||||||
|
return cz;
|
||||||
|
}
|
||||||
|
|
||||||
public String getMessage() {
|
public String getMessage() {
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
@@ -41,6 +49,5 @@ public class WorldBorderInfo {
|
|||||||
public static WorldBorderInfo fromJSONObject(JSONObject j) {
|
public static WorldBorderInfo fromJSONObject(JSONObject j) {
|
||||||
return new WorldBorderInfo(((Long)j.get("cx")).intValue(),
|
return new WorldBorderInfo(((Long)j.get("cx")).intValue(),
|
||||||
((Long)j.get("cz")).intValue(), ((Long)j.get("r")).intValue());
|
((Long)j.get("cz")).intValue(), ((Long)j.get("r")).intValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user