mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
extra.properties cleanup, fixed fire/water/lava collisions
This commit is contained in:
parent
86e32a1620
commit
8f720231fa
9 changed files with 20 additions and 31 deletions
|
|
@ -753,7 +753,7 @@ class Utils{
|
|||
public static function readLong($x, $signed = true){
|
||||
$value = "0";
|
||||
if($signed === true){
|
||||
$negative = ((ord($x[0]) & 0x80) === 0x80) ? true : false;
|
||||
$negative = ((ord($x[0]) & 0x80) === 0x80);
|
||||
if($negative){
|
||||
$x = ~$x;
|
||||
}
|
||||
|
|
@ -763,9 +763,9 @@ class Utils{
|
|||
|
||||
for($i = 0; $i < 8; $i += 4){
|
||||
$value = bcmul($value, "4294967296", 0); //4294967296 == 2^32
|
||||
$value = bcadd($value, 0x1000000 * ord(@$x[$i]) + ((ord(@$x[$i + 1]) << 16) | (ord(@$x[$i + 2]) << 8) | ord(@$x[$i + 3])), 0);
|
||||
$value = bcadd($value, 0x1000000 * ord($x[$i] ?? 0) + ((ord($x[$i + 1] ?? 0) << 16) | (ord($x[$i + 2] ?? 0) << 8) | ord($x[$i + 3] ?? 0)), 0);
|
||||
}
|
||||
return ($negative === true ? "-" . $value : $value);
|
||||
return ($negative ? "-$value" : $value);
|
||||
}
|
||||
|
||||
public static function writeLLong($value){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue