mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
new ai task, fixes of old ones, php8 fixes
This commit is contained in:
parent
a907a7cf5e
commit
80bdddb817
13 changed files with 1581 additions and 1458 deletions
|
|
@ -17,7 +17,6 @@ class TaskRandomWalk extends TaskBase
|
|||
public function onEnd(EntityAI $ai)
|
||||
{
|
||||
$this->x = $this->z = 0;
|
||||
$ai->entity->idleTime = mt_rand(20, 120);
|
||||
}
|
||||
|
||||
public function onUpdate(EntityAI $ai)
|
||||
|
|
@ -34,7 +33,7 @@ class TaskRandomWalk extends TaskBase
|
|||
if($ai->entity instanceof Creeper && $ai->entity->isIgnited()) {
|
||||
return false;
|
||||
}
|
||||
return !@$ai->getTask("TaskLookAround")->isStarted && !@$ai->getTask("TaskLookAtPlayer")->isStarted && mt_rand(0, 40) == 0;
|
||||
return !$ai->isStarted("TaskLookAround") && !$ai->isStarted("TaskLookAtPlayer") && mt_rand(0, 120) == 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue