Fix unnecessary and potential not thread-safe chat visibility check
By: md_5 <git@md-5.net>
This commit is contained in:
@@ -1657,11 +1657,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
return equals(entity) || entity.isVisibleByDefault() ^ invertedVisibilityEntities.containsKey(entity.getUniqueId()); // SPIGOT-7312: Can always see self
|
||||
}
|
||||
|
||||
public boolean canSee(UUID uuid) {
|
||||
public boolean canSeePlayer(UUID uuid) {
|
||||
org.bukkit.entity.Entity entity = getServer().getPlayer(uuid);
|
||||
if (entity == null) {
|
||||
entity = getServer().getEntity(uuid); // Also includes players, but check players first for efficiency
|
||||
}
|
||||
|
||||
return (entity != null) ? canSee(entity) : false; // If we can't find it, we can't see it
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user