made pushing disableable in config, php8.1+particial 8.2 comp(not recommended)

This commit is contained in:
GameHerobrine 2023-02-24 06:10:41 +03:00
parent 79831c457d
commit cb6e649081
19 changed files with 55 additions and 40 deletions

View file

@ -72,6 +72,8 @@ class Entity extends Position
public $inAction = false;
public $hasKnockback;
public $hasJumped;
public $invincible, $crouched, $fire, $health, $status;
public $position;
public $onGround, $inWater;
public $carryoverDamage;
function __construct(Level $level, $eid, $class, $type = 0, $data = array())

View file

@ -2,7 +2,7 @@
abstract class Living extends Entity implements Damageable, Pathfindable{
public static $despawnMobs, $despawnTimer;
public static $despawnMobs, $despawnTimer, $entityPushing;
public $target, $ai;
public $pathFinder, $path = null, $currentIndex = 0, $currentNode, $pathFollower;
@ -65,7 +65,9 @@ abstract class Living extends Entity implements Damageable, Pathfindable{
}
$this->ai->mobController->rotateTick();
$this->ai->mobController->movementTick();
$this->collideHandler();
if(self::$entityPushing){
$this->collideHandler();
}
if($this->onGround){
//if(!$this->hasPath() && $this->pathFinder instanceof ITileNavigator){
// $this->path = $this->pathFinder->navigate(new PathTileXYZ($this->x, $this->y, $this->z, $this->level), new PathTileXYZ($this->x + mt_rand(-10, 10), $this->y + mt_rand(-1, 1), $this->z + mt_rand(-10, 10), $this->level), 10);