geforkt von SteamWar/BungeeCore
Add MsgCommand MultiLang
Dieser Commit ist enthalten in:
Ursprung
67fb884bc1
Commit
417902f49d
@ -20,6 +20,7 @@
|
|||||||
package de.steamwar.bungeecore.commands;
|
package de.steamwar.bungeecore.commands;
|
||||||
|
|
||||||
import de.steamwar.bungeecore.BungeeCore;
|
import de.steamwar.bungeecore.BungeeCore;
|
||||||
|
import de.steamwar.bungeecore.Message;
|
||||||
import de.steamwar.bungeecore.sql.IgnoreSystem;
|
import de.steamwar.bungeecore.sql.IgnoreSystem;
|
||||||
import de.steamwar.bungeecore.sql.SteamwarUser;
|
import de.steamwar.bungeecore.sql.SteamwarUser;
|
||||||
import net.md_5.bungee.api.CommandSender;
|
import net.md_5.bungee.api.CommandSender;
|
||||||
@ -42,7 +43,7 @@ public class MsgCommand extends BasicCommand {
|
|||||||
ProxiedPlayer player = (ProxiedPlayer) sender;
|
ProxiedPlayer player = (ProxiedPlayer) sender;
|
||||||
|
|
||||||
if (args.length < 2) {
|
if (args.length < 2) {
|
||||||
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "/msg [Benutzer] [Nachricht]");
|
Message.send("MSG_SYNTAX", player);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,28 +55,26 @@ public class MsgCommand extends BasicCommand {
|
|||||||
|
|
||||||
ProxiedPlayer target = ProxyServer.getInstance().getPlayer(args[0]);
|
ProxiedPlayer target = ProxyServer.getInstance().getPlayer(args[0]);
|
||||||
if(target == null){
|
if(target == null){
|
||||||
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieser Spieler ist derzeit nicht online!");
|
Message.send("MSG_OFFLINE", player);
|
||||||
return;
|
return;
|
||||||
}else if (IgnoreSystem.isIgnored(target, player)) {
|
}else if (IgnoreSystem.isIgnored(target, player)) {
|
||||||
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieser Spieler hat dich geblockt!");
|
Message.send("MSG_IGNORED", player);
|
||||||
return;
|
return;
|
||||||
}else if(target.getChatMode() != ProxiedPlayer.ChatMode.SHOWN){
|
}else if(target.getChatMode() != ProxiedPlayer.ChatMode.SHOWN){
|
||||||
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieser Spieler empfängt derzeit keine Chatnachrichten!");
|
Message.send("MSG_NOMESSAGE", player);
|
||||||
return;
|
return;
|
||||||
}else if(target.equals(player)){
|
}else if(target.equals(player)){
|
||||||
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cNachrichten an dich selbst hast du wirklich nicht nötig!");
|
Message.send("MSG_SELF", player);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder msgBuilder = new StringBuilder();
|
StringBuilder msgBuilder = new StringBuilder();
|
||||||
msgBuilder.append("§e").append(player.getName()).append("§8»§e").append(target.getName()).append(" §r§7");
|
|
||||||
for (int i = 1; i < args.length; i++){
|
for (int i = 1; i < args.length; i++){
|
||||||
msgBuilder.append(args[i]).append(" ");
|
msgBuilder.append(args[i]).append(" ");
|
||||||
}
|
}
|
||||||
String msg = msgBuilder.toString();
|
Message.send("MSG_FORMAT", player, player.getName(), target.getName(), msgBuilder.toString());
|
||||||
BungeeCore.send(player, msg);
|
Message.send("MSG_FORMAT", target, player.getName(), target.getName(), msgBuilder.toString());
|
||||||
BungeeCore.send(target, msg);
|
BungeeCore.log(Message.parse("MSG_FORMAT", player, player.getName(), target.getName(), msgBuilder.toString()));
|
||||||
BungeeCore.log(msg);
|
|
||||||
|
|
||||||
lastChats.put(player, target);
|
lastChats.put(player, target);
|
||||||
lastChats.put(target, player);
|
lastChats.put(target, player);
|
||||||
|
@ -227,3 +227,11 @@ KICK_SYNTAX=/kick [Spieler] [Nachricht]
|
|||||||
KICK_OFFLINE=§cDieser Spieler ist derzeit nicht online!
|
KICK_OFFLINE=§cDieser Spieler ist derzeit nicht online!
|
||||||
KICK_CONFIRM=Der Spieler {0} wurde gekickt.
|
KICK_CONFIRM=Der Spieler {0} wurde gekickt.
|
||||||
KICK_NORMAL=§cDu wurdest gekickt.
|
KICK_NORMAL=§cDu wurdest gekickt.
|
||||||
|
|
||||||
|
#MsgCommand
|
||||||
|
MSG_SYNTAX=/msg [Benutzer] [Nachricht]
|
||||||
|
MSG_OFFLINE=§cDieser Spieler ist derzeit nicht online!
|
||||||
|
MSG_IGNORED=§cDieser Spieler hat dich geblockt!
|
||||||
|
MSG_NOMESSAGE=§cDieser Spieler empfängt derzeit keine Chatnachrichten!
|
||||||
|
MSG_SELF=§cNachrichten an dich selbst hast du wirklich nicht nötig!
|
||||||
|
MSG_FORMAT=§e{0}§8»§e{1} §r§7{2}
|
In neuem Issue referenzieren
Einen Benutzer sperren