From 506a1a0765b34574bef661f622fd0ab654cea8fb Mon Sep 17 00:00:00 2001 From: Travis Watkins Date: Sat, 13 Oct 2012 15:27:45 -0500 Subject: Ensure entity isn't destroyed when trying to show it. Fixes BUKKIT-2038 If two players (or a player and any other entity) are teleported to the same location in the same tick they will both get added to the other's destroy queue then have a new entity spawn packet sent. Next tick the destroy queue will be processed and they will then be invisible to each other. To prevent this situation we remove the entity from the destroy queue when sending out a spawn packet for them. --- src/main/java/net/minecraft/server/EntityTrackerEntry.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main/java/net') diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java index c504d35f..d735e8e0 100644 --- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java +++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java @@ -234,12 +234,14 @@ public class EntityTrackerEntry { if (d0 >= (double) (-this.b) && d0 <= (double) this.b && d1 >= (double) (-this.b) && d1 <= (double) this.b) { if (!this.trackedPlayers.contains(entityplayer) && this.d(entityplayer)) { // CraftBukkit start - if (tracker instanceof EntityPlayer) { - Player player = ((EntityPlayer) tracker).getBukkitEntity(); + if (this.tracker instanceof EntityPlayer) { + Player player = ((EntityPlayer) this.tracker).getBukkitEntity(); if (!entityplayer.getBukkitEntity().canSee(player)) { return; } } + + entityplayer.g.remove(Integer.valueOf(this.tracker.id)); // Should be called destroyQueue // CraftBukkit end this.trackedPlayers.add(entityplayer); Packet packet = this.b(); -- cgit v1.2.3