mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
FastChunkSerializer: retain emptyBlock on subchunks
I think we should probably get rid of this considering the potential for inconsistencies within a chunk, but not retaining this is a bug nonetheless, even though it doesn't have any effect in PM itself since we always use BlockLegacyIds << 4 as the empty block ID. so, this is only really aiding (ab)use cases which weren't intended anyway ...
This commit is contained in:
@ -69,6 +69,12 @@ class SubChunk{
|
||||
return count($this->blockLayers) === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the block used as the default. This is assumed to refer to air.
|
||||
* If all the blocks in a subchunk layer are equal to this block, the layer is assumed to be empty.
|
||||
*/
|
||||
public function getEmptyBlockId() : int{ return $this->emptyBlockId; }
|
||||
|
||||
public function getFullBlock(int $x, int $y, int $z) : int{
|
||||
if(count($this->blockLayers) === 0){
|
||||
return $this->emptyBlockId;
|
||||
|
Reference in New Issue
Block a user