mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-24 13:39:44 +00:00
LevelImport warns fix, time phase for spawn mob fixed
This commit is contained in:
parent
7853a14458
commit
157f794c7f
2 changed files with 10 additions and 10 deletions
|
|
@ -86,13 +86,13 @@ class LevelImport{
|
||||||
}
|
}
|
||||||
$chunks->map = null;
|
$chunks->map = null;
|
||||||
$chunks = null;
|
$chunks = null;
|
||||||
@unlink($this->path . "level.dat");
|
if(file_exists$this->path . "level.dat") @unlink($this->path . "level.dat");
|
||||||
@unlink($this->path . "level.dat_old");
|
if(file_exists$this->path . "level.dat_old") @unlink($this->path . "level.dat_old");
|
||||||
@unlink($this->path . "player.dat");
|
if(file_exists$this->path . "player.dat") @unlink($this->path . "player.dat");
|
||||||
@unlink($this->path . "entities.dat");
|
if(file_exists$this->path . "entities.dat") @unlink($this->path . "entities.dat");
|
||||||
@unlink($this->path . "chunks.dat");
|
if(file_exists$this->path . "chunks.dat") @unlink($this->path . "chunks.dat");
|
||||||
@unlink($this->path . "chunks.dat.gz");
|
if(file_exists$this->path . "chunks.dat.gz") @unlink($this->path . "chunks.dat.gz");
|
||||||
@unlink($this->path . "tiles.dat");
|
if(file_exists$this->path . "tiles.dat") @unlink($this->path . "tiles.dat");
|
||||||
unset($chunks, $level, $entities, $tiles, $nbt);
|
unset($chunks, $level, $entities, $tiles, $nbt);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,12 +26,12 @@ class MobSpawner{
|
||||||
}
|
}
|
||||||
|
|
||||||
public function spawnMobs(){
|
public function spawnMobs(){
|
||||||
|
$phase = $this->server->api->time->getPhase($this->level);
|
||||||
if(self::$spawnAnimals && $this->level->isDay()){ //Animal
|
if(self::$spawnAnimals && $phase == "day"){ //Animal
|
||||||
$type = mt_rand(10, 13);
|
$type = mt_rand(10, 13);
|
||||||
$baby = false; //TODO baby
|
$baby = false; //TODO baby
|
||||||
$grassOnly = true;
|
$grassOnly = true;
|
||||||
}elseif(self::$spawnMobs && $this->level->isNight()){ //Monster
|
}elseif(self::$spawnMobs && $phase == "night"){ //Monster, true night
|
||||||
$type = mt_rand(32, 35);
|
$type = mt_rand(32, 35);
|
||||||
$grassOnly = false;
|
$grassOnly = false;
|
||||||
$baby = 2;
|
$baby = 2;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue