mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-23 16:51:35 +01:00
SPIGOT-7312: Entity#setVisibleByDefault on player causes skin reset on this player client
By: md_5 <git@md-5.net>
This commit is contained in:
parent
abc47f4655
commit
c8d32f6ca3
@ -1340,6 +1340,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void resetAndHideEntity(org.bukkit.entity.Entity entity) {
|
void resetAndHideEntity(org.bukkit.entity.Entity entity) {
|
||||||
|
// SPIGOT-7312: Can't show/hide self
|
||||||
|
if (equals(entity)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (invertedVisibilityEntities.remove(entity.getUniqueId()) == null) {
|
if (invertedVisibilityEntities.remove(entity.getUniqueId()) == null) {
|
||||||
untrackAndHideEntity(entity);
|
untrackAndHideEntity(entity);
|
||||||
}
|
}
|
||||||
@ -1413,6 +1418,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void resetAndShowEntity(org.bukkit.entity.Entity entity) {
|
void resetAndShowEntity(org.bukkit.entity.Entity entity) {
|
||||||
|
// SPIGOT-7312: Can't show/hide self
|
||||||
|
if (equals(entity)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (invertedVisibilityEntities.remove(entity.getUniqueId()) == null) {
|
if (invertedVisibilityEntities.remove(entity.getUniqueId()) == null) {
|
||||||
trackAndShowEntity(entity);
|
trackAndShowEntity(entity);
|
||||||
}
|
}
|
||||||
@ -1429,7 +1439,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canSee(org.bukkit.entity.Entity entity) {
|
public boolean canSee(org.bukkit.entity.Entity entity) {
|
||||||
return entity.isVisibleByDefault() ^ invertedVisibilityEntities.containsKey(entity.getUniqueId());
|
return equals(entity) || entity.isVisibleByDefault() ^ invertedVisibilityEntities.containsKey(entity.getUniqueId()); // SPIGOT-7312: Can always see self
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canSee(UUID uuid) {
|
public boolean canSee(UUID uuid) {
|
||||||
|
Loading…
Reference in New Issue
Block a user