diff --git a/src/de/steamwar/bungeecore/commands/BauCommand.java b/src/de/steamwar/bungeecore/commands/BauCommand.java index 412e96d..31dcc73 100644 --- a/src/de/steamwar/bungeecore/commands/BauCommand.java +++ b/src/de/steamwar/bungeecore/commands/BauCommand.java @@ -24,11 +24,26 @@ public class BauCommand { BungeeCore.log(p, e.getMessage()); if(command.length == 1){ - SubserverSystem.sendToBauServer(p, p.getUniqueId()); + if(bau15(p, command, 1)) + SubserverSystem.sendToBau15(p, p.getUniqueId()); + else + SubserverSystem.sendToBauServer(p, p.getUniqueId()); return; } switch(command[1].toLowerCase()){ + case "ws": + case "warship": + case "wg": + case "wargear": + case "12": + case "1.12": + SubserverSystem.sendToBauServer(p, p.getUniqueId()); + break; + case "as": + case "airship": + case "mwg": + case "miniwargear": case "15": case "1.15": SubserverSystem.sendToBau15(p, p.getUniqueId()); @@ -113,12 +128,36 @@ public class BauCommand { return; } - if(command.length > 3 && command[3].equals("1.15")) + if(bau15(p, command, 3)) SubserverSystem.sendToBau15(p, worldOwner.getUuid()); else SubserverSystem.sendToBauServer(p, worldOwner.getUuid()); } + private static boolean bau15(ProxiedPlayer p, String[] args, int pos){ + if(args.length <= pos) + return p.getPendingConnection().getVersion() > 340; // Version > 1.12.2 + + switch(args[pos].toLowerCase()){ + case "ws": + case "warship": + case "wg": + case "wargear": + case "12": + case "1.12": + return false; + case "as": + case "airship": + case "mwg": + case "miniwargear": + case "15": + case "1.15": + return true; + default: + return p.getPendingConnection().getVersion() > 340; // Version > 1.12.2 + } + } + private static void togglebuild(ProxiedPlayer p, String[] command){ BauweltMember target = toggle(p, command, "togglebuild"); if(target == null) @@ -168,12 +207,7 @@ public class BauCommand { } private static void delete(ProxiedPlayer p, String[] command){ - if(command.length > 2){ - if(!command[2].equals("1.15")){ - BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§c Unbekannte Option: " + command[2]); - return; - } - + if(bau15(p, command, 2)){ BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§aDeine Welt wird zurückgesetzt."); ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> { for (Subserver subserver : Subserver.getServerList()) {