do not tp player if they are already in X zone
All checks were successful
/ Auto-Build-App (push) Successful in 1m33s
All checks were successful
/ Auto-Build-App (push) Successful in 1m33s
This commit is contained in:
parent
b4283faa23
commit
48137f214a
1 changed files with 8 additions and 4 deletions
|
@ -249,10 +249,14 @@ public class TextCommands {
|
||||||
if (player!=null && zone!=null){
|
if (player!=null && zone!=null){
|
||||||
txt="[server] Sended "+player.getAccount().getDisplayName()+" to zone "+zoneId;
|
txt="[server] Sended "+player.getAccount().getDisplayName()+" to zone "+zoneId;
|
||||||
Zone old = player.getZone();
|
Zone old = player.getZone();
|
||||||
zone.addPlayer(player);
|
if (old.zoneId.equals(zoneId)) {
|
||||||
player.setZone(zoneId);
|
txt = "[server] Player " + player.getAccount().getDisplayName() + " is already in zone " + zoneId;
|
||||||
player.respawn(zone);
|
}else {
|
||||||
old.removePlayer(player);
|
zone.addPlayer(player);
|
||||||
|
player.setZone(zoneId);
|
||||||
|
player.respawn(zone);
|
||||||
|
old.removePlayer(player);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue