geforkt von SteamWar/BungeeCore
Add ChallengeCommand ML
Dieser Commit ist enthalten in:
Ursprung
a4359b6dd5
Commit
8dc4bd5f61
@ -101,6 +101,11 @@ public class Message {
|
||||
sender.sendMessage(msg);
|
||||
}
|
||||
|
||||
public static void broadcast(String message, boolean prefixed, String onHover, ClickEvent onClick, Object... params){
|
||||
for(ProxiedPlayer player : ProxyServer.getInstance().getPlayers())
|
||||
send(message, player, parse(onHover, prefixed, player), onClick, params);
|
||||
}
|
||||
|
||||
public static void broadcast(String message, String onHover, ClickEvent onClick, Object... params){
|
||||
for(ProxiedPlayer player : ProxyServer.getInstance().getPlayers())
|
||||
send(message, player, parse(onHover, false, player), onClick, params);
|
||||
|
@ -40,7 +40,7 @@ public class ChallengeCommand extends BasicCommand {
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(args.length < 1){
|
||||
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§8/§echallenge §8[§7Spieler§8]");
|
||||
Message.send("CHALLENGE_SYNTAX", sender);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -48,25 +48,25 @@ public class ChallengeCommand extends BasicCommand {
|
||||
return;
|
||||
|
||||
if(ModLoaderBlocker.isFabric((ProxiedPlayer) sender)) {
|
||||
BungeeCore.send((ProxiedPlayer) sender, BungeeCore.CHAT_PREFIX + "§cHabe ich dir nicht gesagt, dass man mit Fabric/LiteLoader nicht auf die Arenen darf?");
|
||||
Message.send("CHALLENGE_FABRIC", sender);
|
||||
return;
|
||||
}
|
||||
|
||||
ProxiedPlayer target = ProxyServer.getInstance().getPlayer(args[0]);
|
||||
if(target == null){
|
||||
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cDer Herausgeforderte ist nicht online.");
|
||||
Message.send("CHALLENGE_OFFLINE", sender);
|
||||
return;
|
||||
}else if(target == sender){
|
||||
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cSchizophren?");
|
||||
Message.send("CHALLENGE_SELF", sender);
|
||||
return;
|
||||
}else if (IgnoreSystem.isIgnored(target, (ProxiedPlayer) sender)) {
|
||||
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cDer Herausgeforderte hat dich geblockt.");
|
||||
Message.send("CHALLENGE_IGNORED", sender);
|
||||
return;
|
||||
}
|
||||
|
||||
Subserver subserver = Subserver.getSubserver(target);
|
||||
if(subserver != null && subserver.getType() == Servertype.ARENA){
|
||||
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cDer Herausgeforderte ist bereits in einer Arena.");
|
||||
Message.send("CHALLENGE_INARENA", sender);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -80,9 +80,8 @@ public class ChallengeCommand extends BasicCommand {
|
||||
arena.sendPlayer(player);
|
||||
arena.sendPlayer(target);
|
||||
|
||||
BungeeCore.broadcast(BungeeCore.CHAT_PREFIX + "§e" + mode.getDisplayName() + "§7-§eDuell§7: " + player.getName() + " vs " + target.getName(),
|
||||
"§aZuschauen",
|
||||
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()));
|
||||
Message.broadcast("CHALLENGE_BROADCAST", sender, true, Message.parse("CHALLENGE_BROADCAST_HOVER", player), //Needs BanSystemRework for Loading from Message File
|
||||
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()), mode.getDisplayName(), player.getDisplayName(), target.getDisplayName());
|
||||
}else{
|
||||
if(!challenges.containsKey(player)){
|
||||
challenges.put(player, new LinkedList<>());
|
||||
@ -90,13 +89,10 @@ public class ChallengeCommand extends BasicCommand {
|
||||
|
||||
challenges.get(player).add(target);
|
||||
|
||||
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§7Du hast §e" + target.getName() + " §7zu einem §e" + mode.getDisplayName() + "-Kampf §7herausgefordert!");
|
||||
BungeeCore.send(target, BungeeCore.CHAT_PREFIX + "§e" + player.getName() + " §7 hat dich zu einem §e" + mode.getDisplayName() +
|
||||
"-Kampf §7" + (mode.getMaps().size()!=1?"auf §e" + map + " §7 ":"") + "herausgefordert!");
|
||||
Message.send("CHALLENGE_CHALLENGED", player, target.getName(), mode.getDisplayName());
|
||||
Message.send("CHALLENGE_CHALLENGED_TARGET", target, player.getName(), mode.getDisplayName(), mode.getMaps().size()!=1?Message.parse("CHALLENGE_CHALLENGED_MAP", target, map):"");
|
||||
|
||||
BungeeCore.send(target, BungeeCore.CHAT_PREFIX + "§7Klicke §ehier§7, um die Herausforderung anzunehmen",
|
||||
"§aHerausforderung annehmen",
|
||||
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/challenge " + player.getName() + " " + mode.getChatName() + " " + map));
|
||||
Message.send("CHALLENGE_ACCEPT", target, Message.parse("CHALLENGE_ACCEPT_HOVER", target), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/challenge " + player.getName() + " " + mode.getChatName() + " " + map));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -139,6 +139,21 @@ BAU_MEMBER_TOGGLE=§aDer Spieler darf nun {0}
|
||||
BAU_MEMBER_TOGGLE_TARGET_OFF=§cDu kannst nun nicht mehr auf der Welt von §e{0}§c {1}
|
||||
BAU_MEMBER_TOGGLE_OFF=§cDer Spieler darf nun nicht mehr {0}
|
||||
|
||||
#ChallengeCommand
|
||||
CHALLENGE_SYNTAX=§8/§echallenge §8[§7Spieler§8]
|
||||
CHALLENGE_FABRIC=§cHabe ich dir nicht gesagt, dass man mit Fabric/LiteLoader nicht auf die Arenen darf?
|
||||
CHALLENGE_OFFLINE=§cDer Herausgeforderte ist nicht online.
|
||||
CHALLENGE_SELF=§cSchizophren?
|
||||
CHALLENGE_IGNORED=§cDer Herausgeforderte hat dich geblockt.
|
||||
CHALLENGE_INARENA=§cDer Herausgeforderte ist bereits in einer Arena.
|
||||
CHALLENGE_BROADCAST=§e{0}§7-§eDuell§7: {1} vs {2}
|
||||
CHALLENGE_BROADCAST_HOVER=§aZuschauen
|
||||
CHALLENGE_CHALLENGED=§7Du hast §e{0} §7zu einem §e{1}-Kampf §7herausgefordert!
|
||||
CHALLENGE_CHALLENGED_TARGET=§e{0} §7 hat dich zu einem §e{1}-Kampf §7{2}herausgefordert!
|
||||
CHALLENGE_CHALLENGED_MAP=auf §e{0} §7
|
||||
CHALLENGE_ACCEPT=§7Klicke §ehier§7, um die Herausforderung anzunehmen
|
||||
CHALLENGE_ACCEPT_HOVER=§aHerausforderung annehmen
|
||||
|
||||
#CheckCommand
|
||||
CHECK_REMINDER=§7Es sind §e{0} §7Schematics zu prüfen§8!
|
||||
CHECK_NOT_CHECKING=§cDu prüfst derzeit nicht.
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren