geforkt von SteamWar/BungeeCore
Fix several issues
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
fd1efaa22b
Commit
7377f5513a
@ -88,10 +88,10 @@ public class BauCommand extends BasicCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
setLocked(SteamwarUser.get(p), args[1].toUpperCase());
|
||||
setLocked(p, args[1].toUpperCase());
|
||||
break;
|
||||
case "unlock":
|
||||
setLocked(SteamwarUser.get(p), "OPEN");
|
||||
setLocked(p, "OPEN");
|
||||
break;
|
||||
default:
|
||||
HelpCommand.sendBauHelp(ChatSender.of(p));
|
||||
@ -327,7 +327,8 @@ public class BauCommand extends BasicCommand {
|
||||
}
|
||||
|
||||
private static final String BAU_LOCK_CONFIG_NAME = "baulockstate";
|
||||
private static void setLocked(SteamwarUser owner, String arg) {
|
||||
private static void setLocked(ProxiedPlayer p, String arg) {
|
||||
SteamwarUser owner = SteamwarUser.get(p.getUniqueId());
|
||||
BauLockState state;
|
||||
try {
|
||||
state = BauLockState.valueOf(arg);
|
||||
@ -337,12 +338,20 @@ public class BauCommand extends BasicCommand {
|
||||
}
|
||||
|
||||
UserConfig.updateUserConfig(owner.getId(), BAU_LOCK_CONFIG_NAME, state == BauLockState.OPEN ? null : state.name());
|
||||
Subserver.getServerList().stream().filter(server -> server.getType() == Servertype.BAUSERVER && ((Bauserver)server).getOwner().equals(p.getUniqueId())).findAny().ifPresent(
|
||||
server -> server.getServer().getPlayers().stream().filter(player -> isLocked(owner, SteamwarUser.get(player.getUniqueId()))).forEach(member -> {
|
||||
member.connect(ProxyServer.getInstance().getServerInfo(BungeeCore.LOBBY_SERVER));
|
||||
Message.send("BAU_LOCKED_NOALLOWED", p);
|
||||
})
|
||||
);
|
||||
Message.send("BAU_LOCKED_" + state.name(), owner.getPlayer());
|
||||
}
|
||||
|
||||
private static boolean isLocked(SteamwarUser owner, SteamwarUser target) {
|
||||
String state = UserConfig.getConfig(owner.getId(), BAU_LOCK_CONFIG_NAME);
|
||||
if (owner.getId() == target.getId())
|
||||
return false;
|
||||
|
||||
String state = UserConfig.getConfig(owner.getId(), BAU_LOCK_CONFIG_NAME);
|
||||
switch (state == null ? BauLockState.OPEN : BauLockState.valueOf(state)) {
|
||||
case NOBODY:
|
||||
return true;
|
||||
|
@ -268,6 +268,7 @@ public class SteamwarUser {
|
||||
return team;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public ProxiedPlayer getPlayer() {
|
||||
return ProxyServer.getInstance().getPlayer(uuid);
|
||||
}
|
||||
|
@ -202,11 +202,11 @@ BAU_ADDMEMBER_ADDED=§aThe player was added to your world.
|
||||
BAU_ADDMEMBER_ADDED_TARGET=§aYou have been added to the world of §e{0}§a.
|
||||
BAU_TP_USAGE=§8/§7build tp §8[§eplayer§8]
|
||||
BAU_TP_NOALLOWED=§cYou are not allowed to teleport to this player's world.
|
||||
BAU_LOCKED_NOALLOWED=&cThe build server is currently locked.
|
||||
BAU_LOCKED_NOALLOWED=§cThe build server is currently locked.
|
||||
BAU_LOCKED_OPTIONS=§7Build server lock options§8: §cnone§8, §eteam§8, §aopen
|
||||
BAU_LOCKED_NOBODY=§eYou have closed your build server for all players.
|
||||
BAU_LOCKED_TEAM=§eYou've closed your build server for all players except added team members.
|
||||
BAU_LOCKED_OPEN=§eYou have opened your build server for all added players.
|
||||
BAU_LOCKED_NOBODY=§7You have closed your build server for all players.
|
||||
BAU_LOCKED_TEAM=§7You've closed your build server for all players except added team members.
|
||||
BAU_LOCKED_OPEN=§7You have opened your build server for all added players.
|
||||
BAU_DELMEMBER_USAGE=§8/§7build delmember §8[§eplayer§8]
|
||||
BAU_DELMEMBER_SELFDEL=§cYou cannot remove yourself!
|
||||
BAU_DELMEMBER_DELETED=§cPlayer was removed.
|
||||
|
@ -40,10 +40,6 @@ HELP_JOIN=§7Trete mit §8/§ejoin §8[§eSpieler§8] §7einem Kampf bei!
|
||||
HELP_JOIN_HOVER=§eSpieler beitreten
|
||||
HELP_LOCAL=§7Schreibe mit §8/§elocal §7nur auf dem lokalen Server!
|
||||
HELP_LOCAL_HOVER=§eLokaler Chat
|
||||
HELP_BAU_LOCK=§8/§ebuild lock §8- §7Sperre deinen Bauserver für bestimmte Spieler.
|
||||
HELP_BAU_LOCK_HOVER=§eSperre deinen bau
|
||||
HELP_BAU_UNLOCK=§8/§ebuild unlock §8- §7SÖffne den Bauserver für alle hinzugefügten Spieler.
|
||||
HELP_BAU_UNLOCK_HOVER=§eÖffne deinen bau
|
||||
|
||||
HELP_TNT=§8/§7tnt §8- §7(de)aktiviert Explosionsschaden
|
||||
HELP_FIRE=§8/§7fire §8- §7(de)aktiviert Feuerschaden
|
||||
@ -91,6 +87,10 @@ 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_LOCK=§8/§ebau lock §8- §7Sperre deinen Bauserver für bestimmte Spieler.
|
||||
HELP_BAU_LOCK_HOVER=§eSperre deinen Bau
|
||||
HELP_BAU_UNLOCK=§8/§ebau unlock §8- §7Öffne deinen Bauserver für alle hinzugefügten Spieler.
|
||||
HELP_BAU_UNLOCK_HOVER=§eÖffne deinen Bau
|
||||
|
||||
#Usage description of various commands
|
||||
USAGE_ALERT=§8/§7alert §8[§eNachricht§8]
|
||||
@ -186,11 +186,11 @@ BAU_ADDMEMBER_ADDED=§aDer Spieler wurde zu deiner Welt hinzugefügt.
|
||||
BAU_ADDMEMBER_ADDED_TARGET=§aDu wurdest zu der Welt von §e{0} §ahinzugefügt.
|
||||
BAU_TP_USAGE=§8/§7bau tp §8[§eSpieler§8]
|
||||
BAU_TP_NOALLOWED=§cDu darfst dich nicht auf diese Welt teleportieren.
|
||||
BAU_LOCKED_NOALLOWED=&cDer Bauserver ist momentan gesperrt.
|
||||
BAU_LOCKED_OPTIONS=§eBauserver-Sperroptionen: §cnone§8, §eteam§8, §aopen§8.
|
||||
BAU_LOCKED_NOBODY=§eDu hast deinen Bau für alle Spieler geschlossen.
|
||||
BAU_LOCKED_TEAM=§eDu hast deinen Bau für alle außer hinzugefügte Teammitglieder gesperrt.
|
||||
BAU_LOCKED_OPEN=§eDu hast deinen Bau für alle hinzugefügten Spieler geöffnet.
|
||||
BAU_LOCKED_NOALLOWED=§cDer Bauserver ist momentan gesperrt.
|
||||
BAU_LOCKED_OPTIONS=§7Bauserver-Sperroptionen§8: §cnone§8, §eteam§8, §aopen
|
||||
BAU_LOCKED_NOBODY=§7Du hast deinen Bau für alle Spieler geschlossen.
|
||||
BAU_LOCKED_TEAM=§7Du hast deinen Bau für alle außer hinzugefügte Teammitglieder gesperrt.
|
||||
BAU_LOCKED_OPEN=§7Du hast deinen Bau für alle hinzugefügten Spieler geöffnet.
|
||||
BAU_DELMEMBER_USAGE=§8/§7bau delmember §8[§eSpieler§8]
|
||||
BAU_DELMEMBER_SELFDEL=§cDu kannst dich nicht selbst entfernen!
|
||||
BAU_DELMEMBER_DELETED=§cDer Spieler wurde entfernt.
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren