changes to skeleton ai, theoretical performance increase with huge amount of mobs and players

This commit is contained in:
GameHerobrine 2024-04-12 06:06:59 +03:00
parent c9da91378d
commit da28b3b0ff
9 changed files with 89 additions and 96 deletions

View file

@ -7,6 +7,8 @@ class Entity extends Position
const CLASS_TYPE = - 1;
const MIN_POSSIBLE_SPEED = 1/8000; //anything below will send 0 to player
public $searchForClosestPlayers = false;
public $counter = 0;
public $fallDistance = 0;
public static $updateOnTick, $allowedAI;
@ -186,7 +188,9 @@ class Entity extends Position
$this->outOfWorld();
}
}
public function handlePrePlayerSearcher(){
}
public function isType(){
return in_array($this->type, func_get_args());
}
@ -715,6 +719,10 @@ class Entity extends Position
return $this->y < -1.6;
}
public function handlePlayerSearcher(Player $player, $dist){
}
public function update($now){
if($this->closed === true){
return false;