mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-08-30 06:55:11 +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{
|
class CommandReader extends Thread{
|
||||||
|
|
||||||
private $stream;
|
public $stream;
|
||||||
/** @var resource */
|
/** @var resource */
|
||||||
private $fp;
|
private $fp;
|
||||||
private $readline;
|
private $readline;
|
||||||
|
@ -190,9 +190,9 @@ class McRegion extends BaseLevelProvider{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function unloadChunk($x, $z, $safe = true){
|
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)){
|
if($chunk instanceof FullChunk and $chunk->unload(false, $safe)){
|
||||||
unset($this->chunks[Level::chunkHash($x, $z)]);
|
unset($this->chunks[$index]);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user