Shorter border teleportation

This commit is contained in:
Jesse Boyd 2016-12-10 00:44:42 +11:00
parent bec11b244e
commit 9fc464e896
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
2 changed files with 5 additions and 5 deletions

View File

@ -545,7 +545,7 @@ public class PlayerEvents extends PlotListener implements Listener {
} }
Integer border = area.getBorder(); Integer border = area.getBorder();
if (x2 > border) { if (x2 > border) {
to.setX(border - 4); to.setX(x2 - 1);
this.tmpTeleport = false; this.tmpTeleport = false;
player.teleport(event.getTo()); player.teleport(event.getTo());
this.tmpTeleport = true; this.tmpTeleport = true;
@ -553,7 +553,7 @@ public class PlayerEvents extends PlotListener implements Listener {
return; return;
} }
if (x2 < -border) { if (x2 < -border) {
to.setX(-border + 4); to.setX(x2 + 1);
this.tmpTeleport = false; this.tmpTeleport = false;
player.teleport(event.getTo()); player.teleport(event.getTo());
this.tmpTeleport = true; this.tmpTeleport = true;
@ -607,13 +607,13 @@ public class PlayerEvents extends PlotListener implements Listener {
} }
Integer border = area.getBorder(); Integer border = area.getBorder();
if (z2 > border) { if (z2 > border) {
to.setZ(border - 4); to.setZ(z2 - 1);
this.tmpTeleport = false; this.tmpTeleport = false;
player.teleport(event.getTo()); player.teleport(event.getTo());
this.tmpTeleport = true; this.tmpTeleport = true;
MainUtil.sendMessage(pp, C.BORDER); MainUtil.sendMessage(pp, C.BORDER);
} else if (z2 < -border) { } else if (z2 < -border) {
to.setZ(-border + 4); to.setZ(z2 + 1);
this.tmpTeleport = false; this.tmpTeleport = false;
player.teleport(event.getTo()); player.teleport(event.getTo());
this.tmpTeleport = true; this.tmpTeleport = true;

View File

@ -698,7 +698,7 @@ public abstract class PlotArea {
public int getBorder() { public int getBorder() {
Integer meta = (Integer) getMeta("worldBorder"); Integer meta = (Integer) getMeta("worldBorder");
if (meta != null) { if (meta != null) {
int border = meta + 16; int border = meta + 1;
if (border == 0) { if (border == 0) {
return Integer.MAX_VALUE; return Integer.MAX_VALUE;
} else { } else {