better autojump for mobs

This commit is contained in:
GameHerobrine 2025-05-09 15:00:31 +03:00
parent 38ee5daed2
commit aef063c878
2 changed files with 3 additions and 3 deletions

View file

@ -53,9 +53,7 @@ class ConsoleAPI{
if(!defined("NO_THREADS")){
self::$loop->stop();
self::$loop->notify();
//@fclose($this->loop->fp);
usleep(50000);
//$this->loop->join();
}
}

View file

@ -107,7 +107,9 @@ class MobController
$this->entity->yaw = self::limitAngle($this->entity->yaw, $v10, 30);
$this->entity->setAIMoveSpeed($this->speedMultiplier * $this->entity->getSpeed() * $this->entity->getSpeedModifer());
if($diffY > 0 && $diffX*$diffX + $diffZ*$diffZ < 1) $this->setJumping(true);
if($diffY > 0 && $diffX*$diffX + $diffZ*$diffZ < 1 && $this->entity->isCollidedHorizontally){
$this->setJumping(true);
}
}
}
//TODO handle jumps somewhere