mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
small tweaks
This commit is contained in:
parent
c41e31e237
commit
9f5304bdad
7 changed files with 52 additions and 47 deletions
|
|
@ -9,7 +9,7 @@ abstract class Living extends Entity implements Damageable, Pathfindable{
|
|||
public function __construct(Level $level, $eid, $class, $type = 0, $data = array()){
|
||||
$this->target = false;
|
||||
$this->ai = new EntityAI($this);
|
||||
$this->pathFinder = new TileNavigator(new MCBlockedProvider(), new MCDiagonalProvider(), new Pythagoras3D(), new ManhattanHeuristic3D());
|
||||
$this->pathFinder = new TileNavigator(new MCBlockedProvider(), new MCDiagonalProvider(), new ManhattanHeuristic3D());
|
||||
$this->pathFollower = new PathFollower($this);
|
||||
parent::__construct($level, $eid, $class, $type, $data);
|
||||
$this->canBeAttacked = true;
|
||||
|
|
@ -34,7 +34,7 @@ abstract class Living extends Entity implements Damageable, Pathfindable{
|
|||
$this->ai->updateTasks();
|
||||
}
|
||||
if($this->onGround){
|
||||
//if(!$this->hasPath() && $this->pathFinder instanceof ITileNavigator){ // mt_rand(0, 120) === 0){
|
||||
//if(!$this->hasPath() && $this->pathFinder instanceof ITileNavigator){
|
||||
// $this->path = $this->pathFinder->navigate(new PathTileXYZ($this->x, $this->y, $this->z, $this->level), new PathTileXYZ($this->x + mt_rand(-10, 10), $this->y + mt_rand(-1, 1), $this->z + mt_rand(-10, 10), $this->level), 10);
|
||||
//}
|
||||
$this->pathFollower->followPath();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue