geforkt von SteamWar/BungeeCore
Merge pull request 'Plus Local Chat' (#225) from plus_local_chat into master
Reviewed-on: SteamWar/BungeeCore#225 Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Commit
6b8c4ab561
@ -19,10 +19,7 @@
|
||||
|
||||
package de.steamwar.bungeecore.listeners;
|
||||
|
||||
import de.steamwar.bungeecore.BungeeCore;
|
||||
import de.steamwar.bungeecore.Message;
|
||||
import de.steamwar.bungeecore.Servertype;
|
||||
import de.steamwar.bungeecore.Subserver;
|
||||
import de.steamwar.bungeecore.*;
|
||||
import de.steamwar.bungeecore.commands.BauCommand;
|
||||
import de.steamwar.bungeecore.commands.TpCommand;
|
||||
import de.steamwar.bungeecore.comms.packets.PingPacket;
|
||||
@ -51,6 +48,8 @@ public class ChatListener extends BasicListener {
|
||||
sanitize7(e);
|
||||
if(e.getMessage().startsWith("/"))
|
||||
onCommand(e);
|
||||
else if(e.getMessage().startsWith("+"))
|
||||
onPlusMessage(e);
|
||||
else
|
||||
onChat(e);
|
||||
}
|
||||
@ -116,6 +115,20 @@ public class ChatListener extends BasicListener {
|
||||
scheduler.schedule(BungeeCore.get(), () -> Message.sendPrefixless("MSG_FORMAT", sender, "YoyoNow", sender.getDisplayName(), Message.parse("CHAT_YOYONOW_4", sender)), 12, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
private void onPlusMessage(ChatEvent e) {
|
||||
ProxiedPlayer p = (ProxiedPlayer) e.getSender();
|
||||
Subserver subserver = Subserver.getSubserver(p);
|
||||
if(subserver instanceof Bauserver) {
|
||||
String[] smolArgs = e.getMessage().substring(1).split(" ");
|
||||
String[] args = new String[smolArgs.length + 1];
|
||||
args[0] = "";
|
||||
System.arraycopy(smolArgs, 0, args, 1, smolArgs.length);
|
||||
localChat(e, args);
|
||||
} else {
|
||||
onChat(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void onChat(ChatEvent e){
|
||||
if(e.getSender() instanceof ProxiedPlayer){
|
||||
ProxiedPlayer sender = (ProxiedPlayer) e.getSender();
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren