From d470a56ffa7f79cf9bd3548e80a42a8419188d84 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Tue, 19 Jan 2021 01:58:25 +0100 Subject: [PATCH] Add TeamchatCommand MultiLang --- src/de/steamwar/bungeecore/BungeeCore.java | 1 - .../steamwar/bungeecore/commands/TeamchatCommand.java | 10 ++++------ src/de/steamwar/messages/BungeeCore.properties | 7 ++++++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index a14d668..2f5fc94 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -53,7 +53,6 @@ import java.util.logging.Level; public class BungeeCore extends Plugin { - public static final String TEAMCHAT_PREFIX = "§8TC §e"; public static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern("dd.MM.yyyy"); public static String CHAT_PREFIX; diff --git a/src/de/steamwar/bungeecore/commands/TeamchatCommand.java b/src/de/steamwar/bungeecore/commands/TeamchatCommand.java index d33c06f..7b34998 100644 --- a/src/de/steamwar/bungeecore/commands/TeamchatCommand.java +++ b/src/de/steamwar/bungeecore/commands/TeamchatCommand.java @@ -19,10 +19,9 @@ package de.steamwar.bungeecore.commands; -import de.steamwar.bungeecore.BungeeCore; +import de.steamwar.bungeecore.Message; import de.steamwar.bungeecore.sql.SteamwarUser; import net.md_5.bungee.api.ChatColor; -import net.md_5.bungee.api.ChatMessageType; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.connection.ProxiedPlayer; @@ -40,17 +39,16 @@ public class TeamchatCommand extends BasicCommand { SteamwarUser user = SteamwarUser.get(player.getUniqueId()); if(user.getTeam() == 0){ - BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDu bist in keinem Team"); + Message.send("TC_NO_TEAM", player); return; } if(args.length == 0){ - BungeeCore.send(player, BungeeCore.TEAMCHAT_PREFIX + "/teamchat [Nachricht an das Team]"); + Message.send("TC_SYNTAX", player); return; } StringBuilder msgBuilder = new StringBuilder(); - msgBuilder.append(BungeeCore.TEAMCHAT_PREFIX).append(sender.getName()).append("§8» §r"); for (String arg : args){ msgBuilder.append(arg).append(" "); } @@ -61,7 +59,7 @@ public class TeamchatCommand extends BasicCommand { SteamwarUser targetuser = SteamwarUser.get(target.getUniqueId()); if (targetuser.getTeam() == user.getTeam() && target.getChatMode() == ProxiedPlayer.ChatMode.SHOWN){ - BungeeCore.send(target, ChatMessageType.CHAT, msg); + Message.send("TC_FORMAT", target, player.getName(), msg); } } } diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index 9793eec..e3e6ba3 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -283,4 +283,9 @@ REGELN_WS_URL=https://steamwar.de/spielmodi/warship-regelwerk/ #ServerTeamchatCommand STC_SYNTAX=/stc [Nachricht an das Team] -STC_FORMAT=§8STC §e{0}» §r{1} \ No newline at end of file +STC_FORMAT=§8STC §e{0}» §r{1} + +#TeamchatCommand +TC_SYNTAX=/teamchat [Nachricht an das Team] +TC_NO_TEAM=§cDu bist in keinem Team +TC_FORMAT=§8TC §e{0}§8» §r{1} \ No newline at end of file