geforkt von SteamWar/BungeeCore
Add JoinmeCommand MultiLang
Dieser Commit ist enthalten in:
Ursprung
0dbbea3558
Commit
85d5a76e30
@ -34,8 +34,6 @@ import java.util.ArrayList;
|
|||||||
|
|
||||||
public class JoinmeCommand extends BasicCommand {
|
public class JoinmeCommand extends BasicCommand {
|
||||||
|
|
||||||
private static final String DENY_MESSAGE = "§cDu kannst diesem Spieler derzeit nicht folgen.";
|
|
||||||
|
|
||||||
public JoinmeCommand() {
|
public JoinmeCommand() {
|
||||||
super("joinme", "");
|
super("joinme", "");
|
||||||
}
|
}
|
||||||
@ -46,17 +44,15 @@ public class JoinmeCommand extends BasicCommand {
|
|||||||
ProxiedPlayer player = (ProxiedPlayer) sender;
|
ProxiedPlayer player = (ProxiedPlayer) sender;
|
||||||
|
|
||||||
if (args.length == 0 && player.hasPermission("bungeecore.joinme")) {
|
if (args.length == 0 && player.hasPermission("bungeecore.joinme")) {
|
||||||
TextComponent tc = new TextComponent(BungeeCore.CHAT_PREFIX + "§7Klicke §ehier§8, §7um zu §e" + player.getName() + " §7auf §e" + player.getServer().getInfo().getName() + " §7zu kommen§8!");
|
Message.broadcast("JOINME_BROADCAST", true, Message.parse("JOINME_BROADCAST_HOVER", player) //TODO Needs Message Object
|
||||||
tc.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("§aSpieler folgen").create()));
|
, new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()));
|
||||||
tc.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()));
|
|
||||||
ProxyServer.getInstance().broadcast(tc);
|
|
||||||
} else if (args.length == 1) {
|
} else if (args.length == 1) {
|
||||||
ProxiedPlayer target = ProxyServer.getInstance().getPlayer(args[0]);
|
ProxiedPlayer target = ProxyServer.getInstance().getPlayer(args[0]);
|
||||||
if(target == null || !target.isConnected()){
|
if(target == null || !target.isConnected()){
|
||||||
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieser Spieler ist offline.");
|
Message.send("JOINME_PLAYER_OFFLINE", player);
|
||||||
return;
|
return;
|
||||||
}else if(target.equals(player)){
|
}else if(target.equals(player)){
|
||||||
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cSei eins mit dir selbst!");
|
Message.send("JOINME_PLAYER_SELF", player);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ServerInfo server = target.getServer().getInfo();
|
ServerInfo server = target.getServer().getInfo();
|
||||||
@ -74,18 +70,18 @@ public class JoinmeCommand extends BasicCommand {
|
|||||||
subserver.sendPlayer(player);
|
subserver.sendPlayer(player);
|
||||||
} else {
|
} else {
|
||||||
SubserverSystem.sendDeniedMessage(player, bauserver.getOwner());
|
SubserverSystem.sendDeniedMessage(player, bauserver.getOwner());
|
||||||
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + DENY_MESSAGE);
|
Message.send("JOIN_PLAYER_BLOCK", player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else if(serverPerm != null && !player.hasPermission(serverPerm)){
|
}else if(serverPerm != null && !player.hasPermission(serverPerm)){
|
||||||
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + DENY_MESSAGE);
|
Message.send("JOIN_PLAYER_BLOCK", player);
|
||||||
}else if(serverPerm == null && !player.getGroups().contains("team")) {
|
}else if(serverPerm == null && !player.getGroups().contains("team")) {
|
||||||
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + DENY_MESSAGE);
|
Message.send("JOIN_PLAYER_BLOCK", player);
|
||||||
}else{
|
}else{
|
||||||
player.connect(server);
|
player.connect(server);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§7Mit §8/§ejoin §8[§eSpieler§8] §7kannst du einem Spieler folgen §8(z.B. in eine Arena)§7.");
|
Message.send("JOINME_SYNTAX", player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ SPACER=
|
|||||||
UNKNOWN_COMMAND=§cUnbekannter Befehl.
|
UNKNOWN_COMMAND=§cUnbekannter Befehl.
|
||||||
UNKNOWN_PLAYER=§cDiesen Spieler gibt es nicht.
|
UNKNOWN_PLAYER=§cDiesen Spieler gibt es nicht.
|
||||||
INVALID_TIME=§cUngültige Zeitangabe.
|
INVALID_TIME=§cUngültige Zeitangabe.
|
||||||
|
JOIN_PLAYER_BLOCK=§cDu kannst diesem Spieler derzeit nicht folgen.
|
||||||
|
|
||||||
#ModLoader blocker
|
#ModLoader blocker
|
||||||
MODLOADER_INSTALLED=§7Du hast §e{0} §7installiert. Daher kannst du keinen Arenen beitreten.
|
MODLOADER_INSTALLED=§7Du hast §e{0} §7installiert. Daher kannst du keinen Arenen beitreten.
|
||||||
@ -213,3 +214,10 @@ CHECK_DECLINED_TEAM=§7Die Schematic §e{0} §7von §e{1} §awurde aufgrund von
|
|||||||
#HistoricCommand
|
#HistoricCommand
|
||||||
HISTORIC_BROADCAST=§7Historischer §e{0}§8-§7Kampf von §e{1}§8!
|
HISTORIC_BROADCAST=§7Historischer §e{0}§8-§7Kampf von §e{1}§8!
|
||||||
HISTORIC_BROADCAST_HOVER=§aGegen §7{0} §ekämpfen
|
HISTORIC_BROADCAST_HOVER=§aGegen §7{0} §ekämpfen
|
||||||
|
|
||||||
|
#JoinmeCommand
|
||||||
|
JOINME_SYNTAX=§7Mit §8/§ejoin §8[§eSpieler§8] §7kannst du einem Spieler folgen §8(z.B. in eine Arena)§7.
|
||||||
|
JOINME_BROADCAST=§7Klicke §ehier§8, §7um zu §e" + player.getName() + " §7auf §e" + player.getServer().getInfo().getName() + " §7zu kommen§8!
|
||||||
|
JOINME_BROADCAST_HOVER=§aSpieler folgen
|
||||||
|
JOINME_PLAYER_OFFLINE=§cDieser Spieler ist offline.
|
||||||
|
JOINME_PLAYER_SELF=§cSei eins mit dir selbst!
|
In neuem Issue referenzieren
Einen Benutzer sperren