mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-08-30 15:01:19 +00:00
Fix blockhash fail (this would have returned excessive Y coordinates including the bits for X!)
This commit is contained in:
parent
25560a52b0
commit
e92052c2ab
@ -275,7 +275,7 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
public static function getBlockXYZ($hash, &$x, &$y, &$z){
|
public static function getBlockXYZ($hash, &$x, &$y, &$z){
|
||||||
if(PHP_INT_SIZE === 8){
|
if(PHP_INT_SIZE === 8){
|
||||||
$x = $hash >> 36;
|
$x = $hash >> 36;
|
||||||
$y = $hash >> 28; //it's always positive
|
$y = ($hash >> 28) & Level::Y_MASK; //it's always positive
|
||||||
$z = ($hash & 0xFFFFFFF) << 36 >> 36;
|
$z = ($hash & 0xFFFFFFF) << 36 >> 36;
|
||||||
}else{
|
}else{
|
||||||
$hash = explode(":", $hash);
|
$hash = explode(":", $hash);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user