mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
pathfinder will create path to closest node to target if no direct path is found
This commit is contained in:
parent
22f3c3f640
commit
27f50cc4ab
2 changed files with 23 additions and 2 deletions
|
|
@ -21,8 +21,8 @@ class PathFollower{
|
|||
$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->ai->mobController->setMovingTarget($moveX, $moveY, $moveZ, 1.0);
|
||||
if($this->entity->boundingBox->isXYZInsideNS($moveX, $moveY, $moveZ)){
|
||||
++$this->entity->currentIndex;
|
||||
console("next");
|
||||
$this->entity->currentNode = null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue