mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-30 04:02:50 +01:00
Remove player from destroy queue when they go visible. Fixes BUKKIT-2071
If a plugin calls player.hidePlayer(other); then player.showPlayer(other); in the same tick the other player will be added to the entity destroy queue then a spawn packet will be sent. On the next tick the queue will be processed and a destroy packet will be sent that renders the other player invisible. To correct this we ensure the destroy queue is in sync with use of the vanish API.
This commit is contained in:
parent
244a39d209
commit
b5580b6d95
1 changed files with 1 additions and 0 deletions
|
@ -631,6 +631,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
EntityTracker tracker = ((WorldServer) entity.world).tracker;
|
EntityTracker tracker = ((WorldServer) entity.world).tracker;
|
||||||
EntityPlayer other = ((CraftPlayer) player).getHandle();
|
EntityPlayer other = ((CraftPlayer) player).getHandle();
|
||||||
EntityTrackerEntry entry = (EntityTrackerEntry) tracker.trackedEntities.get(other.id);
|
EntityTrackerEntry entry = (EntityTrackerEntry) tracker.trackedEntities.get(other.id);
|
||||||
|
getHandle().g.remove(Integer.valueOf(other.id)); // Should be called destroyQueue
|
||||||
if (entry != null && !entry.trackedPlayers.contains(getHandle())) {
|
if (entry != null && !entry.trackedPlayers.contains(getHandle())) {
|
||||||
entry.updatePlayer(getHandle());
|
entry.updatePlayer(getHandle());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue