Never remove players when unloading chunks. Fixes BUKKIT-3129

When unloading chunks we have a check to ensure we do not remove players
from the world due to the issues this would cause. However, our check
to see if the player is in this chunk is reversed and is in fact entirely
wrong. Even if the player isn't currently in this chunk we do not want
to remove them as that will still cause the same issues.
This commit is contained in:
cexikitin 2012-12-26 14:21:18 -05:00 committed by Travis Watkins
parent 3a0c5aff0c
commit 49da990ee3

View File

@ -686,12 +686,10 @@ public class Chunk {
java.util.Iterator<Object> iter = this.entitySlices[i].iterator();
while (iter.hasNext()) {
Entity entity = (Entity) iter.next();
int cx = Location.locToBlock(entity.locX) >> 4;
int cz = Location.locToBlock(entity.locZ) >> 4;
// Do not pass along players, as doing so can get them stuck outside of time.
// (which for example disables inventory icon updates and prevents block breaking)
if (entity instanceof EntityPlayer && (cx != this.x || cz != this.z)) {
if (entity instanceof EntityPlayer) {
iter.remove();
}
}