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()))
|
||||
return to;
|
||||
else {
|
||||
System.out.println(p.isInsideVehicle());
|
||||
if (p.isInsideVehicle())
|
||||
p.getVehicle().remove();
|
||||
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;
|
||||
}
|
||||
|
||||
public int getCX() {
|
||||
return cx;
|
||||
}
|
||||
|
||||
public int getCZ() {
|
||||
return cz;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
@@ -42,5 +50,4 @@ public class WorldBorderInfo {
|
||||
return new WorldBorderInfo(((Long)j.get("cx")).intValue(),
|
||||
((Long)j.get("cz")).intValue(), ((Long)j.get("r")).intValue());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user