mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
entities will use xorshift128 random
This commit is contained in:
parent
0c6bf7648f
commit
75d75e426a
2 changed files with 59 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue