Remove deprecated and unused methods from SubChunk

- Remove deprecated getBlockLayers() method that was replaced by getBlockLayer() and getLiquidLayer()
- Remove setBlockLayer() and setLiquidLayer() setter methods as layers are now managed internally
- Simplifies the API and prevents external mutation of internal layer state
This commit is contained in:
Dylan T. 2025-06-27 15:58:10 +00:00
parent 72781f4042
commit 48cc87d066

View File

@ -104,31 +104,14 @@ class SubChunk{
$this->blockLayer->set($x, $y, $z, $block);
}
/**
* @deprecated Use getBlockLayer() and getLiquidLayer() instead
* @return PalettedBlockArray[]
* @phpstan-return list<PalettedBlockArray>
*/
public function getBlockLayers() : array{
return [$this->blockLayer, $this->liquidLayer];
}
public function getBlockLayer() : PalettedBlockArray{
return $this->blockLayer;
}
public function setBlockLayer(PalettedBlockArray $blockLayer) : void{
$this->blockLayer = $blockLayer;
}
public function getLiquidLayer() : PalettedBlockArray{
return $this->liquidLayer;
}
public function setLiquidLayer(PalettedBlockArray $liquidLayer) : void{
$this->liquidLayer = $liquidLayer;
}
public function getHighestBlockAt(int $x, int $z) : ?int{
for($y = self::EDGE_LENGTH - 1; $y >= 0; --$y){
if($this->blockLayer->get($x, $y, $z) !== $this->emptyBlockId){