mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 20:19:44 +00:00
a slightly better pathnavigator
This commit is contained in:
parent
6ee84717f8
commit
916a06c161
3 changed files with 60 additions and 27 deletions
|
|
@ -19,6 +19,17 @@ abstract class Creature extends Living{
|
|||
}
|
||||
}
|
||||
|
||||
public function update(){
|
||||
i/*f($this->path === false || count($this->path) <= 0){
|
||||
$this->path = $this->pathFinder->findPath(MinecraftNode::fromArray([$this->x, $this->y, $this->z]), new MinecraftNode($this->x + mt_rand(-7, 7), $this->y, $this->z + mt_rand(-7, 7)));
|
||||
}
|
||||
$state = $this->pathNavigator->followPath($this->path);
|
||||
if($state === PathNavigator::PATH_COMPLETED){
|
||||
$this->path = false;
|
||||
}*/
|
||||
parent::update();
|
||||
}
|
||||
|
||||
public function createSaveData(){
|
||||
$data = parent::createSaveData();
|
||||
$data["State"] = @$this->getState();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue