Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 20:40:08 +01:00
Follow vanilla settings behavior. Fixes BUKKIT-5069
A vanilla server does a series of checks for the client black-listing certain chat types (commands or chat). This change changes a CB whitelist to the vanilla blacklist behavior.
Dieser Commit ist enthalten in:
Ursprung
dc86362c9a
Commit
70747ca28b
@ -758,7 +758,7 @@ public class PlayerConnection implements PacketPlayInListener {
|
||||
}
|
||||
|
||||
public void a(PacketPlayInChat packetplayinchat) {
|
||||
if (this.player.getChatFlags() == EnumChatVisibility.HIDDEN) {
|
||||
if (this.player.dead || this.player.getChatFlags() == EnumChatVisibility.HIDDEN) { // CraftBukkit - dead men tell no tales
|
||||
ChatMessage chatmessage = new ChatMessage("chat.cannotSend", new Object[0]);
|
||||
|
||||
chatmessage.b().setColor(EnumChatFormat.RED);
|
||||
@ -835,14 +835,13 @@ public class PlayerConnection implements PacketPlayInListener {
|
||||
|
||||
// CraftBukkit start
|
||||
public void chat(String s, boolean async) {
|
||||
if (s.isEmpty()) {
|
||||
if (s.isEmpty() || this.player.getChatFlags() == EnumChatVisibility.HIDDEN) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.player.dead) {
|
||||
if (s.startsWith("/")) {
|
||||
this.handleCommand(s);
|
||||
} else if (this.player.getChatFlags() != EnumChatVisibility.FULL) {
|
||||
} else if (this.player.getChatFlags() == EnumChatVisibility.SYSTEM) {
|
||||
// Do nothing, this is coming from a plugin
|
||||
} else {
|
||||
Player player = this.getPlayer();
|
||||
@ -906,7 +905,6 @@ public class PlayerConnection implements PacketPlayInListener {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
private void handleCommand(String s) {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren