mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 04:29: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);
|
$diffZ = ($source->z - $block->z);
|
||||||
$distance = $diffX*$diffX + $diffY*$diffY + $diffZ*$diffZ;
|
$distance = $diffX*$diffX + $diffY*$diffY + $diffZ*$diffZ;
|
||||||
$result = floor($source->getMaxLightValue() - $distance);
|
$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);
|
$this->init_with_integer(19650218);
|
||||||
$i = 1;
|
$i = 1;
|
||||||
$j = 0;
|
$j = 0;
|
||||||
$k = (N > $key_length ? N : $key_length);
|
$k = (max(N, $key_length));
|
||||||
for(; $k; $k--){
|
for(; $k; $k--){
|
||||||
$mt[$i] = add_3($mt[$i] ^
|
$mt[$i] = add_3($mt[$i] ^
|
||||||
mul_by_1664525($mt[$i - 1] ^ (($mt[$i - 1] >> 30) & 3)),
|
mul_by_1664525($mt[$i - 1] ^ (($mt[$i - 1] >> 30) & 3)),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue