From 1511ecc7312b1be21e5f76c2308961c1c1abe5b2 Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Thu, 29 Jun 2023 21:11:51 +0300 Subject: [PATCH] trying mt_rand method --- src/world/Level.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/world/Level.php b/src/world/Level.php index 9f901bb9..c929a88e 100644 --- a/src/world/Level.php +++ b/src/world/Level.php @@ -305,9 +305,8 @@ class Level{ for($cX = 0; $cX < 16; ++$cX){ for($cZ = 0; $cZ < 16; ++$cZ){ for($c = 0; $c <= 20; ++$c){ - $this->randInt1 = $this->randInt1 * 3 + $this->randInt2; - $xyz = $this->randInt1 >> 2; - $this->randInt1 = $this->randInt1 & 0xffffffff; //bad php i hate u why no uint + //$this->randInt1 = ($this->randInt1 * 3 + $this->randInt2) & 0xffffffff; + $xyz = mt_rand(0, 0xffffffff) >> 2;//$this->randInt1 >> 2; $x = $xyz & 0xf; $z = ($xyz >> 8) & 0xf; //TODO might be possible to make some micro optmizations $y = ($xyz >> 16) & 0x7f;