mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
ai changes
This commit is contained in:
parent
11b1a09599
commit
0f72601891
9 changed files with 52 additions and 29 deletions
|
|
@ -21,7 +21,7 @@ class TaskRandomWalk extends TaskBase
|
|||
|
||||
public function onUpdate(EntityAI $ai)
|
||||
{
|
||||
if($ai->entity instanceof Creeper && $ai->entity->isIgnited()) {
|
||||
if($ai->entity instanceof Creeper && $ai->entity->isIgnited() || $ai->isStarted("TaskTempt")) {
|
||||
return false; //TODO Better way: block movement
|
||||
}
|
||||
--$this->selfCounter;
|
||||
|
|
@ -30,7 +30,7 @@ class TaskRandomWalk extends TaskBase
|
|||
|
||||
public function canBeExecuted(EntityAI $ai)
|
||||
{
|
||||
if($ai->entity instanceof Creeper && $ai->entity->isIgnited()) {
|
||||
if($ai->entity instanceof Creeper && $ai->entity->isIgnited() || $ai->entity->hasPath() || $ai->isStarted("TaskTempt")) {
|
||||
return false;
|
||||
}
|
||||
return !$ai->isStarted("TaskLookAround") && !$ai->isStarted("TaskLookAtPlayer") && mt_rand(0, 120) == 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue