Add Color codes to local chat #518
@ -130,7 +130,7 @@ public class FightCommand extends SWCommand {
|
||||
public void fight(@Validator("arenaPlayer") PlayerChatter sender, @Mapper("nonHistoricArenaMode") @OptionalValue("") @AllowNull ArenaMode arenaMode, @Mapper("arenaMap") @OptionalValue("") @AllowNull String map) {
|
||||
createArena(sender, "/fight ", true, arenaMode, map, false,
|
||||
(p, mode, m) -> new ServerStarter().arena(mode, m).blueLeader(p.getPlayer()).callback(
|
||||
arena -> Chatter.broadcast().system("FIGHT_BROADCAST", new Message("FIGHT_BROADCAST_HOVER"), ClickEvent.runCommand("/arena " + arena.getServer().getName()), mode.getGameName(), p.getPlayer().getUsername())
|
||||
arena -> Chatter.broadcast().system("FIGHT_BROADCAST", new Message("FIGHT_BROADCAST_HOVER", p.getPlayer().getUsername()), ClickEvent.runCommand("/arena " + arena.getServer().getName()), mode.getGameName(), p.getPlayer().getUsername())
|
||||
).start()
|
||||
);
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ package de.steamwar.velocitycore.commands;
|
||||
|
||||
import de.steamwar.command.SWCommand;
|
||||
import de.steamwar.messages.Chatter;
|
||||
import de.steamwar.messages.Message;
|
||||
import de.steamwar.messages.PlayerChatter;
|
||||
import de.steamwar.sql.UserPerm;
|
||||
import net.kyori.adventure.text.event.ClickEvent;
|
||||
@ -33,6 +34,6 @@ public class JoinmeCommand extends SWCommand {
|
||||
|
||||
@Register
|
||||
public void genericCommand(PlayerChatter sender) {
|
||||
Chatter.broadcast().system("JOINME_BROADCAST", "JOINME_BROADCAST_HOVER", ClickEvent.runCommand("/join " + sender.getPlayer().getUsername()), sender, sender.getPlayer().getCurrentServer().orElseThrow().getServerInfo().getName());
|
||||
Chatter.broadcast().system("JOINME_BROADCAST", new Message("JOINME_BROADCAST_HOVER"), ClickEvent.runCommand("/join " + sender.getPlayer().getUsername()), sender, sender.getPlayer().getCurrentServer().orElseThrow().getServerInfo().getName());
|
||||
}
|
||||
}
|
||||
|
@ -169,10 +169,11 @@ public class ChatListener extends BasicListener {
|
||||
if(ChatListener.filteredCommand(sender, message))
|
||||
return;
|
||||
|
||||
if(!message.startsWith("/") && chatFilter(sender, message))
|
||||
final String coloredMessage = sender.user().hasPerm(UserPerm.COLOR_CHAT) ? message.replace('&', '§') : message;
|
||||
if(!message.startsWith("/") && chatFilter(sender, coloredMessage))
|
||||
return;
|
||||
|
||||
sender.getPlayer().spoofChatInput(message);
|
||||
sender.getPlayer().spoofChatInput(coloredMessage);
|
||||
|
||||
}
|
||||
|
||||
private static boolean chatFilter(Chatter sender, String message) {
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
Das muss vor dem mergen einmal getestet werden, ich halte es für sehr wahrscheinlich, dass der Spieler hierbei einfach vom Subserver gekickt wird.
Stimmt gar nicht dran gedacht. Da hast du recht. Wie sollen wir das dann machen?