SteamWar/BungeeCore
Archiviert
13
2

Add TeamchatCommand MultiLang

Dieser Commit ist enthalten in:
Chaoscaot 2021-01-19 01:58:25 +01:00
Ursprung 0d6eecbbd4
Commit d470a56ffa
3 geänderte Dateien mit 10 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -53,7 +53,6 @@ import java.util.logging.Level;
public class BungeeCore extends Plugin { 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 final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern("dd.MM.yyyy");
public static String CHAT_PREFIX; public static String CHAT_PREFIX;

Datei anzeigen

@ -19,10 +19,9 @@
package de.steamwar.bungeecore.commands; package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.SteamwarUser;
import net.md_5.bungee.api.ChatColor; 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.CommandSender;
import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.connection.ProxiedPlayer;
@ -40,17 +39,16 @@ public class TeamchatCommand extends BasicCommand {
SteamwarUser user = SteamwarUser.get(player.getUniqueId()); SteamwarUser user = SteamwarUser.get(player.getUniqueId());
if(user.getTeam() == 0){ if(user.getTeam() == 0){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDu bist in keinem Team"); Message.send("TC_NO_TEAM", player);
return; return;
} }
if(args.length == 0){ if(args.length == 0){
BungeeCore.send(player, BungeeCore.TEAMCHAT_PREFIX + "/teamchat [Nachricht an das Team]"); Message.send("TC_SYNTAX", player);
return; return;
} }
StringBuilder msgBuilder = new StringBuilder(); StringBuilder msgBuilder = new StringBuilder();
msgBuilder.append(BungeeCore.TEAMCHAT_PREFIX).append(sender.getName()).append("§8» §r");
for (String arg : args){ for (String arg : args){
msgBuilder.append(arg).append(" "); msgBuilder.append(arg).append(" ");
} }
@ -61,7 +59,7 @@ public class TeamchatCommand extends BasicCommand {
SteamwarUser targetuser = SteamwarUser.get(target.getUniqueId()); SteamwarUser targetuser = SteamwarUser.get(target.getUniqueId());
if (targetuser.getTeam() == user.getTeam() if (targetuser.getTeam() == user.getTeam()
&& target.getChatMode() == ProxiedPlayer.ChatMode.SHOWN){ && target.getChatMode() == ProxiedPlayer.ChatMode.SHOWN){
BungeeCore.send(target, ChatMessageType.CHAT, msg); Message.send("TC_FORMAT", target, player.getName(), msg);
} }
} }
} }

Datei anzeigen

@ -284,3 +284,8 @@ REGELN_WS_URL=https://steamwar.de/spielmodi/warship-regelwerk/
#ServerTeamchatCommand #ServerTeamchatCommand
STC_SYNTAX=/stc [Nachricht an das Team] STC_SYNTAX=/stc [Nachricht an das Team]
STC_FORMAT=§8STC §e{0}» §r{1} 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}