From 4e2f430f060f98affdd556ed521f3c64cf210119 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 8 Jul 2019 14:53:19 +0100 Subject: [PATCH] shift default left instead of set value right don't remove metadata bits for block comparison, because they could be part of the ID. --- src/pocketmine/world/format/SubChunk.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pocketmine/world/format/SubChunk.php b/src/pocketmine/world/format/SubChunk.php index 19021fd77..c84976bf3 100644 --- a/src/pocketmine/world/format/SubChunk.php +++ b/src/pocketmine/world/format/SubChunk.php @@ -53,7 +53,7 @@ class SubChunk implements SubChunkInterface{ foreach($this->blockLayers as $layer){ $palette = $layer->getPalette(); foreach($palette as $p){ - if(($p >> 4) !== BlockLegacyIds::AIR){ + if($p !== (BlockLegacyIds::AIR << 4)){ return false; } } @@ -112,7 +112,7 @@ class SubChunk implements SubChunkInterface{ return -1; } for($y = 15; $y >= 0; --$y){ - if(($this->blockLayers[0]->get($x, $y, $z) >> 4) !== BlockLegacyIds::AIR){ + if($this->blockLayers[0]->get($x, $y, $z) !== (BlockLegacyIds::AIR << 4)){ return $y; } } @@ -145,7 +145,7 @@ class SubChunk implements SubChunkInterface{ $layer->collectGarbage(); foreach($layer->getPalette() as $p){ - if(($p >> 4) !== BlockLegacyIds::AIR){ + if($p !== (BlockLegacyIds::AIR << 4)){ continue 2; } }