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