From 7ebb5a4a635ac387465237265a2685cc3fe75633 Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Fri, 15 Mar 2024 22:45:42 +0300 Subject: [PATCH] fixed crash when shooting an arrow --- src/entity/ai/tasks/TaskEatTileGoal.php | 1 - src/entity/ai/tasks/TaskRandomWalk.php | 2 +- src/entity/object/Arrow.php | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/entity/ai/tasks/TaskEatTileGoal.php b/src/entity/ai/tasks/TaskEatTileGoal.php index 10ed4aef..3dc4a9ec 100644 --- a/src/entity/ai/tasks/TaskEatTileGoal.php +++ b/src/entity/ai/tasks/TaskEatTileGoal.php @@ -39,7 +39,6 @@ class TaskEatTileGoal extends TaskBase return ($idm[0] === TALL_GRASS && $idm[1] === 1) || $idb === GRASS; } return false; - //this.theEntity.getRNG().nextInt(this.theEntity.isChild() ? 50 : 1000) != 0 } } diff --git a/src/entity/ai/tasks/TaskRandomWalk.php b/src/entity/ai/tasks/TaskRandomWalk.php index dacf4f67..ad64ad61 100644 --- a/src/entity/ai/tasks/TaskRandomWalk.php +++ b/src/entity/ai/tasks/TaskRandomWalk.php @@ -30,9 +30,9 @@ class TaskRandomWalk extends TaskBase $this->reset(); return false; //TODO Better way: block movement } + --$this->selfCounter; $ai->mobController->setMovingOffset($this->x, 0, $this->z, $this->speedMultiplier); - //TODO fix $ai->mobController->moveNonInstant($this->x, 0, $this->z); } public function canBeExecuted(EntityAI $ai) diff --git a/src/entity/object/Arrow.php b/src/entity/object/Arrow.php index f78ae790..cc1b4675 100644 --- a/src/entity/object/Arrow.php +++ b/src/entity/object/Arrow.php @@ -49,7 +49,7 @@ class Arrow extends Projectile{ $this->yaw = (atan2($d, $d2) * 180) / M_PI; $this->pitch = (atan2($d1, $f3) * 180) / M_PI; $this->updatePosition(); - $this->update(); + //$this->update(); //TODO i guess? $ticksInGround = 0; } public function sendMoveUpdate()