mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
bad
This commit is contained in:
parent
aa0031b910
commit
b712c4b7a9
10 changed files with 257 additions and 100 deletions
|
|
@ -50,7 +50,10 @@ class Random{
|
|||
return $this->nextInt() / 0x7FFFFFFF;
|
||||
}
|
||||
|
||||
public function nextInt(){
|
||||
public function nextInt($n = -1){
|
||||
if($n > 0){
|
||||
return Utils::readInt($this->nextBytes(4)) & 0x7FFFFFFF % $n;
|
||||
}
|
||||
return Utils::readInt($this->nextBytes(4)) & 0x7FFFFFFF;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue