diff --git a/src/de/steamwar/bungeecore/Message.java b/src/de/steamwar/bungeecore/Message.java index b2c471a..6fd0378 100644 --- a/src/de/steamwar/bungeecore/Message.java +++ b/src/de/steamwar/bungeecore/Message.java @@ -103,7 +103,7 @@ public class Message { 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); + send(message, player, parse(onHover, prefixed, player, params), onClick, params); } public static void broadcast(String message, String onHover, ClickEvent onClick, Object... params){ diff --git a/src/de/steamwar/bungeecore/commands/ChallengeCommand.java b/src/de/steamwar/bungeecore/commands/ChallengeCommand.java index b09a5b1..59de2b1 100644 --- a/src/de/steamwar/bungeecore/commands/ChallengeCommand.java +++ b/src/de/steamwar/bungeecore/commands/ChallengeCommand.java @@ -80,7 +80,7 @@ public class ChallengeCommand extends BasicCommand { arena.sendPlayer(player); arena.sendPlayer(target); - Message.broadcast("CHALLENGE_BROADCAST", sender, true, Message.parse("CHALLENGE_BROADCAST_HOVER", player), //TODO Needs BanSystemRework for Loading from Message File + Message.broadcast("CHALLENGE_BROADCAST", sender, true, "CHALLENGE_BROADCAST_HOVER", new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()), mode.getDisplayName(), player.getDisplayName(), target.getDisplayName()); }else{ if(!challenges.containsKey(player)){ diff --git a/src/de/steamwar/bungeecore/commands/FightCommand.java b/src/de/steamwar/bungeecore/commands/FightCommand.java index 2009ded..793ee84 100644 --- a/src/de/steamwar/bungeecore/commands/FightCommand.java +++ b/src/de/steamwar/bungeecore/commands/FightCommand.java @@ -166,7 +166,7 @@ public class FightCommand extends BasicCommand { createArena(sender, "/fight ", args, 0, false, (player, mode, map) -> { Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, null, null, player.getUniqueId(), null); arena.sendPlayer(player); - Message.broadcast("FIGHT_BROADCAST", true, Message.parse("FIGHT_BROADCAST_HOVER", player, player.getName()) //TODO Needs Message Object + Message.broadcast("FIGHT_BROADCAST", true, "FIGHT_BROADCAST_HOVER" , new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()), mode.getDisplayName(), player.getName()); }); } diff --git a/src/de/steamwar/bungeecore/commands/HistoricCommand.java b/src/de/steamwar/bungeecore/commands/HistoricCommand.java index 113f0f6..d98a135 100644 --- a/src/de/steamwar/bungeecore/commands/HistoricCommand.java +++ b/src/de/steamwar/bungeecore/commands/HistoricCommand.java @@ -35,7 +35,7 @@ public class HistoricCommand extends BasicCommand { FightCommand.createArena(sender, "/historic ", args, 0, true, (player, mode, map) -> { Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, null, null, player.getUniqueId(), null); arena.sendPlayer(player); - Message.broadcast("HISTORIC_BROADCAST", true, Message.parse("HISTORIC_BROADCAST_HOVER", player, player.getName()) //TODO Needs Message Object + Message.broadcast("HISTORIC_BROADCAST", true, "HISTORIC_BROADCAST_HOVER" , new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()), mode.getDisplayName(), player.getName()); }); } diff --git a/src/de/steamwar/bungeecore/commands/JoinmeCommand.java b/src/de/steamwar/bungeecore/commands/JoinmeCommand.java index cb338d3..593015f 100644 --- a/src/de/steamwar/bungeecore/commands/JoinmeCommand.java +++ b/src/de/steamwar/bungeecore/commands/JoinmeCommand.java @@ -24,9 +24,6 @@ import de.steamwar.bungeecore.sql.BauweltMember; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.chat.ClickEvent; -import net.md_5.bungee.api.chat.ComponentBuilder; -import net.md_5.bungee.api.chat.HoverEvent; -import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.config.ServerInfo; import net.md_5.bungee.api.connection.ProxiedPlayer; @@ -44,7 +41,7 @@ public class JoinmeCommand extends BasicCommand { ProxiedPlayer player = (ProxiedPlayer) sender; if (args.length == 0 && player.hasPermission("bungeecore.joinme")) { - Message.broadcast("JOINME_BROADCAST", true, Message.parse("JOINME_BROADCAST_HOVER", player) //TODO Needs Message Object + Message.broadcast("JOINME_BROADCAST", true, "JOINME_BROADCAST_HOVER" , new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName())); } else if (args.length == 1) { ProxiedPlayer target = ProxyServer.getInstance().getPlayer(args[0]); diff --git a/src/de/steamwar/bungeecore/commands/RankedCommand.java b/src/de/steamwar/bungeecore/commands/RankedCommand.java index 3f0914a..3e70966 100644 --- a/src/de/steamwar/bungeecore/commands/RankedCommand.java +++ b/src/de/steamwar/bungeecore/commands/RankedCommand.java @@ -59,7 +59,7 @@ public class RankedCommand extends BasicCommand { if(mode == null) return; else if(!mode.isRanked()){ - BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cDieser Spielmodus ist nicht für Ranglistenspiele freigeschalten"); + Message.send("RANKED_NO_RANKED_MODE", sender); return; } @@ -114,14 +114,14 @@ public class RankedCommand extends BasicCommand { private void togglePlayer(ProxiedPlayer player){ for(WaitingPlayer wp : players){ if(wp.player == player){ - BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cRanglistenspiel-Warteschlange verlassen"); + Message.send("RANKED_QUEUE_LEFT", player); players.remove(wp); return; } } - BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§aRanglistenspiel-Warteschlange betreten"); - BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§7Wiederhole den Befehl zum Verlassen der Warteschlange"); + Message.send("RANKED_QUEUE_JOINED", player); + Message.send("RANKED_QUEUE_HOW_TO_LEAVE", player); players.add(new WaitingPlayer(player, mode.getSchemType())); } @@ -160,8 +160,8 @@ public class RankedCommand extends BasicCommand { for(Map.Entry entry : inRange.entrySet()){ WaitingPlayer wp1 = entry.getKey(); WaitingPlayer wp2 = entry.getValue(); - BungeeCore.send(wp1.player, BungeeCore.CHAT_PREFIX + "§eGegner gefunden! Ranglistenspiel startet."); - BungeeCore.send(wp2.player, BungeeCore.CHAT_PREFIX + "§eGegner gefunden! Ranglistenspiel startet."); + Message.send("RANKED_ENEMY_SPOTTED", wp1.player); + Message.send("RANKED_ENEMY_SPOTTED", wp2.player); removeFromAll(wp1.player); removeFromAll(wp2.player); @@ -169,9 +169,8 @@ public class RankedCommand extends BasicCommand { arena.sendPlayer(wp1.player); arena.sendPlayer(wp2.player); - BungeeCore.broadcast(BungeeCore.CHAT_PREFIX + "§7" + mode.getDisplayName() + "§8-§7Ranglistenspiel§8: §e" + wp1.player.getName() + " vs " + wp2.player.getName(), - "§aZuschauen", - new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + wp1.player.getName())); + Message.broadcast("RANKED_BROADCAST", true, "RANKED_BROADCAST_HOVER", + new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + wp1.player.getName()), mode.getDisplayName(), wp1.player.getName(), wp2.player.getName()); } } } @@ -204,7 +203,7 @@ public class RankedCommand extends BasicCommand { if(subserver == null) return true; if(subserver.getType() == Servertype.ARENA){ - BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cRanglistenspiel-Warteschlange verlassen"); + Message.send("RANKED_QUEUE_LEFT", player); return false; } diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index 46745ac..e8c38c4 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -182,7 +182,7 @@ FIGHT_UNKNOWN_ARENA=§cDie gewünschte Arena gibt es nicht. FIGHT_ARENA_RANDOM=Random FIGHT_IN_ARENA=§cDu befindest dich bereits in einer Arena. FIGHT_BROADCAST=§7Klicke §ehier§7, um §e{0} §7gegen §e{1} §7zu §7kämpfen! -FIGHT_BROADCAST_HOVER=§aGegen §7{0} §ekämpfen +FIGHT_BROADCAST_HOVER=§aGegen §7{1} §ekämpfen #CheckCommand CHECK_REMINDER=§7Es sind §e{0} §7Schematics zu prüfen§8! @@ -213,7 +213,7 @@ CHECK_DECLINED_TEAM=§7Die Schematic §e{0} §7von §e{1} §awurde aufgrund von #HistoricCommand HISTORIC_BROADCAST=§7Historischer §e{0}§8-§7Kampf von §e{1}§8! -HISTORIC_BROADCAST_HOVER=§aGegen §7{0} §ekämpfen +HISTORIC_BROADCAST_HOVER=§aGegen §7{1} §ekämpfen #JoinmeCommand JOINME_SYNTAX=§7Mit §8/§ejoin §8[§eSpieler§8] §7kannst du einem Spieler folgen §8(z.B. in eine Arena)§7. @@ -248,4 +248,13 @@ POLL_ANSWER_NEW=§aDeine Antwort wurde registriert #RankCommand RANK_HEADER=§7§lPlatzierungen RANK_UNPLACED=§7{0}§8: §eunplatziert -RANK_PLACED=§7{0}§8: §e{1}§8. §7mit §e{2} §7Elo§8. \ No newline at end of file +RANK_PLACED=§7{0}§8: §e{1}§8. §7mit §e{2} §7Elo§8. + +#RankedCommand +RANKED_NO_RANKED_MODE=§cDieser Spielmodus ist nicht für Ranglistenspiele freigeschalten +RANKED_QUEUE_JOINED=§aRanglistenspiel-Warteschlange betreten +RANKED_QUEUE_HOW_TO_LEAVE=§7Wiederhole den Befehl zum Verlassen der Warteschlange +RANKED_QUEUE_LEFT=§cRanglistenspiel-Warteschlange verlassen +RANKED_ENEMY_SPOTTED=§eGegner gefunden! Ranglistenspiel startet. +RANKED_BROADCAST=§7{0}§8-§7Ranglistenspiel§8: §e{1} vs {2} +RANKED_BROADCAST_HOVER=§aZuschauen \ No newline at end of file