fixed crash

This commit is contained in:
GameHerobrine 2023-07-08 22:08:44 +03:00
parent db23411e15
commit 1baafb8b26
2 changed files with 2 additions and 2 deletions

View file

@ -16,7 +16,7 @@ class TaskDestroyServerPerformance extends TaskTempt
public function onUpdate(EntityAI $ai) public function onUpdate(EntityAI $ai)
{ {
if(!($this->target instanceof Entity) || ($ai->entity instanceof Spider && $ai->entity->level->isDay()) || ($this->target instanceof Entity && !$this->target->isPlayer()) || (Utils::distance_noroot($this->target, $ai->entity) > 256) || $this->target->level->getName() != $ai->entity->level->getName()){ if(!($this->target instanceof Entity) || ($this->target instanceof Entity && !$this->target->isPlayer()) || (Utils::distance_noroot($this->target, $ai->entity) > 256) || $this->target->level->getName() != $ai->entity->level->getName()){
$this->reset(); $this->reset();
return; return;
} }

View file

@ -30,7 +30,7 @@ class LeavesBlock extends TransparentBlock{
return true; return true;
} }
if($block->getId() === LEAVES && $distance <= 4){ if($block === LEAVES && $distance <= 4){
if(self::findLog($level, $x - 1, $y, $z, $visited, $distance + 1)) return true; if(self::findLog($level, $x - 1, $y, $z, $visited, $distance + 1)) return true;
if(self::findLog($level, $x + 1, $y, $z, $visited, $distance + 1)) return true; if(self::findLog($level, $x + 1, $y, $z, $visited, $distance + 1)) return true;
if(self::findLog($level, $x, $y, $z - 1, $visited, $distance + 1)) return true; if(self::findLog($level, $x, $y, $z - 1, $visited, $distance + 1)) return true;