mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
use min() and max()
This commit is contained in:
parent
9eeaa9600f
commit
0f26e45638
2 changed files with 2 additions and 2 deletions
|
|
@ -15,6 +15,6 @@ class LightUtils{
|
|||
$diffZ = ($source->z - $block->z);
|
||||
$distance = $diffX*$diffX + $diffY*$diffY + $diffZ*$diffZ;
|
||||
$result = floor($source->getMaxLightValue() - $distance);
|
||||
return $result <= 0 ? 0 : $result;
|
||||
return max($result, 0);
|
||||
}
|
||||
}
|
||||
|
|
@ -125,7 +125,7 @@ class MersenneTwister{
|
|||
$this->init_with_integer(19650218);
|
||||
$i = 1;
|
||||
$j = 0;
|
||||
$k = (N > $key_length ? N : $key_length);
|
||||
$k = (max(N, $key_length));
|
||||
for(; $k; $k--){
|
||||
$mt[$i] = add_3($mt[$i] ^
|
||||
mul_by_1664525($mt[$i - 1] ^ (($mt[$i - 1] >> 30) & 3)),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue