From 11a339f785a5772ab434ce0b27f99f683fcd9f85 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Tue, 19 Jan 2021 16:26:59 +0100 Subject: [PATCH] Add EventModeListener MultiLang --- .../steamwar/bungeecore/listeners/EventModeListener.java | 8 +++----- src/de/steamwar/messages/BungeeCore.properties | 5 ++++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/de/steamwar/bungeecore/listeners/EventModeListener.java b/src/de/steamwar/bungeecore/listeners/EventModeListener.java index c5bc2561..852703ce 100644 --- a/src/de/steamwar/bungeecore/listeners/EventModeListener.java +++ b/src/de/steamwar/bungeecore/listeners/EventModeListener.java @@ -1,25 +1,23 @@ package de.steamwar.bungeecore.listeners; +import de.steamwar.bungeecore.Message; import de.steamwar.bungeecore.sql.Event; import de.steamwar.bungeecore.sql.EventFight; import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.TeamTeilnahme; -import net.md_5.bungee.api.chat.BaseComponent; import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.event.PostLoginEvent; import net.md_5.bungee.event.EventHandler; public class EventModeListener extends BasicListener { - private static final BaseComponent[] nonParticipant = TextComponent.fromLegacyText("§cDu bist kein Eventteilnehmer."); - @EventHandler public void onPostLogin(PostLoginEvent e) { SteamwarUser user = SteamwarUser.get(e.getPlayer().getUniqueId()); Event event = Event.get(); if(event == null){ - e.getPlayer().disconnect(nonParticipant); + e.getPlayer().disconnect(TextComponent.fromLegacyText(Message.parse("EVENTMODE_KICK", e.getPlayer()))); return; } @@ -31,6 +29,6 @@ public class EventModeListener extends BasicListener { return; } - e.getPlayer().disconnect(nonParticipant); + e.getPlayer().disconnect(TextComponent.fromLegacyText(Message.parse("EVENTMODE_KICK", e.getPlayer()))); } } diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index 6df61ecb..9a49501a 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -439,4 +439,7 @@ 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 +JOIN_FIRST=§7Begrüßt alle mal §e{0} §7auf dem Server§8! + +#EventModeListener +EVENTMODE_KICK=§cDu bist kein Eventteilnehmer. \ No newline at end of file