shift default left instead of set value right

don't remove metadata bits for block comparison, because they could be part of the ID.
This commit is contained in:
Dylan K. Taylor 2019-07-08 14:53:19 +01:00
parent cdab3e967a
commit 4e2f430f06

View File

@ -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;
}
}