fixed block updates not being unscheduled when level is unloaded

This commit is contained in:
GameHerobrine 2025-05-12 06:22:43 +03:00
parent c4b7012fe9
commit cf25df788f
2 changed files with 29 additions and 41 deletions

View file

@ -70,7 +70,13 @@ class Level{
}
public function close(){
$this->__destruct();
if(isset($this->level)){
$this->save(true, true, true, true);
$this->level->close();
unset($this->level);
$this->server->api->block->removeAllBlockUpdates($this);
}
unset($this->mobSpawner->level);
}
public function isTopSolidBlocking($x, $y, $z){
@ -269,12 +275,7 @@ class Level{
}
public function __destruct(){
if(isset($this->level)){
$this->save(false, false, false, false);
$this->level->close();
unset($this->level);
}
unset($this->mobSpawner->level);
$this->close();
}
public function isDay(){