From fa9f4f7e793d241c2fd7e31206bdf8304cb117fc Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Tue, 19 Jan 2021 16:25:03 +0100 Subject: [PATCH] Add ConnectionListener MultiLang --- .../bungeecore/listeners/ConnectionListener.java | 9 ++++----- src/de/steamwar/messages/BungeeCore.properties | 7 ++++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/de/steamwar/bungeecore/listeners/ConnectionListener.java b/src/de/steamwar/bungeecore/listeners/ConnectionListener.java index 0deb468..7f0f88f 100644 --- a/src/de/steamwar/bungeecore/listeners/ConnectionListener.java +++ b/src/de/steamwar/bungeecore/listeners/ConnectionListener.java @@ -20,6 +20,7 @@ package de.steamwar.bungeecore.listeners; import de.steamwar.bungeecore.BungeeCore; +import de.steamwar.bungeecore.Message; import de.steamwar.bungeecore.Servertype; import de.steamwar.bungeecore.Subserver; import de.steamwar.bungeecore.commands.ChallengeCommand; @@ -83,16 +84,14 @@ public class ConnectionListener extends BasicListener { if(subserver.getType() == Servertype.ARENA){ Iterator it = subserver.getServer().getPlayers().iterator(); if(it.hasNext()){ - TextComponent tc = new TextComponent(BungeeCore.CHAT_PREFIX + "§7Klicke §ehier§7, um §e" + subserver.getServer().getName() + " §7beizutreten"); - tc.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("§eArena beitreten").create())); - tc.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + it.next().getName())); - player.sendMessage(tc); + Message.send("JOIN_ARENA", player, Message.parse("JOIN_ARENA_HOVER", player), + new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + it.next().getName()), subserver.getServer().getName()); } } } if(newPlayers.contains(player.getUniqueId())){ - BungeeCore.broadcast(BungeeCore.CHAT_PREFIX + "§7Begrüßt alle mal §e" + player.getName() + " §7auf dem Server§8!"); + Message.broadcast("JOIN_FIRST", player.getName()); newPlayers.remove(player.getUniqueId()); } } diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index b60c197..6df61ec 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -434,4 +434,9 @@ CHAT_BC_SYNTAX=§8/§e{0} §8[§7Nachricht§8] CHAT_BC_NO_COMMANDS=§cKeine Befehle mit /local möglich. #CheckListner -CHECK_UNCHECKED=§7Du hast noch §e{0} §7ungeprüfte Schematic§8(§7s§8)! \ No newline at end of file +CHECK_UNCHECKED=§7Du hast noch §e{0} §7ungeprüfte Schematic§8(§7s§8)! + +#ConnectionListener +JOIN_ARENA=§7Klicke §ehier§7, um §e{0} §7beizutreten +JOIN_ARENA_HOVER=§eArena beitreten +JOIN_FIRST=§7Begrüßt alle mal §e{0} §7auf dem Server§8! \ No newline at end of file