Revert multi-world hack (client issue fixed in 1.0.4.0), close #260

This reverts commit 162b993e65f2e15b25d1997af3b0e77db2bc2de7.
This commit is contained in:
Dylan K. Taylor 2017-02-14 10:00:29 +00:00
parent e31333edd4
commit 7e1bdd474a

View File

@ -696,21 +696,12 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
$level = $level === null ? $this->level : $level;
$index = Level::chunkHash($x, $z);
if(isset($this->usedChunks[$index])){
$chunk = $level->getChunk($x, $z);
foreach($chunk->getEntities() as $entity){
foreach($level->getChunkEntities($x, $z) as $entity){
if($entity !== $this){
$entity->despawnFrom($this);
}
}
if($level !== $this->level){
$pk = new FullChunkDataPacket();
$pk->chunkX = $x;
$pk->chunkZ = $z;
$pk->data = chr($chunk->getSubChunkSendCount());
$this->dataPacket($pk);
}
unset($this->usedChunks[$index]);
}
$level->unregisterChunkLoader($this, $x, $z);