From 5098bf8282dc4595ab62ee982ac1c9eda7eeef87 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Tue, 19 Jan 2021 01:41:00 +0100 Subject: [PATCH] Add RCommand MultiLang --- .../bungeecore/commands/RCommand.java | 19 +++++++++---------- .../steamwar/messages/BungeeCore.properties | 9 ++++++++- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/RCommand.java b/src/de/steamwar/bungeecore/commands/RCommand.java index 566dbcf8..e8440f83 100644 --- a/src/de/steamwar/bungeecore/commands/RCommand.java +++ b/src/de/steamwar/bungeecore/commands/RCommand.java @@ -20,6 +20,7 @@ package de.steamwar.bungeecore.commands; import de.steamwar.bungeecore.BungeeCore; +import de.steamwar.bungeecore.Message; import de.steamwar.bungeecore.sql.IgnoreSystem; import de.steamwar.bungeecore.sql.SteamwarUser; import net.md_5.bungee.api.CommandSender; @@ -38,7 +39,7 @@ public class RCommand extends BasicCommand { if(sender instanceof ProxiedPlayer){ ProxiedPlayer player = (ProxiedPlayer) sender; if(args.length == 0){ - BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "/r [Antwort]"); + Message.send("R_SYNTAX", player); return; } @@ -50,29 +51,27 @@ public class RCommand extends BasicCommand { ProxiedPlayer target = lastChats.get(player); if(target == null){ - BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDu hast bisher mit niemandem geschrieben!"); + Message.send("R_NOTHING", player); return; }else if(!target.isConnected()){ - BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieser Spieler ist derzeit nicht online!"); + Message.send("R_OFFLINE", player); lastChats.remove(player); return; }else if (IgnoreSystem.isIgnored(target, player)) { - BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieser Spieler hat dich geblockt!"); + Message.send("R_BLOCKED", player); return; }else if(target.getChatMode() != ProxiedPlayer.ChatMode.SHOWN){ - BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieser Spieler empfängt derzeit keine Chatnachrichten!"); + Message.send("R_NO_CHAT", player); return; } StringBuilder msgBuilder = new StringBuilder(); - msgBuilder.append("§e").append(player.getName()).append("§8»§e").append(target.getName()).append(" §r§7"); for (String arg : args){ msgBuilder.append(arg).append(" "); } - String msg = msgBuilder.toString(); - BungeeCore.send(player, msg); - BungeeCore.send(target, msg); - BungeeCore.log(msg); + Message.send("MSG_FORMAT", player, player.getName(), target.getName(), msgBuilder.toString()); + Message.send("MSG_FORMAT", target, player.getName(), target.getName(), msgBuilder.toString()); + BungeeCore.log(Message.parse("MSG_FORMAT", player, player.getName(), target.getName(), msgBuilder.toString())); lastChats.put(target, player); } diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index e8c38c4a..f01e27ad 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -257,4 +257,11 @@ RANKED_QUEUE_HOW_TO_LEAVE=§7Wiederhole den Befehl zum Verlassen der Warteschlan 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 +RANKED_BROADCAST_HOVER=§aZuschauen + +#RCommand +R_SYNTAX=/r [Antwort] +R_NOTHING=§cDu hast bisher mit niemandem geschrieben! +R_OFFLINE=§cDieser Spieler ist derzeit nicht online! +R_BLOCKED=§cDieser Spieler hat dich geblockt! +R_NO_CHAT=§cDieser Spieler empfängt derzeit keine Chatnachrichten! \ No newline at end of file