Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 20:40:08 +01:00
Handle chat packets correctly
Dieser Commit ist enthalten in:
Ursprung
65a6e97785
Commit
730a62c96a
@ -810,8 +810,8 @@ public class PlayerConnection implements PacketPlayInListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s.startsWith("/")) {
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
|
if (!packetplayinchat.a()) {
|
||||||
try {
|
try {
|
||||||
this.minecraftServer.server.playerCommandState = true;
|
this.minecraftServer.server.playerCommandState = true;
|
||||||
this.handleCommand(s);
|
this.handleCommand(s);
|
||||||
@ -828,7 +828,7 @@ public class PlayerConnection implements PacketPlayInListener {
|
|||||||
chatmessage.getChatModifier().setColor(EnumChatFormat.RED);
|
chatmessage.getChatModifier().setColor(EnumChatFormat.RED);
|
||||||
this.sendPacket(new PacketPlayOutChat(chatmessage));
|
this.sendPacket(new PacketPlayOutChat(chatmessage));
|
||||||
} else if (true) {
|
} else if (true) {
|
||||||
this.chat(s, packetplayinchat.a());
|
this.chat(s, true);
|
||||||
// CraftBukkit end - the below is for reference. :)
|
// CraftBukkit end - the below is for reference. :)
|
||||||
} else {
|
} else {
|
||||||
ChatMessage chatmessage1 = new ChatMessage("chat.type.text", new Object[] { this.player.getScoreboardDisplayName(), s});
|
ChatMessage chatmessage1 = new ChatMessage("chat.type.text", new Object[] { this.player.getScoreboardDisplayName(), s});
|
||||||
@ -871,7 +871,7 @@ public class PlayerConnection implements PacketPlayInListener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s.startsWith("/")) {
|
if (!async && s.startsWith("/")) {
|
||||||
this.handleCommand(s);
|
this.handleCommand(s);
|
||||||
} else if (this.player.getChatFlags() == EnumChatVisibility.SYSTEM) {
|
} else if (this.player.getChatFlags() == EnumChatVisibility.SYSTEM) {
|
||||||
// Do nothing, this is coming from a plugin
|
// Do nothing, this is coming from a plugin
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren