diff --git a/src/utils/LightUtils.php b/src/utils/LightUtils.php index 876db487..83820d8f 100644 --- a/src/utils/LightUtils.php +++ b/src/utils/LightUtils.php @@ -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); } } \ No newline at end of file diff --git a/src/utils/MersenneTwister.php b/src/utils/MersenneTwister.php index 194d54f8..e35c7f25 100644 --- a/src/utils/MersenneTwister.php +++ b/src/utils/MersenneTwister.php @@ -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)),