mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 00:07:30 +00:00
Faster Level provider chunk unloading
This commit is contained in:
parent
68da4b5b39
commit
9e3d432b9e
@ -25,7 +25,7 @@ use pocketmine\Thread;
|
||||
|
||||
class CommandReader extends Thread{
|
||||
|
||||
private $stream;
|
||||
public $stream;
|
||||
/** @var resource */
|
||||
private $fp;
|
||||
private $readline;
|
||||
|
@ -190,9 +190,9 @@ class McRegion extends BaseLevelProvider{
|
||||
}
|
||||
|
||||
public function unloadChunk($x, $z, $safe = true){
|
||||
$chunk = $this->getChunk($x, $z, false);
|
||||
$chunk = isset($this->chunks[$index = Level::chunkHash($x, $z)]) ? $this->chunks[$index] : null;
|
||||
if($chunk instanceof FullChunk and $chunk->unload(false, $safe)){
|
||||
unset($this->chunks[Level::chunkHash($x, $z)]);
|
||||
unset($this->chunks[$index]);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user