mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Sheep color chance
This commit is contained in:
parent
3903d8dfde
commit
ca2bf73e06
2 changed files with 33 additions and 1 deletions
|
|
@ -379,6 +379,14 @@ class Utils{
|
|||
$lastRandom = hash("sha512", $lastRandom, true);
|
||||
return $raw === false ? bin2hex($output):$output;
|
||||
}
|
||||
|
||||
public static function randomFloat(){//GameHerobrine's code
|
||||
return rand()/getrandmax();
|
||||
}
|
||||
|
||||
public static function chance($i){//GameHerobrine's code
|
||||
return randomFloat() < $i / 100;
|
||||
}
|
||||
|
||||
public static function round($number){
|
||||
return round($number, 0, PHP_ROUND_HALF_DOWN);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue