mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 15: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();
|
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;
|
||||||
|
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user