some fixes to prevent deprecated warning spam on php 8.2

This commit is contained in:
GameHerobrine 2026-01-05 10:39:06 +03:00
parent 1272932257
commit 2f6e2ffcab
10 changed files with 12 additions and 7 deletions

View file

@ -2,6 +2,7 @@
class TaskFollowParent extends TaskBase
{
public $speedMultiplier;
public function __construct($speed){
$this->speedMultiplier = $speed;
}

View file

@ -2,6 +2,7 @@
class TaskMate extends TaskBase
{
public $speedMultiplier;
public function __construct($speed){
$this->speedMultiplier = $speed;
}

View file

@ -5,6 +5,7 @@ class TaskRangedAttack extends \TaskBase
public $server;
public $attackCounter = 0;
public $seenTicks = 0;
public $rangeSquared = 0;
public function __construct($speed, $range){
$this->speedMultiplier = $speed;
$this->rangeSquared = $range*$range;
@ -14,7 +15,6 @@ class TaskRangedAttack extends \TaskBase
public function onStart(EntityAI $ai)
{
$this->selfCounter = 1;
$this->ticksNoSeen = 0;
}
public function onEnd(EntityAI $ai)

View file

@ -2,6 +2,8 @@
class TaskTempt extends TaskBase
{
public $speedMultiplier;
public $targetDistance;
public function __construct($speed){
$this->speedMultiplier = $speed;
$this->targetDistance = 10*10;

View file

@ -32,7 +32,7 @@ class Zombie extends Monster{
}
for($y = (int)$this->y; $y < 129; $y++){
$block = $this->level->level->getBlockID($this->x, $y, $this->z);
$block = $this->level->level->getBlockID(floor($this->x), $y, floor($this->z));
if(StaticBlock::getIsSolid($block)){
return false;
}

View file

@ -13,6 +13,7 @@ class Arrow extends Entity{
public $criticial = false;
public $groundTicks = 0;
public $shotByPlayer = false;
public $shotByEntity = false;
function __construct(Level $level, $eid, $class, $type = 0, $data = []){
parent::__construct($level, $eid, $class, $type, $data);

View file

@ -200,7 +200,7 @@ class ItemEntity extends Entity{
$friction = 0.98;
if($this->onGround){
$friction = 0.588;
$v3 = $this->level->level->getBlockID($this->x, floor($this->boundingBox->minY) - 1, $this->z);
$v3 = $this->level->level->getBlockID(floor($this->x), floor($this->boundingBox->minY) - 1, floor($this->z));
if($v3 > 0) $friction = StaticBlock::getSlipperiness($v3);
}