LocalChat
Dieser Commit ist enthalten in:
Ursprung
e0d4314d9e
Commit
303f50d0ab
@ -170,6 +170,16 @@ public class PlayerListener implements Listener {
|
|||||||
ChallengeCommand.challenges.remove(e.getPlayer());
|
ChallengeCommand.challenges.remove(e.getPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void localChat(ChatEvent e, String [] command){
|
||||||
|
System.out.println(((ProxiedPlayer) e.getSender()).getDisplayName() + ": " + e.getMessage());
|
||||||
|
if(command.length == 1){
|
||||||
|
((ProxiedPlayer) e.getSender()).sendMessage(BungeeCore.ChatPrefix + "§8/§e" + command[0].substring(1) + " §8[§7Nachricht§8]");
|
||||||
|
e.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
e.setMessage(e.getMessage().substring(command[0].length() + 1));
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onChatEvent(ChatEvent e){
|
public void onChatEvent(ChatEvent e){
|
||||||
if(e.getMessage().startsWith("/")){
|
if(e.getMessage().startsWith("/")){
|
||||||
@ -181,7 +191,10 @@ public class PlayerListener implements Listener {
|
|||||||
sender.sendMessage(BungeeCore.ChatPrefix + "§cUnbekannter Befehl.");
|
sender.sendMessage(BungeeCore.ChatPrefix + "§cUnbekannter Befehl.");
|
||||||
}
|
}
|
||||||
}else if((command[0].equalsIgnoreCase("/bau") || command[0].equalsIgnoreCase("/b")) && e.getSender() instanceof ProxiedPlayer){
|
}else if((command[0].equalsIgnoreCase("/bau") || command[0].equalsIgnoreCase("/b")) && e.getSender() instanceof ProxiedPlayer){
|
||||||
|
System.out.println(((ProxiedPlayer) e.getSender()).getDisplayName() + ": " + e.getMessage());
|
||||||
BauCommand.onBau(e, command);
|
BauCommand.onBau(e, command);
|
||||||
|
}else if(command[0].equalsIgnoreCase("/bc") || command[0].equalsIgnoreCase("/bauchat") || command[0].equalsIgnoreCase("/local")){
|
||||||
|
localChat(e, command);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if(e.getSender() instanceof ProxiedPlayer){
|
if(e.getSender() instanceof ProxiedPlayer){
|
||||||
|
@ -8,7 +8,7 @@ import net.md_5.bungee.api.ProxyServer;
|
|||||||
public class AlertCommand extends Command {
|
public class AlertCommand extends Command {
|
||||||
|
|
||||||
public AlertCommand() {
|
public AlertCommand() {
|
||||||
super("bc", "bungeecore.alert", "alert");
|
super("alert", "bungeecore.alert", "broadcast", "bbc");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -50,6 +50,11 @@ public class HelpCommand extends Command {
|
|||||||
tc.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("§eSpieler beitreten").create()));
|
tc.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("§eSpieler beitreten").create()));
|
||||||
tc.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/join"));
|
tc.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/join"));
|
||||||
sender.sendMessage(tc);
|
sender.sendMessage(tc);
|
||||||
|
|
||||||
|
tc = new TextComponent(BungeeCore.ChatPrefix + "§7Schreibe mit §8/§elocal §7nur auf dem lokalen Server!");
|
||||||
|
tc.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("§eLokaler Chat").create()));
|
||||||
|
tc.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/local"));
|
||||||
|
sender.sendMessage(tc);
|
||||||
}else if(args[0].equalsIgnoreCase("bauserver")){
|
}else if(args[0].equalsIgnoreCase("bauserver")){
|
||||||
sendBauHelp((ProxiedPlayer) sender);
|
sendBauHelp((ProxiedPlayer) sender);
|
||||||
}else if(args[0].equalsIgnoreCase("bau")){
|
}else if(args[0].equalsIgnoreCase("bau")){
|
||||||
|
@ -25,6 +25,7 @@ public class TeamCommand extends Command {
|
|||||||
sender.sendMessage(BungeeCore.ChatPrefix + "§7Mit §e/team §7verwaltest du dein Team");
|
sender.sendMessage(BungeeCore.ChatPrefix + "§7Mit §e/team §7verwaltest du dein Team");
|
||||||
sender.sendMessage(BungeeCore.ChatPrefix + "§8/§eteam create §8- §7Erstelle dein eigenes Team");
|
sender.sendMessage(BungeeCore.ChatPrefix + "§8/§eteam create §8- §7Erstelle dein eigenes Team");
|
||||||
sender.sendMessage(BungeeCore.ChatPrefix + "§8/§eteam join §8- §7Trete einem Team bei");
|
sender.sendMessage(BungeeCore.ChatPrefix + "§8/§eteam join §8- §7Trete einem Team bei");
|
||||||
|
sender.sendMessage(BungeeCore.ChatPrefix + "§8/§eteamchat §8- §7Sende Nachrichten an dein Team");
|
||||||
sender.sendMessage(BungeeCore.ChatPrefix + "§8/§eteam leave §8- §7Verlasse dein Team");
|
sender.sendMessage(BungeeCore.ChatPrefix + "§8/§eteam leave §8- §7Verlasse dein Team");
|
||||||
sender.sendMessage(BungeeCore.ChatPrefix + "§8/§eteam list §8- §7Liste alle Teams auf");
|
sender.sendMessage(BungeeCore.ChatPrefix + "§8/§eteam list §8- §7Liste alle Teams auf");
|
||||||
sender.sendMessage(BungeeCore.ChatPrefix + "§8/§eteam info §8- §7Informiere dich über ein Team");
|
sender.sendMessage(BungeeCore.ChatPrefix + "§8/§eteam info §8- §7Informiere dich über ein Team");
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren