mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 20:19:44 +00:00
pathfinder rewrite
This commit is contained in:
parent
cb0fa06e12
commit
22f3c3f640
16 changed files with 89 additions and 263 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue