Fixed chunk unloading on same level

This commit is contained in:
Shoghi Cervantes 2014-06-15 00:03:35 +02:00
parent 6977833b1a
commit 6f36e9af24

View File

@ -653,10 +653,10 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
foreach($lastChunk as $index => $Yndex){ foreach($lastChunk as $index => $Yndex){
if($Yndex === 0){
$X = null; $X = null;
$Z = null; $Z = null;
Level::getXZ($index, $X, $Z); Level::getXZ($index, $X, $Z);
if($Yndex === 0){
foreach($this->getLevel()->getChunkEntities($X, $Z) as $entity){ foreach($this->getLevel()->getChunkEntities($X, $Z) as $entity){
if($entity !== $this){ if($entity !== $this){
$entity->despawnFrom($this); $entity->despawnFrom($this);