Fix unnecessary and potential not thread-safe chat visibility check

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2024-05-07 21:40:57 +10:00
parent 38d4a335ea
commit 06b53d8386
2 changed files with 2 additions and 5 deletions

View File

@@ -1177,7 +1177,7 @@
public void sendPlayerChatMessage(PlayerChatMessage playerchatmessage, ChatMessageType.a chatmessagetype_a) {
+ // CraftBukkit start - SPIGOT-7262: if hidden we have to send as disguised message. Query whether we should send at all (but changing this may not be expected).
+ if (!getCraftPlayer().canSee(playerchatmessage.link().sender())) {
+ if (!getCraftPlayer().canSeePlayer(playerchatmessage.link().sender())) {
+ sendDisguisedChatMessage(playerchatmessage.decoratedContent(), chatmessagetype_a);
+ return;
+ }