mob fixes related to time and headYaw

This commit is contained in:
GameHerobrine 2023-01-11 11:53:04 +03:00
parent 0a36a67f78
commit 21d0530d39
9 changed files with 35 additions and 27 deletions

View file

@ -81,6 +81,13 @@ class Level{
unset($this->mobSpawner->level);
}
public function isDay(){
return $this->getTime() % 19200 < TimeAPI::$phases["sunset"];
}
public function isNight(){
$t = $this->getTime() % 19200;
return $t < TimeAPI::$phases["sunrise"] && $t > TimeAPI::$phases["sunset"];
}
public function save($force = false, $extra = true){
if(!isset($this->level)){
return false;