mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 20:07:09 +00:00
Added a hack for multiworld. This is not always reliable! (#263)
This commit is contained in:
parent
cb187be1a1
commit
162b993e65
@ -662,12 +662,21 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
$level = $level === null ? $this->level : $level;
|
||||
$index = Level::chunkHash($x, $z);
|
||||
if(isset($this->usedChunks[$index])){
|
||||
foreach($level->getChunkEntities($x, $z) as $entity){
|
||||
$chunk = $level->getChunk($x, $z);
|
||||
foreach($chunk->getEntities() 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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user