mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 04:29:43 +00:00
water damage rewroked, small rotation changes
This commit is contained in:
parent
adf84efbd7
commit
0dacbe0b36
5 changed files with 48 additions and 23 deletions
|
|
@ -33,6 +33,10 @@ class MobController
|
|||
$this->jumping = $b;
|
||||
}
|
||||
|
||||
public function isRotationCompleted(){
|
||||
return $this->finalHeadYaw === $this->entity->headYaw;
|
||||
}
|
||||
|
||||
public function moveNonInstant($x, $y, $z){
|
||||
if($x == 0 && $y == 0 && $z == 0){
|
||||
return false;
|
||||
|
|
@ -87,7 +91,7 @@ class MobController
|
|||
break;
|
||||
}
|
||||
$this->faceEntity($ox, $oy, $oz);
|
||||
if($this->entity->knockbackTime <= 0){
|
||||
if($this->entity->knockbackTime <= 0 && $this->isRotationCompleted()){
|
||||
$this->entity->moveEntityWithOffset($ox, $oy, $oz);
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ class TaskLookAtPlayer extends TaskBase{
|
|||
public $target = false;
|
||||
private $state, $yaw, $pitch;
|
||||
public function canBeExecuted(EntityAI $ai){
|
||||
return !$ai->entity->inPanic && lcg_value() < 0.02 && !$ai->entity->isMovingHorizontally() && !$ai->isStarted("TaskLookAround") && !$ai->isStarted("TaskTempt") && !$ai->entity->hasPath();
|
||||
return !$ai->entity->inPanic && lcg_value() < 0.02 && !$ai->entity->isMovingHorizontally() && !$ai->isStarted("TaskLookAround") && !$ai->isStarted("TaskTempt") && !$ai->isStarted("TaskPanic") && !$ai->entity->hasPath();
|
||||
}
|
||||
|
||||
protected function findTarget($e, $r){
|
||||
|
|
@ -61,6 +61,7 @@ class TaskLookAtPlayer extends TaskBase{
|
|||
public function onEnd(EntityAI $ai){
|
||||
unset($this->target);
|
||||
$ai->entity->pitch = 0;
|
||||
$ai->entity->sendMoveUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue