mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-11 14:05:35 +00:00
Level: Fix minor code duplication in setChunk()
This commit is contained in:
parent
8aff793a4f
commit
4ec8416f9a
@ -2400,9 +2400,6 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
$oldChunk = $this->getChunk($chunkX, $chunkZ, false);
|
$oldChunk = $this->getChunk($chunkX, $chunkZ, false);
|
||||||
if($unload and $oldChunk !== null){
|
if($unload and $oldChunk !== null){
|
||||||
$this->unloadChunk($chunkX, $chunkZ, false, false);
|
$this->unloadChunk($chunkX, $chunkZ, false, false);
|
||||||
|
|
||||||
$this->provider->setChunk($chunkX, $chunkZ, $chunk);
|
|
||||||
$this->chunks[$index] = $chunk;
|
|
||||||
}else{
|
}else{
|
||||||
$oldEntities = $oldChunk !== null ? $oldChunk->getEntities() : [];
|
$oldEntities = $oldChunk !== null ? $oldChunk->getEntities() : [];
|
||||||
$oldTiles = $oldChunk !== null ? $oldChunk->getTiles() : [];
|
$oldTiles = $oldChunk !== null ? $oldChunk->getTiles() : [];
|
||||||
@ -2418,11 +2415,11 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
$oldChunk->removeTile($tile);
|
$oldChunk->removeTile($tile);
|
||||||
$tile->chunk = $chunk;
|
$tile->chunk = $chunk;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->provider->setChunk($chunkX, $chunkZ, $chunk);
|
|
||||||
$this->chunks[$index] = $chunk;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->provider->setChunk($chunkX, $chunkZ, $chunk);
|
||||||
|
$this->chunks[$index] = $chunk;
|
||||||
|
|
||||||
unset($this->chunkCache[$index]);
|
unset($this->chunkCache[$index]);
|
||||||
$chunk->setChanged();
|
$chunk->setChanged();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user