diff --git a/src/de/steamwar/bungeecore/commands/BauCommand.java b/src/de/steamwar/bungeecore/commands/BauCommand.java index d59ff34e..a57870ac 100644 --- a/src/de/steamwar/bungeecore/commands/BauCommand.java +++ b/src/de/steamwar/bungeecore/commands/BauCommand.java @@ -199,6 +199,24 @@ public class BauCommand extends SWCommand { isAllowedTo(target.isWorld(), p, target, "BAU_MEMBER_TOGGLE_WORLD"); } + @Register("toggleall") + public void toggleall(ProxiedPlayer p, @AllowNull @OptionalValue("") SteamwarUser user) { + if (user == null) { + Message.send("BAU_MEMBER_TOGGLE_USAGE", p, "toggleall"); + return; + } + BauweltMember target = member(p, user); + if (target == null) + return; + + boolean state = !target.isWorldEdit() || !target.isWorld(); + target.setWorldEdit(state); + target.setWorld(state); + clearMembercache(p); + isAllowedTo(target.isWorldEdit(), p, target, "BAU_MEMBER_TOGGLE_WORLD_EDIT"); + isAllowedTo(target.isWorld(), p, target, "BAU_MEMBER_TOGGLE_WORLD"); + } + private static void clearMembercache(ProxiedPlayer p){ for(ServerInfo info : ProxyServer.getInstance().getServers().values()){ Subserver server = Subserver.getSubserver(info); diff --git a/src/de/steamwar/bungeecore/commands/HelpCommand.java b/src/de/steamwar/bungeecore/commands/HelpCommand.java index 7da1ba7b..0aa879fc 100644 --- a/src/de/steamwar/bungeecore/commands/HelpCommand.java +++ b/src/de/steamwar/bungeecore/commands/HelpCommand.java @@ -22,10 +22,8 @@ package de.steamwar.bungeecore.commands; import de.steamwar.bungeecore.Message; import de.steamwar.command.SWCommand; import de.steamwar.messages.ChatSender; -import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.connection.ProxiedPlayer; -import net.md_5.bungee.protocol.packet.Chat; public class HelpCommand extends SWCommand { @@ -93,6 +91,7 @@ public class HelpCommand extends SWCommand { "HELP_BAU_DELMEMBER", "/build delmember ", "HELP_BAU_TOGGLEWE", "/build togglewe ", "HELP_BAU_TOGGLEWORLD", "/build toggleworld ", + "HELP_BAU_TOGGLEALL", "/build toggleall ", "HELP_BAU_DELETE", "/build delete ", "HELP_BAU_TESTARENA", "/build testarena ", "HELP_BAU_LOCK", "/build lock ", diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index a515ed1c..89b22286 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -95,6 +95,8 @@ HELP_BAU_TOGGLEWE=§8/§ebuild togglewe §8- §7Permission to use WorldEdit, /te HELP_BAU_TOGGLEWE_HOVER=§eToggles WorldEdit permission HELP_BAU_TOGGLEWORLD=§8/§ebuild toggleworld §8- §7/reset, /trace, /fire, /tnt HELP_BAU_TOGGLEWORLD_HOVER=§eToggles world permission +HELP_BAU_TOGGLEALL=§8/§ebuild toggleall §8- §7WorldEdit and world +HELP_BAU_TOGGLEALL_HOVER=§eToggles WorldEdit and world permissions HELP_BAU_DELETE=§8/§ebuild delete §8- §7Reset your entire build server HELP_BAU_DELETE_HOVER=§eReset build server HELP_BAU_TESTARENA=§8/§ebuild testarena §8- §7Start a test arena diff --git a/src/de/steamwar/messages/BungeeCore_de.properties b/src/de/steamwar/messages/BungeeCore_de.properties index d3527251..46b3ba11 100644 --- a/src/de/steamwar/messages/BungeeCore_de.properties +++ b/src/de/steamwar/messages/BungeeCore_de.properties @@ -81,6 +81,8 @@ HELP_BAU_TOGGLEWE=§8/§ebau togglewe §8- §7Berechtigung für WorldEdit, /test HELP_BAU_TOGGLEWE_HOVER=§eStellt Spielerberechtigungen ein HELP_BAU_TOGGLEWORLD=§8/§ebau toggleworld §8- §7/reset, /trace, /fire, /tnt HELP_BAU_TOGGLEWORLD_HOVER=§eStellt Spielerberechtigungen ein +HELP_BAU_TOGGLEALL=§8/§ebuild toggleall §8- §7WorldEdit und Weltberechtigungen +HELP_BAU_TOGGLEALL_HOVER=§eStellt Spielerberechtigungen ein 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