mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
fixed block updates not being unscheduled when level is unloaded
This commit is contained in:
parent
c4b7012fe9
commit
cf25df788f
2 changed files with 29 additions and 41 deletions
|
|
@ -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(){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue