geforkt von SteamWar/BungeeCore
Merge pull request 'Bau toggleall' (#482) from toggleall into master
Reviewed-on: SteamWar/BungeeCore#482 Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Commit
fbbfc1bd03
@ -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);
|
||||
|
@ -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 ",
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren