mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
fixed tileentities getting resetted when unloading level
This commit is contained in:
parent
8b77b88e84
commit
9d82e28297
2 changed files with 12 additions and 14 deletions
|
|
@ -225,19 +225,6 @@ class LevelAPI{
|
|||
return false;
|
||||
}
|
||||
console("[INFO] Unloading level \"" . $name . "\"");
|
||||
$level->nextSave = PHP_INT_MAX;
|
||||
$level->save();
|
||||
foreach($this->server->api->player->getAll($level) as $player){
|
||||
$player->teleport($this->server->spawn);
|
||||
}
|
||||
foreach($this->server->api->entity->getAll($level) as $entity){
|
||||
if($entity->class !== ENTITY_PLAYER){
|
||||
$entity->close();
|
||||
}
|
||||
}
|
||||
foreach($this->server->api->tile->getAll($level) as $tile){
|
||||
$tile->close();
|
||||
}
|
||||
$level->close();
|
||||
unset($this->levels[$name]);
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue