mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
mobs will follow player if the player has food(no pathfinder), autojump tweaks
This commit is contained in:
parent
1aef739065
commit
616c933d3d
2 changed files with 8 additions and 6 deletions
|
|
@ -21,14 +21,14 @@ class MobController
|
|||
$xf = $this->entity->x + ($this->entity->getSpeedModifer() * $ox * $this->entity->getSpeed());
|
||||
$zf = $this->entity->z + ($this->entity->getSpeedModifer() * $oz * $this->entity->getSpeed());
|
||||
$bs = [ //TODO simplify(somehow)
|
||||
$this->entity->level->getBlockWithoutVector(ceil($xf), $this->entity->y, ceil($zf)),
|
||||
$this->entity->level->getBlockWithoutVector(ceil($xf), $this->entity->y, $zf),
|
||||
$this->entity->level->getBlockWithoutVector($xf, $this->entity->y, ceil($zf)),
|
||||
$this->entity->level->getBlockWithoutVector($xf, $this->entity->y, $zf)
|
||||
$this->entity->level->getBlockWithoutVector(ceil($xf), floor($this->entity->y), ceil($zf)),
|
||||
$this->entity->level->getBlockWithoutVector(ceil($xf), floor($this->entity->y), $zf - ($oz < 0 ? 1 : 0)),
|
||||
$this->entity->level->getBlockWithoutVector($xf - ($ox < 0 ? 1 : 0), floor($this->entity->y), $zf - ($oz < 0 ? 1 : 0)),
|
||||
$this->entity->level->getBlockWithoutVector($xf - ($ox < 0 ? 1 : 0), floor($this->entity->y), ceil($zf)),
|
||||
];
|
||||
foreach($bs as $b){
|
||||
if($b->isSolid){
|
||||
if(!$this->entity->level->getBlock($b->getSide(1))->isSolid){
|
||||
if(!$b->getSide(1)->isSolid){
|
||||
$oy = 1;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,9 @@ class TaskTempt extends TaskBase
|
|||
$this->reset();
|
||||
return;
|
||||
}
|
||||
//TODO following
|
||||
|
||||
$ai->mobController->moveTo($this->target->x, floor($ai->entity->y), $this->target->z);
|
||||
|
||||
$ai->mobController->lookOn($this->target);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue