pathfinder rewrite

This commit is contained in:
GameHerobrine 2024-04-14 04:20:14 +03:00
parent cb0fa06e12
commit 22f3c3f640
16 changed files with 89 additions and 263 deletions

View file

@ -18,9 +18,11 @@ class PathFollower{
if($this->entity->currentNode == null){
$this->entity->currentNode = $this->entity->path[$this->entity->currentIndex];
}
$this->entity->ai->mobController->setMovingTarget($this->entity->currentNode->x + 0.5, $this->entity->currentNode->y, $this->entity->currentNode->z + 0.5, 1.0);
if($this->entity->boundingBox->isXYZInsideNS($this->entity->currentNode->x + 0.5, $this->entity->currentNode->y, $this->entity->currentNode->z + 0.5)){
$moveX = ($this->entity->currentNode >> 16 & 0xff) + 0.5;
$moveY = $this->entity->currentNode & 0xff;
$moveZ = ($this->entity->currentNode >> 8 & 0xff) + 0.5;
$this->entity->ai->mobController->setMovingTarget($moveX + 0.5, $moveY, $moveZ + 0.5, 1.0);
if($this->entity->boundingBox->isXYZInsideNS($moveX + 0.5, $moveY, $moveZ + 0.5)){
++$this->entity->currentIndex;
console("next");
$this->entity->currentNode = null;