mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
trying mt_rand method
This commit is contained in:
parent
83dad024b1
commit
1511ecc731
1 changed files with 2 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue