This commit is contained in:
parent
21b06d2975
commit
3b80b5bf8c
2 changed files with 8 additions and 7 deletions
|
@ -224,7 +224,7 @@ public class TextCommands {
|
|||
|
||||
if (created){
|
||||
try {
|
||||
set_server_property("zones",zones);
|
||||
set_server_property("zones",zones.toString());
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
@ -235,21 +235,22 @@ public class TextCommands {
|
|||
});
|
||||
|
||||
commands.put("send",(args, networkIdentity, channelHandlerContext) -> {
|
||||
Account account = ServerSingletons.getAccount(networkIdentity);
|
||||
Player player = ServerSingletons.getPlayer(networkIdentity);
|
||||
String txt = "[Server] Could not send plr to zone...";
|
||||
if (args.length>=2){
|
||||
String zoneId = args[1];
|
||||
Zone zone = GameSingletons.world.getZoneIfExists(zoneId);
|
||||
|
||||
if (args.length>=3){
|
||||
if (args.length>=3 && has_perm(account.getUniqueId(), "send.other")){
|
||||
player = parseAsPlayer(args[2]);
|
||||
}
|
||||
|
||||
if (player!=null && zone!=null){
|
||||
txt="[server] Sended "+player.getAccount().getDisplayName()+" to zone "+zoneId;
|
||||
player.getZone().removePlayer(player);
|
||||
player.respawn(zone);
|
||||
zone.addPlayer(player);
|
||||
player.respawn(zone);
|
||||
player.getZone().removePlayer(player);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,9 +21,9 @@ public class NettyServerMixin {
|
|||
try {
|
||||
ArrayList<String> zones = get_server_property_array("zones","[]");
|
||||
for (String zoneId : zones){
|
||||
Zone z = GameSingletons.world.getZoneIfExists(zoneId);
|
||||
if (z == null && GameSingletons.isHost) {
|
||||
z = Zone.loadZone(GameSingletons.world, zoneId);
|
||||
Zone z = GameSingletons.world.getZoneIfExists(zoneId.replace(" ",""));
|
||||
if (!zoneId.isEmpty() && z == null && GameSingletons.isHost) {
|
||||
z = Zone.loadZone(GameSingletons.world, zoneId.replace(" ",""));
|
||||
GameSingletons.world.addZone(z);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue