From 4ba2b56d194a39a123c1274da4db5ef7375aceeb Mon Sep 17 00:00:00 2001 From: jojo Date: Thu, 19 Nov 2020 22:03:50 +0100 Subject: [PATCH 01/10] Update '/help bau' --- .../bungeecore/commands/HelpCommand.java | 112 +++++++++++++++--- .../steamwar/messages/BungeeCore.properties | 24 +++- 2 files changed, 116 insertions(+), 20 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/HelpCommand.java b/src/de/steamwar/bungeecore/commands/HelpCommand.java index afb08f5..11d23fc 100644 --- a/src/de/steamwar/bungeecore/commands/HelpCommand.java +++ b/src/de/steamwar/bungeecore/commands/HelpCommand.java @@ -26,13 +26,14 @@ import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.connection.ProxiedPlayer; public class HelpCommand extends BasicCommand { + public HelpCommand() { super("help", "", "?"); } @Override public void execute(CommandSender sender, String[] args) { - if(args.length != 1){ + if (args.length != 1) { Message.send("HELP_LOBBY", true, sender, ChatMessageType.SYSTEM, Message.parse("HELP_LOBBY_HOVER", sender), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/l")); Message.send("HELP_BAU", true, sender, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_HOVER", sender), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/bau")); Message.send("HELP_BAUSERVER", true, sender, ChatMessageType.SYSTEM, Message.parse("HELP_BAUSERVER_HOVER", sender), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/help bauserver")); @@ -42,28 +43,59 @@ public class HelpCommand extends BasicCommand { Message.send("HELP_TEAM", true, sender, ChatMessageType.SYSTEM, Message.parse("HELP_TEAM_HOVER", sender), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/team")); Message.send("HELP_JOIN", true, sender, ChatMessageType.SYSTEM, Message.parse("HELP_JOIN_HOVER", sender), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join")); Message.send("HELP_LOCAL", true, sender, ChatMessageType.SYSTEM, Message.parse("HELP_LOCAL_HOVER", sender), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/local")); - }else if(args[0].equalsIgnoreCase("bauserver")){ + return; + } + if (args[0].equalsIgnoreCase("bauserver")) { sendBauHelp((ProxiedPlayer) sender); - }else if(args[0].equalsIgnoreCase("bau")){ - Message.sendPrefixless("HELP_TNT", sender); - Message.sendPrefixless("HELP_FIRE", sender); - Message.sendPrefixless("HELP_TESTBLOCK", sender); - Message.sendPrefixless("HELP_RESET", sender); - Message.sendPrefixless("HELP_SPEED", sender); - Message.sendPrefixless("HELP_NV", sender); - Message.sendPrefixless("HELP_WV", sender); - Message.sendPrefixless("HELP_TRACE", sender); - Message.sendPrefixless("HELP_LOADER", sender); - Message.sendPrefixless("HELP_PROTECT", sender); - Message.sendPrefixless("HELP_FREEZE", sender); - Message.sendPrefixless("HELP_SKULL", sender); - Message.sendPrefixless("HELP_DEBUGSTICK", sender); - Message.sendPrefixless("HELP_BAUINFO", sender); - Message.sendPrefixless("HELP_BAUSERVER_SHORT", sender); + } + if (args[0].equalsIgnoreCase("bau")) { + bauHelpGroup((ProxiedPlayer) sender, args); + return; + } + + } + + private static void bauHelpGroup(ProxiedPlayer p, String[] args) { + if (args.length != 2) { + sendBauHelpGroup(p); + return; + } + + switch (args[1].toLowerCase()) { + case "admin": + case "owner": + case "bauwelt": + sendBauHelpAdmin(p); + return; + case "world": + sendBauHelpWorld(p); + return; + case "player": + sendBauHelpPlayer(p); + return; + case "worldedit": + case "we": + case "world-edit": + case "edit": + sendBauHelpWorldEdit(p); + return; + case "other": + sendBauHelpOther(p); + return; + default: + sendBauHelpGroup(p); } } - static void sendBauHelp(ProxiedPlayer p){ + private static void sendBauHelpGroup(ProxiedPlayer p) { + Message.send("HELP_BAU_GROUP_ADMIN", true, p, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_GROUP_ADMIN_HOVER", p), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/help bau admin")); + Message.send("HELP_BAU_GROUP_WORLD", true, p, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_GROUP_WORLD_HOVER", p), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/help bau world")); + Message.send("HELP_BAU_GROUP_PLAYER", true, p, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_GROUP_PLAYER_HOVER", p), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/help bau player")); + Message.send("HELP_BAU_GROUP_WE", true, p, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_GROUP_WE_HOVER", p), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/help bau we")); + Message.send("HELP_BAU_GROUP_OTHER", true, p, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_GROUP_OTHER_HOVER", p), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/help bau other")); + } + + static void sendBauHelp(ProxiedPlayer p) { Message.send("HELP_BAU_TP", true, p, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_TP_HOVER", p), new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/bau tp ")); Message.send("HELP_BAU_ADDMEMBER", true, p, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_ADDMEMBER_HOVER", p), new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/bau addmember ")); Message.send("HELP_BAU_DELMEMBER", true, p, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_DELMEMBER_HOVER", p), new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/bau delmember ")); @@ -74,4 +106,46 @@ public class HelpCommand extends BasicCommand { Message.send("HELP_BAU_TESTARENA", true, p, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_TESTARENA_HOVER", p), new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/bau testarena ")); Message.send("HELP_BAU_BAU", true, p, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_BAU_HOVER", p), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/help bau")); } + + static void sendBauHelpWorld(ProxiedPlayer p) { + Message.sendPrefixless("HELP_TNT", p); + Message.sendPrefixless("HELP_FIRE", p); + Message.sendPrefixless("HELP_FREEZE", p); + Message.sendPrefixless("HELP_TPSLIMIT", p); + Message.sendPrefixless("HELP_PROTECT", p); + Message.sendPrefixless("HELP_RESET", p); + } + + static void sendBauHelpPlayer(ProxiedPlayer p) { + Message.sendPrefixless("HELP_SPEED", p); + Message.sendPrefixless("HELP_NV", p); + Message.sendPrefixless("HELP_WV", p); + Message.sendPrefixless("HELP_DEBUGSTICK", p); + Message.sendPrefixless("HELP_TRACE", p); + Message.sendPrefixless("HELP_LOADER", p); + } + + static void sendBauHelpAdmin(ProxiedPlayer p) { + sendBauHelp(p); + } + + static void sendBauHelpWorldEdit(ProxiedPlayer p) { + Message.sendPrefixless("HELP_WE_POS1", p); + Message.sendPrefixless("HELP_WE_POS2", p); + Message.sendPrefixless("HELP_WE_COPY", p); + Message.sendPrefixless("HELP_WE_PASTE", p); + Message.sendPrefixless("HELP_WE_FLOPY", p); + Message.sendPrefixless("HELP_WE_FLOPYP", p); + Message.sendPrefixless("HELP_WE_ROTATE_90", p); + Message.sendPrefixless("HELP_WE_ROTATE_180", p); + Message.sendPrefixless("HELP_WE_ROTATE_N90", p); + } + + static void sendBauHelpOther(ProxiedPlayer p) { + Message.sendPrefixless("HELP_TESTBLOCK", p); + Message.sendPrefixless("HELP_SKULL", p); + Message.sendPrefixless("HELP_BAUINFO", p); + Message.sendPrefixless("HELP_BAUSERVER_SHORT", p); + } + } diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index 6855cb7..2551f68 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -27,6 +27,7 @@ HELP_SPEED=§8/§espeed §8- §7Ändert deine Fluggeschwindigkeit HELP_NV=§8/§env §8- §7(de)aktiviert Nachtsicht HELP_WV=§8/§ewv §8- §7(de)aktiviert Unterwassersicht HELP_TRACE=§8/§etrace §8- §7Gibt einen Überblick über den TNT-Tracer +HELP_TPSLIMIT="§8/§etpslimit §8- §7Gibt einen Überblick über den TPS-Limiter" HELP_LOADER=§8/§eloader §8- §7Nutze den automatischen Kanonenlader HELP_PROTECT=§8/§eprotect §8- §7Schützt den Boden der (M)WG-Region HELP_FREEZE=§8/§efreeze §8- §7Unterbindet Blockupdates @@ -35,6 +36,27 @@ HELP_DEBUGSTICK=§8/§edebugstick §8- §7Gibt dir einen Debugstick (nur 1.15) HELP_BAUINFO=§8/§ebauinfo §8- §7Gibt dir Informationen über den Bauserver HELP_BAUSERVER_SHORT=§8/§ehelp bauserver §8- §7Hilfe zum Bauserver +HELP_WE_POS1=§8//§e1 §8- §7Die Abkürzung für §8//§epos1 +HELP_WE_POS2=§8//§e2 §8- §7Die Abkürzung für §8//§epos2 +HELP_WE_COPY=§8//§ec §8- §7Die Abkürzung für §8//§ecopy +HELP_WE_PASTE=§8//§ep §8- §7Die Abkürzung für §8//§epaste +HELP_WE_FLOPY=§8//§eflopy §8- §7Die Abkürzung für §8//§ecopy §7& §8//§eflip +HELP_WE_FLOPYP=§8//§eflopyp §8- §7Die Abkürzung für §8//§ecopy §7& §8//§eflip §7& §8//§epaste +HELP_WE_ROTATE_90=§8//§e90 §8- §7Die Abkürzung für §8//§erotate 90 +HELP_WE_ROTATE_180=§8//§e180 §8- §7Die Abkürzung für §8//§erotate 180 +HELP_WE_ROTATE_N90=§8//§e-90 §8- §7Die Abkürzung für §8//§erotate -90 + +HELP_BAU_GROUP_ADMIN=§7Alle Befehle, welcher für die Verwaltung eines Baus wichtig sind +HELP_BAU_GROUP_ADMIN_HOVER=§eAlle Verwaltungs Befehle +HELP_BAU_GROUP_OTHER=§7Alle sonstigen Befehle, für die Bau Welt +HELP_BAU_GROUP_OTHER_HOVER=§eAlle sonstigen Befehle +HELP_BAU_GROUP_WE=§7Alle Abkürzungen für World Edit +HELP_BAU_GROUP_WE_HOVER=§eAlle World Edit Befehle +HELP_BAU_GROUP_PLAYER=§7Alle Befehle, welche für den einzelnen Spieler sind +HELP_BAU_GROUP_PLAYER_HOVER=§eAlle Spieler Befehle +HELP_BAU_GROUP_WORLD=§7Alle wichtigen Weltbefehle, für die Bau Welt +HELP_BAU_GROUP_WORLD_HOVER=§eAlle World Befehle + HELP_BAU_TP=§8/§ebau tp §8- §7Gehe auf Bauserver von Freunden! HELP_BAU_TP_HOVER=§eZu einem anderen Bauserver HELP_BAU_ADDMEMBER=§8/§ebau addmember §8- §7Fügt einen Freund hinzu @@ -52,4 +74,4 @@ HELP_BAU_DELETE_HOVER=§eBauwelt zurücksetzen HELP_BAU_TESTARENA=§8/§ebau testarena §8- §7Starte eine Testarena HELP_BAU_TESTARENA_HOVER=§eTestarena starten HELP_BAU_BAU=§8/§ehelp bau §8- §7Hilfe zu nützlichen Werkzeugen -HELP_BAU_BAU_HOVER=§eNützliche Zusatzfunktionen +HELP_BAU_BAU_HOVER=§eNützliche Zusatzfunktionen \ No newline at end of file From 6c68aab3dd7ebb372ffa672eea4960688429ce83 Mon Sep 17 00:00:00 2001 From: jojo Date: Thu, 19 Nov 2020 22:35:19 +0100 Subject: [PATCH 02/10] Fix HelpCommand --- src/de/steamwar/bungeecore/commands/HelpCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/HelpCommand.java b/src/de/steamwar/bungeecore/commands/HelpCommand.java index 11d23fc..140e996 100644 --- a/src/de/steamwar/bungeecore/commands/HelpCommand.java +++ b/src/de/steamwar/bungeecore/commands/HelpCommand.java @@ -33,7 +33,7 @@ public class HelpCommand extends BasicCommand { @Override public void execute(CommandSender sender, String[] args) { - if (args.length != 1) { + if (args.length < 1) { Message.send("HELP_LOBBY", true, sender, ChatMessageType.SYSTEM, Message.parse("HELP_LOBBY_HOVER", sender), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/l")); Message.send("HELP_BAU", true, sender, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_HOVER", sender), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/bau")); Message.send("HELP_BAUSERVER", true, sender, ChatMessageType.SYSTEM, Message.parse("HELP_BAUSERVER_HOVER", sender), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/help bauserver")); @@ -56,7 +56,7 @@ public class HelpCommand extends BasicCommand { } private static void bauHelpGroup(ProxiedPlayer p, String[] args) { - if (args.length != 2) { + if (args.length < 2) { sendBauHelpGroup(p); return; } From 56b01d6ee65d6fcad3272bb8b884a913ccb7ac41 Mon Sep 17 00:00:00 2001 From: jojo Date: Fri, 20 Nov 2020 09:53:43 +0100 Subject: [PATCH 03/10] Update Messages Update HelpCommand --- .../bungeecore/commands/HelpCommand.java | 7 +++ .../steamwar/messages/BungeeCore.properties | 43 +++++++++++-------- 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/HelpCommand.java b/src/de/steamwar/bungeecore/commands/HelpCommand.java index 140e996..0509aca 100644 --- a/src/de/steamwar/bungeecore/commands/HelpCommand.java +++ b/src/de/steamwar/bungeecore/commands/HelpCommand.java @@ -25,6 +25,8 @@ import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.connection.ProxiedPlayer; +import javax.swing.*; + public class HelpCommand extends BasicCommand { public HelpCommand() { @@ -108,6 +110,7 @@ public class HelpCommand extends BasicCommand { } static void sendBauHelpWorld(ProxiedPlayer p) { + Message.send("HELP_BAU_GROUP_WORLD_TITLE", p); Message.sendPrefixless("HELP_TNT", p); Message.sendPrefixless("HELP_FIRE", p); Message.sendPrefixless("HELP_FREEZE", p); @@ -117,6 +120,7 @@ public class HelpCommand extends BasicCommand { } static void sendBauHelpPlayer(ProxiedPlayer p) { + Message.sendPrefixless("HELP_BAU_GROUP_PLAYER_TITLE", p); Message.sendPrefixless("HELP_SPEED", p); Message.sendPrefixless("HELP_NV", p); Message.sendPrefixless("HELP_WV", p); @@ -126,10 +130,12 @@ public class HelpCommand extends BasicCommand { } static void sendBauHelpAdmin(ProxiedPlayer p) { + Message.send("HELP_BAU_GROUP_ADMIN_TITLE", p); sendBauHelp(p); } static void sendBauHelpWorldEdit(ProxiedPlayer p) { + Message.sendPrefixless("HELP_BAU_GROUP_WE_TITLE", p); Message.sendPrefixless("HELP_WE_POS1", p); Message.sendPrefixless("HELP_WE_POS2", p); Message.sendPrefixless("HELP_WE_COPY", p); @@ -142,6 +148,7 @@ public class HelpCommand extends BasicCommand { } static void sendBauHelpOther(ProxiedPlayer p) { + Message.sendPrefixless("HELP_BAU_GROUP_OTHER_TITLE", p); Message.sendPrefixless("HELP_TESTBLOCK", p); Message.sendPrefixless("HELP_SKULL", p); Message.sendPrefixless("HELP_BAUINFO", p); diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index 2551f68..53e660a 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -36,26 +36,31 @@ HELP_DEBUGSTICK=§8/§edebugstick §8- §7Gibt dir einen Debugstick (nur 1.15) HELP_BAUINFO=§8/§ebauinfo §8- §7Gibt dir Informationen über den Bauserver HELP_BAUSERVER_SHORT=§8/§ehelp bauserver §8- §7Hilfe zum Bauserver -HELP_WE_POS1=§8//§e1 §8- §7Die Abkürzung für §8//§epos1 -HELP_WE_POS2=§8//§e2 §8- §7Die Abkürzung für §8//§epos2 -HELP_WE_COPY=§8//§ec §8- §7Die Abkürzung für §8//§ecopy -HELP_WE_PASTE=§8//§ep §8- §7Die Abkürzung für §8//§epaste -HELP_WE_FLOPY=§8//§eflopy §8- §7Die Abkürzung für §8//§ecopy §7& §8//§eflip -HELP_WE_FLOPYP=§8//§eflopyp §8- §7Die Abkürzung für §8//§ecopy §7& §8//§eflip §7& §8//§epaste -HELP_WE_ROTATE_90=§8//§e90 §8- §7Die Abkürzung für §8//§erotate 90 -HELP_WE_ROTATE_180=§8//§e180 §8- §7Die Abkürzung für §8//§erotate 180 -HELP_WE_ROTATE_N90=§8//§e-90 §8- §7Die Abkürzung für §8//§erotate -90 +HELP_WE_POS1=§8//§e1 §8» //§epos1 +HELP_WE_POS2=§8//§e2 §8» //§epos2 +HELP_WE_COPY=§8//§ec §8» //§ecopy +HELP_WE_PASTE=§8//§ep §8» //§epaste +HELP_WE_FLOPY=§8//§eflopy §8» //§ecopy §7& §8//§eflip +HELP_WE_FLOPYP=§8//§eflopyp §8» //§ecopy §7& §8//§eflip §7& §8//§epaste +HELP_WE_ROTATE_90=§8//§e90 §8» //§erotate 90 +HELP_WE_ROTATE_180=§8//§e180 §8» //§erotate 180 +HELP_WE_ROTATE_N90=§8//§e-90 §8» //§erotate -90 -HELP_BAU_GROUP_ADMIN=§7Alle Befehle, welcher für die Verwaltung eines Baus wichtig sind -HELP_BAU_GROUP_ADMIN_HOVER=§eAlle Verwaltungs Befehle -HELP_BAU_GROUP_OTHER=§7Alle sonstigen Befehle, für die Bau Welt -HELP_BAU_GROUP_OTHER_HOVER=§eAlle sonstigen Befehle -HELP_BAU_GROUP_WE=§7Alle Abkürzungen für World Edit -HELP_BAU_GROUP_WE_HOVER=§eAlle World Edit Befehle -HELP_BAU_GROUP_PLAYER=§7Alle Befehle, welche für den einzelnen Spieler sind -HELP_BAU_GROUP_PLAYER_HOVER=§eAlle Spieler Befehle -HELP_BAU_GROUP_WORLD=§7Alle wichtigen Weltbefehle, für die Bau Welt -HELP_BAU_GROUP_WORLD_HOVER=§eAlle World Befehle +HELP_BAU_GROUP_ADMIN=§7Bauserver-Verwaltungsbefehle +HELP_BAU_GROUP_ADMIN_HOVER=§eAlle Verwaltungsbefehle +HELP_BAU_GROUP_ADMIN_TITLE=§7Alle Verwaltungsbefehle§8: +HELP_BAU_GROUP_OTHER=§7Weitere Bauserverbefehle +HELP_BAU_GROUP_OTHER_HOVER=§eWeitere Bauserverbefehle +HELP_BAU_GROUP_OTHER_TITLE=§7Weitere Bauserverbefehle§8: +HELP_BAU_GROUP_WE=§7WorldEdit-Abkürzungen +HELP_BAU_GROUP_WE_HOVER=§eWorldEdit-Abkürzungen +HELP_BAU_GROUP_WE_TITLE=§7WorldEdit-Abkürzungen§8: +HELP_BAU_GROUP_PLAYER=§7Spielerbefehle +HELP_BAU_GROUP_PLAYER_HOVER=§eSpielerbefehle +HELP_BAU_GROUP_PLAYER_TITLE=§7Spielerbefehle§8: +HELP_BAU_GROUP_WORLD=§7Weltverändernde Bauserverbefehle +HELP_BAU_GROUP_WORLD_HOVER=§eWeltverändernde Bauserverbefehle +HELP_BAU_GROUP_WORLD_TITLE=§7Weltverändernde Bauserverbefehle§8: HELP_BAU_TP=§8/§ebau tp §8- §7Gehe auf Bauserver von Freunden! HELP_BAU_TP_HOVER=§eZu einem anderen Bauserver From e6926116fb8259ca6c23934f178e6757421ddb62 Mon Sep 17 00:00:00 2001 From: jojo Date: Sat, 28 Nov 2020 08:06:36 +0100 Subject: [PATCH 04/10] Optimize Imports --- src/de/steamwar/bungeecore/commands/HelpCommand.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/HelpCommand.java b/src/de/steamwar/bungeecore/commands/HelpCommand.java index 0509aca..4d0e491 100644 --- a/src/de/steamwar/bungeecore/commands/HelpCommand.java +++ b/src/de/steamwar/bungeecore/commands/HelpCommand.java @@ -25,8 +25,6 @@ import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.connection.ProxiedPlayer; -import javax.swing.*; - public class HelpCommand extends BasicCommand { public HelpCommand() { From 518ba7bd35c783f31be8eb3a20c7663b1fc85a10 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Wed, 9 Dec 2020 07:11:20 +0100 Subject: [PATCH 05/10] Hotfix Signed-off-by: Lixfel --- .../bungeecore/commands/HelpCommand.java | 4 +-- .../steamwar/messages/BungeeCore.properties | 25 ++++++++----------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/HelpCommand.java b/src/de/steamwar/bungeecore/commands/HelpCommand.java index 4d0e491..7394036 100644 --- a/src/de/steamwar/bungeecore/commands/HelpCommand.java +++ b/src/de/steamwar/bungeecore/commands/HelpCommand.java @@ -36,7 +36,7 @@ public class HelpCommand extends BasicCommand { if (args.length < 1) { Message.send("HELP_LOBBY", true, sender, ChatMessageType.SYSTEM, Message.parse("HELP_LOBBY_HOVER", sender), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/l")); Message.send("HELP_BAU", true, sender, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_HOVER", sender), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/bau")); - Message.send("HELP_BAUSERVER", true, sender, ChatMessageType.SYSTEM, Message.parse("HELP_BAUSERVER_HOVER", sender), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/help bauserver")); + Message.send("HELP_BAUSERVER", true, sender, ChatMessageType.SYSTEM, Message.parse("HELP_BAUSERVER_HOVER", sender), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/help bau")); Message.send("HELP_FIGHT", true, sender, ChatMessageType.SYSTEM, Message.parse("HELP_FIGHT_HOVER", sender), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/fight")); Message.send("HELP_CHALLENGE", true, sender, ChatMessageType.SYSTEM, Message.parse("HELP_CHALLENGE_HOVER", sender), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/challenge")); Message.send("HELP_HISTORIC", true, sender, ChatMessageType.SYSTEM, Message.parse("HELP_HISTORIC_HOVER", sender), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/historic")); @@ -104,7 +104,6 @@ public class HelpCommand extends BasicCommand { Message.send("HELP_BAU_TOGGLEWORLD", true, p, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_TOGGLEWORLD_HOVER", p), new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/bau toggleworld ")); Message.send("HELP_BAU_DELETE", true, p, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_DELETE_HOVER", p), new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/bau delete ")); Message.send("HELP_BAU_TESTARENA", true, p, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_TESTARENA_HOVER", p), new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/bau testarena ")); - Message.send("HELP_BAU_BAU", true, p, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_BAU_HOVER", p), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/help bau")); } static void sendBauHelpWorld(ProxiedPlayer p) { @@ -150,7 +149,6 @@ public class HelpCommand extends BasicCommand { Message.sendPrefixless("HELP_TESTBLOCK", p); Message.sendPrefixless("HELP_SKULL", p); Message.sendPrefixless("HELP_BAUINFO", p); - Message.sendPrefixless("HELP_BAUSERVER_SHORT", p); } } diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index 14172c9..e7ff281 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -9,7 +9,7 @@ HELP_LOBBY=§7Kehre von überall mit §8/§el §7zur Lobby zurück! HELP_LOBBY_HOVER=§eZurück zur Lobby HELP_BAU=§7Komme mit §8/§ebau §7auf den Bauserver! HELP_BAU_HOVER=§eZum Bauserver -HELP_BAUSERVER=§7Erhalte mit §8/§ehelp bauserver §7Hilfe zum Bauserver! +HELP_BAUSERVER=§7Erhalte mit §8/§ehelp bau §7Hilfe zum Bauserver! HELP_BAUSERVER_HOVER=§eHilfe zum Bauserver HELP_FIGHT=§7Starte mit §8/§efight §7einen neuen Kampf! HELP_FIGHT_HOVER=§eZum Kampfsystem @@ -32,24 +32,23 @@ HELP_SPEED=§8/§espeed §8- §7Ändert deine Fluggeschwindigkeit HELP_NV=§8/§env §8- §7(de)aktiviert Nachtsicht HELP_WV=§8/§ewv §8- §7(de)aktiviert Unterwassersicht HELP_TRACE=§8/§etrace §8- §7Gibt einen Überblick über den TNT-Tracer -HELP_TPSLIMIT="§8/§etpslimit §8- §7Gibt einen Überblick über den TPS-Limiter" +HELP_TPSLIMIT=§8/§etpslimit §8- §7Gibt einen Überblick über den TPS-Limiter HELP_LOADER=§8/§eloader §8- §7Nutze den automatischen Kanonenlader HELP_PROTECT=§8/§eprotect §8- §7Schützt den Boden der (M)WG-Region HELP_FREEZE=§8/§efreeze §8- §7Unterbindet Blockupdates HELP_SKULL=§8/§eskull §8- §7Gibt dir den Kopf eines Spielers HELP_DEBUGSTICK=§8/§edebugstick §8- §7Gibt dir einen Debugstick (nur 1.15) HELP_BAUINFO=§8/§ebauinfo §8- §7Gibt dir Informationen über den Bauserver -HELP_BAUSERVER_SHORT=§8/§ehelp bauserver §8- §7Hilfe zum Bauserver -HELP_WE_POS1=§8//§e1 §8» //§epos1 -HELP_WE_POS2=§8//§e2 §8» //§epos2 -HELP_WE_COPY=§8//§ec §8» //§ecopy -HELP_WE_PASTE=§8//§ep §8» //§epaste -HELP_WE_FLOPY=§8//§eflopy §8» //§ecopy §7& §8//§eflip -HELP_WE_FLOPYP=§8//§eflopyp §8» //§ecopy §7& §8//§eflip §7& §8//§epaste -HELP_WE_ROTATE_90=§8//§e90 §8» //§erotate 90 -HELP_WE_ROTATE_180=§8//§e180 §8» //§erotate 180 -HELP_WE_ROTATE_N90=§8//§e-90 §8» //§erotate -90 +HELP_WE_POS1=§8//§e1 §7» §8//§epos1 +HELP_WE_POS2=§8//§e2 §7» §8//§epos2 +HELP_WE_COPY=§8//§ec §7» §8//§ecopy +HELP_WE_PASTE=§8//§ep §7» §8//§epaste +HELP_WE_FLOPY=§8//§eflopy §7» §8//§ecopy §7& §8//§eflip +HELP_WE_FLOPYP=§8//§eflopyp §7» §8//§ecopy §7& §8//§eflip §7& §8//§epaste +HELP_WE_ROTATE_90=§8//§e90 §7» §8//§erotate 90 +HELP_WE_ROTATE_180=§8//§e180 §7» §8//§erotate 180 +HELP_WE_ROTATE_N90=§8//§e-90 §7» §8//§erotate -90 HELP_BAU_GROUP_ADMIN=§7Bauserver-Verwaltungsbefehle HELP_BAU_GROUP_ADMIN_HOVER=§eAlle Verwaltungsbefehle @@ -83,8 +82,6 @@ HELP_BAU_DELETE=§8/§ebau delete §8- §7Setzt deine Bauwelt zurück HELP_BAU_DELETE_HOVER=§eBauwelt zurücksetzen HELP_BAU_TESTARENA=§8/§ebau testarena §8- §7Starte eine Testarena HELP_BAU_TESTARENA_HOVER=§eTestarena starten -HELP_BAU_BAU=§8/§ehelp bau §8- §7Hilfe zu nützlichen Werkzeugen -HELP_BAU_BAU_HOVER=§eNützliche Zusatzfunktionen #Usage description of various commands USAGE_ALERT=§8/§7alert §8[§eNachricht§8] From ed79088560dd6dca5ca1ace9a69034d9a148f0de Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Thu, 10 Dec 2020 15:00:48 +0100 Subject: [PATCH 06/10] Add Ban Time to Banumgehungs message and moved Messages to properties --- .../bungeecore/listeners/BanListener.java | 37 +++++++++++-------- .../steamwar/messages/BungeeCore.properties | 3 ++ 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/de/steamwar/bungeecore/listeners/BanListener.java b/src/de/steamwar/bungeecore/listeners/BanListener.java index c9aadb7..d996c90 100644 --- a/src/de/steamwar/bungeecore/listeners/BanListener.java +++ b/src/de/steamwar/bungeecore/listeners/BanListener.java @@ -20,6 +20,7 @@ package de.steamwar.bungeecore.listeners; import de.steamwar.bungeecore.BungeeCore; +import de.steamwar.bungeecore.Message; import de.steamwar.bungeecore.sql.BannedUserIPs; import de.steamwar.bungeecore.sql.SteamwarUser; import net.md_5.bungee.api.ProxyServer; @@ -31,6 +32,9 @@ import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.event.LoginEvent; import net.md_5.bungee.event.EventHandler; +import java.sql.Timestamp; +import java.time.Instant; +import java.time.format.DateTimeFormatter; import java.util.List; public class BanListener extends BasicListener { @@ -47,27 +51,28 @@ public class BanListener extends BasicListener { List ips = BannedUserIPs.get(event.getConnection().getAddress().getAddress().getHostAddress()); if(!ips.isEmpty()){ - StringBuilder potentialBan = new StringBuilder(); - potentialBan.append(BungeeCore.CHAT_PREFIX); - potentialBan.append("§cMögliche Bannumgehung durch §r"); - potentialBan.append(user.getUserName()); - potentialBan.append("§c:"); - for(BannedUserIPs banned : ips){ - SteamwarUser bannedUser = SteamwarUser.get(banned.getUserID()); - potentialBan.append(" §e"); - potentialBan.append(banned.getTimestamp().toLocalDateTime().format(BungeeCore.DATE_FORMAT)); - potentialBan.append(" §c"); - potentialBan.append(bannedUser.getUserName()); - } - - TextComponent msg = new TextComponent(potentialBan.toString()); - msg.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("§cBanne Spieler wegen Bannumgehung").create())); - msg.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/ban " + user.getUserName() + " perma Bannumgehung")); for (ProxiedPlayer target : ProxyServer.getInstance().getPlayers()){ if ((target.hasPermission("bungeecore.teamchat")) && (target.getChatMode() == ProxiedPlayer.ChatMode.COMMANDS_ONLY || target.getChatMode() == ProxiedPlayer.ChatMode.SHOWN)){ + StringBuilder potentialBan = new StringBuilder(); + potentialBan.append(Message.parsePrefixed("BAN_AVOIDING_ALERT", target, user.getUserName())); + + Timestamp highestBan = Timestamp.from(Instant.now()); + for(BannedUserIPs banned : ips) { + SteamwarUser bannedUser = SteamwarUser.get(banned.getUserID()); + potentialBan.append(Message.parse("BAN_AVOIDING_LIST", target, bannedUser.getId(), + banned.getTimestamp().toLocalDateTime().format(BungeeCore.DATE_FORMAT), bannedUser.getUserName())); + if(highestBan.before(banned.getTimestamp())) + highestBan = banned.getTimestamp(); + } + + TextComponent msg = new TextComponent(potentialBan.toString()); + msg.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(Message.parse("BAN_AVOIDING_BAN_HOVER", target)).create())); + msg.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/ban " + user.getUserName() + " " + + highestBan.toLocalDateTime().format(DateTimeFormatter.ofPattern("dd.MM.yyyy_HH:mm")) + + " Bannumgehung")); target.sendMessage(msg); } } diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index e7ff281..9e7e432 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -93,6 +93,9 @@ USAGE_IGNORE=§8/§7ignore §8[§eSpieler§8] ALERT=§f{0} BAN_MESSAGE_YOU=§7Du hast §e{0} §7gebannt§8. §7Grund§8: §c{1} +BAN_AVOIDING_ALERT=§cMögliche Bannumgehung durch §r{0}§c: +BAN_AVOIDING_LIST={0} §e{1} §c +BAN_AVOIDING_BAN_HOVER=§cBanne Spieler wegen Bannumgehung MUTE_MESSAGE_YOU=§7Du hast §e{0} §7gemutet§8. §7Grund§8: §c{1} From dcff5ed22fabf4d39e4304caeaa84026d86f1a12 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Thu, 10 Dec 2020 15:17:25 +0100 Subject: [PATCH 07/10] Add Extending Ban of Account with same IP --- src/de/steamwar/bungeecore/sql/SteamwarUser.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/de/steamwar/bungeecore/sql/SteamwarUser.java b/src/de/steamwar/bungeecore/sql/SteamwarUser.java index 61625ea..66b1d36 100644 --- a/src/de/steamwar/bungeecore/sql/SteamwarUser.java +++ b/src/de/steamwar/bungeecore/sql/SteamwarUser.java @@ -214,6 +214,12 @@ public class SteamwarUser { if(player != null){ updateBanIP(player.getAddress().getAddress().getHostAddress()); player.disconnect(banMessage()); + for (BannedUserIPs banned: + BannedUserIPs.get(player.getAddress().getAddress().getHostAddress())) { + SteamwarUser bannedUser = SteamwarUser.get(banned.getUserID()); + if(bannedUser.isBanned() && banned.getTimestamp().before(time)) + bannedUser.ban(time, bannedUser.banReason); + } }else updateBanIP(""); } From 68ce7330ef4d3dc46677f1e0806b0bdc7a54f81a Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Thu, 10 Dec 2020 19:18:50 +0100 Subject: [PATCH 08/10] Fixing Double Execution of Code --- .../bungeecore/listeners/BanListener.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/de/steamwar/bungeecore/listeners/BanListener.java b/src/de/steamwar/bungeecore/listeners/BanListener.java index d996c90..810e95a 100644 --- a/src/de/steamwar/bungeecore/listeners/BanListener.java +++ b/src/de/steamwar/bungeecore/listeners/BanListener.java @@ -52,6 +52,15 @@ public class BanListener extends BasicListener { List ips = BannedUserIPs.get(event.getConnection().getAddress().getAddress().getHostAddress()); if(!ips.isEmpty()){ + Timestamp highestBan = Timestamp.from(Instant.now()); + for(BannedUserIPs banned : ips) { + if(highestBan.before(banned.getTimestamp())) + highestBan = banned.getTimestamp(); + } + ClickEvent clickEvent = new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/ban " + user.getUserName() + " " + + highestBan.toLocalDateTime().format(DateTimeFormatter.ofPattern("dd.MM.yyyy_HH:mm")) + + " Bannumgehung"); + for (ProxiedPlayer target : ProxyServer.getInstance().getPlayers()){ if ((target.hasPermission("bungeecore.teamchat")) && (target.getChatMode() == ProxiedPlayer.ChatMode.COMMANDS_ONLY @@ -59,20 +68,15 @@ public class BanListener extends BasicListener { StringBuilder potentialBan = new StringBuilder(); potentialBan.append(Message.parsePrefixed("BAN_AVOIDING_ALERT", target, user.getUserName())); - Timestamp highestBan = Timestamp.from(Instant.now()); for(BannedUserIPs banned : ips) { SteamwarUser bannedUser = SteamwarUser.get(banned.getUserID()); potentialBan.append(Message.parse("BAN_AVOIDING_LIST", target, bannedUser.getId(), banned.getTimestamp().toLocalDateTime().format(BungeeCore.DATE_FORMAT), bannedUser.getUserName())); - if(highestBan.before(banned.getTimestamp())) - highestBan = banned.getTimestamp(); } TextComponent msg = new TextComponent(potentialBan.toString()); msg.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(Message.parse("BAN_AVOIDING_BAN_HOVER", target)).create())); - msg.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/ban " + user.getUserName() + " " - + highestBan.toLocalDateTime().format(DateTimeFormatter.ofPattern("dd.MM.yyyy_HH:mm")) - + " Bannumgehung")); + msg.setClickEvent(clickEvent); target.sendMessage(msg); } } From c0330635a6e5fddfa9488f9e5aa546de3220126c Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Thu, 10 Dec 2020 19:31:28 +0100 Subject: [PATCH 09/10] Fixing Message --- src/de/steamwar/messages/BungeeCore.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index 9e7e432..0c537b1 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -93,8 +93,8 @@ USAGE_IGNORE=§8/§7ignore §8[§eSpieler§8] ALERT=§f{0} BAN_MESSAGE_YOU=§7Du hast §e{0} §7gebannt§8. §7Grund§8: §c{1} -BAN_AVOIDING_ALERT=§cMögliche Bannumgehung durch §r{0}§c: -BAN_AVOIDING_LIST={0} §e{1} §c +BAN_AVOIDING_ALERT=§cMögliche Bannumgehung durch §r{0} +BAN_AVOIDING_LIST=§c: {0} §e{1} §c BAN_AVOIDING_BAN_HOVER=§cBanne Spieler wegen Bannumgehung MUTE_MESSAGE_YOU=§7Du hast §e{0} §7gemutet§8. §7Grund§8: §c{1} From 95b5925b5fb85223d2a16fbda36f21cb2f744bc1 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Thu, 10 Dec 2020 19:35:43 +0100 Subject: [PATCH 10/10] Fixing Message Again... --- src/de/steamwar/messages/BungeeCore.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index 0c537b1..dc2dbab 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -93,8 +93,8 @@ USAGE_IGNORE=§8/§7ignore §8[§eSpieler§8] ALERT=§f{0} BAN_MESSAGE_YOU=§7Du hast §e{0} §7gebannt§8. §7Grund§8: §c{1} -BAN_AVOIDING_ALERT=§cMögliche Bannumgehung durch §r{0} -BAN_AVOIDING_LIST=§c: {0} §e{1} §c +BAN_AVOIDING_ALERT=§cMögliche Bannumgehung durch §r{0}§c: §c +BAN_AVOIDING_LIST={0} §e{1} §c BAN_AVOIDING_BAN_HOVER=§cBanne Spieler wegen Bannumgehung MUTE_MESSAGE_YOU=§7Du hast §e{0} §7gemutet§8. §7Grund§8: §c{1}