From c6f23876e3ee0ed15dab64c91437426d2f7ac95f Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sun, 16 Feb 2020 19:27:15 +0100 Subject: [PATCH] Adding full 1.15 support --- .../bungeecore/commands/BauCommand.java | 51 ++++++++++++++----- 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/BauCommand.java b/src/de/steamwar/bungeecore/commands/BauCommand.java index 3cee43b2..db089ba7 100644 --- a/src/de/steamwar/bungeecore/commands/BauCommand.java +++ b/src/de/steamwar/bungeecore/commands/BauCommand.java @@ -30,6 +30,7 @@ public class BauCommand { switch(command[1].toLowerCase()){ case "15": + case "1.15": SubserverSystem.sendToBau15(p, p.getUniqueId()); break; case "addmember": @@ -62,7 +63,7 @@ public class BauCommand { break; case "resetall": case "delete": - delete(p); + delete(p, command); break; case "testarena": case "test": @@ -111,7 +112,11 @@ public class BauCommand { BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDu darfst dich nicht auf diese Welt teleportieren"); return; } - SubserverSystem.sendToBauServer(p, worldOwner.getUuid()); + + if(command.length > 3 && command[3].equals("1.15")) + SubserverSystem.sendToBau15(p, worldOwner.getUuid()); + else + SubserverSystem.sendToBauServer(p, worldOwner.getUuid()); } private static void togglebuild(ProxiedPlayer p, String[] command){ @@ -162,18 +167,38 @@ public class BauCommand { BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDer Spieler wurde entfernt."); } - private static void delete(ProxiedPlayer p){ - BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§aDeine Welt wird zurückgesetzt."); - ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> { - for (Subserver subserver : Subserver.getServerList()) { - if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(p.getUniqueId())) { - subserver.stop(); - break; - } + 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; } - File directory = new File(BungeeCore.WORLD_FOLDER + p.getUniqueId().toString()); - del(directory); - }); + + BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§aDeine Welt wird zurückgesetzt."); + ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> { + for (Subserver subserver : Subserver.getServerList()) { + if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(p.getUniqueId())) { + subserver.stop(); + break; + } + } + SteamwarUser user = SteamwarUser.get(p.getUniqueId()); + File directory = new File(BungeeCore.USERWORLDS15 + user.getId()); + del(directory); + }); + }else{ + BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§aDeine Welt wird zurückgesetzt."); + ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> { + for (Subserver subserver : Subserver.getServerList()) { + if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(p.getUniqueId())) { + subserver.stop(); + break; + } + } + File directory = new File(BungeeCore.WORLD_FOLDER + p.getUniqueId().toString()); + del(directory); + }); + } } private static void testarena(ProxiedPlayer p, String[] command){