mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
tweaks to pathfinder and pathfollower(basically nothing)
This commit is contained in:
parent
da28b3b0ff
commit
cb0fa06e12
5 changed files with 94 additions and 25 deletions
|
|
@ -19,13 +19,29 @@ class PathFollower{
|
|||
$this->entity->currentNode = $this->entity->path[$this->entity->currentIndex];
|
||||
}
|
||||
|
||||
$this->entity->ai->mobController->setMovingTarget($this->entity->currentNode->x, $this->entity->currentNode->y, $this->entity->currentNode->z, 0.25);
|
||||
console($this->entity->currentNode.":".$this->entity->boundingBox);
|
||||
if($this->entity->boundingBox->isXYZInsideNS($this->entity->currentNode->x, $this->entity->currentNode->y, $this->entity->currentNode->z)){
|
||||
$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)){
|
||||
++$this->entity->currentIndex;
|
||||
console("next");
|
||||
$this->entity->currentNode = null;
|
||||
}
|
||||
|
||||
|
||||
if($this->entity->currentIndex >= count($this->entity->path)){
|
||||
console("path finished.");
|
||||
$this->entity->currentNode = null;
|
||||
$this->entity->path = null;
|
||||
$this->entity->currentIndex = 0;
|
||||
|
||||
foreach($this->entity->pathEIDS as $eid){
|
||||
$pk = new RemoveEntityPacket();
|
||||
$pk->eid = $eid;
|
||||
foreach($this->entity->level->players as $player){
|
||||
$player->dataPacket($pk);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue