Fix blockhash fail (this would have returned excessive Y coordinates including the bits for X!)

This commit is contained in:
Dylan K. Taylor 2016-12-05 16:29:27 +00:00
parent 25560a52b0
commit e92052c2ab

View File

@ -275,7 +275,7 @@ class Level implements ChunkManager, Metadatable{
public static function getBlockXYZ($hash, &$x, &$y, &$z){
if(PHP_INT_SIZE === 8){
$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;
}else{
$hash = explode(":", $hash);