From 49da990ee331d42bd84141fae60ca9ee503619c3 Mon Sep 17 00:00:00 2001 From: cexikitin Date: Wed, 26 Dec 2012 14:21:18 -0500 Subject: [PATCH] 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. --- src/main/java/net/minecraft/server/Chunk.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java index 9b6d134189..0a17734879 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -686,12 +686,10 @@ public class Chunk { java.util.Iterator 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(); } }