entities will use xorshift128 random

This commit is contained in:
GameHerobrine 2025-05-16 07:11:27 +03:00
parent 0c6bf7648f
commit 75d75e426a
2 changed files with 59 additions and 1 deletions

View file

@ -76,6 +76,9 @@ class Entity extends Position
public $check = true;
public $width = 1;
public $height = 1;
/**
* @var XorShift128Random
*/
public $random;
public $radius;
public $inAction = false;
@ -113,7 +116,7 @@ class Entity extends Position
function __construct(Level $level, $eid, $class, $type = 0, $data = [])
{
$this->random = new Random();
$this->random = new XorShift128Random();
$this->last = [&$this->lastX, &$this->lastY, &$this->lastZ, &$this->lastYaw, &$this->lastPitch, &$this->lastTime]; //pointers to variables
$this->canBeAttacked = false;
$this->hasKnockback = false;