mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Shorter border teleportation
This commit is contained in:
parent
bec11b244e
commit
9fc464e896
@ -545,7 +545,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
}
|
||||
Integer border = area.getBorder();
|
||||
if (x2 > border) {
|
||||
to.setX(border - 4);
|
||||
to.setX(x2 - 1);
|
||||
this.tmpTeleport = false;
|
||||
player.teleport(event.getTo());
|
||||
this.tmpTeleport = true;
|
||||
@ -553,7 +553,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
return;
|
||||
}
|
||||
if (x2 < -border) {
|
||||
to.setX(-border + 4);
|
||||
to.setX(x2 + 1);
|
||||
this.tmpTeleport = false;
|
||||
player.teleport(event.getTo());
|
||||
this.tmpTeleport = true;
|
||||
@ -607,13 +607,13 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
}
|
||||
Integer border = area.getBorder();
|
||||
if (z2 > border) {
|
||||
to.setZ(border - 4);
|
||||
to.setZ(z2 - 1);
|
||||
this.tmpTeleport = false;
|
||||
player.teleport(event.getTo());
|
||||
this.tmpTeleport = true;
|
||||
MainUtil.sendMessage(pp, C.BORDER);
|
||||
} else if (z2 < -border) {
|
||||
to.setZ(-border + 4);
|
||||
to.setZ(z2 + 1);
|
||||
this.tmpTeleport = false;
|
||||
player.teleport(event.getTo());
|
||||
this.tmpTeleport = true;
|
||||
|
@ -698,7 +698,7 @@ public abstract class PlotArea {
|
||||
public int getBorder() {
|
||||
Integer meta = (Integer) getMeta("worldBorder");
|
||||
if (meta != null) {
|
||||
int border = meta + 16;
|
||||
int border = meta + 1;
|
||||
if (border == 0) {
|
||||
return Integer.MAX_VALUE;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user