Archived
0

Fixed bug when your old location was also valid, then you couldn't move.

This commit is contained in:
Minenash
2019-01-05 00:59:43 -05:00
parent dc4085e211
commit 5d6e5d4264
2 changed files with 14 additions and 4 deletions

View File

@@ -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());
}
}
}

View File

@@ -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());
}
}