fixed inability to collect entity drop, fixed player not getting damage while standing on cactus, tweaked some other stuff

This commit is contained in:
GameHerobrine 2024-11-23 05:35:41 +03:00
parent 46efebaf67
commit 19a4008543
6 changed files with 11 additions and 10 deletions

View file

@ -102,7 +102,7 @@ class MobController
$v8 = $diffX*$diffX + $diffY*$diffY + $diffZ*$diffZ;
if($v8 >= 2.500000277905201E-7){ //TODO convert notation
if($v8 >= 0.00000025){
$v10 = (atan2($diffZ, $diffX) * 180 / M_PI) - 90;
$this->entity->yaw = self::limitAngle($this->entity->yaw, $v10, 30);
$this->entity->setAIMoveSpeed($this->speedMultiplier * $this->entity->getSpeed() * $this->entity->getSpeedModifer());

View file

@ -1,5 +1,5 @@
<?php
//TODO mutexBits
abstract class TaskBase
{
public $isStarted = false, $selfCounter = 0;

View file

@ -27,7 +27,7 @@ class TaskLookAtPlayer extends TaskBase{
}
public function onUpdate(EntityAI $ai){
if(!($this->target instanceof Entity) || Utils::distance($ai->entity, $this->target) > 6 || $this->target->level->getName() != $ai->entity->level->getName()){ //TODO max distance for different mobs
if(!($this->target instanceof Entity) || Utils::distance($ai->entity, $this->target) > $this->distance || $this->target->level->getName() != $ai->entity->level->getName()){
$this->reset();
$this->onEnd($ai);
return;