mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-08-12 06:18:47 +00:00
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:
parent
72781f4042
commit
48cc87d066
@ -104,31 +104,14 @@ class SubChunk{
|
|||||||
$this->blockLayer->set($x, $y, $z, $block);
|
$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{
|
public function getBlockLayer() : PalettedBlockArray{
|
||||||
return $this->blockLayer;
|
return $this->blockLayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setBlockLayer(PalettedBlockArray $blockLayer) : void{
|
|
||||||
$this->blockLayer = $blockLayer;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getLiquidLayer() : PalettedBlockArray{
|
public function getLiquidLayer() : PalettedBlockArray{
|
||||||
return $this->liquidLayer;
|
return $this->liquidLayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setLiquidLayer(PalettedBlockArray $liquidLayer) : void{
|
|
||||||
$this->liquidLayer = $liquidLayer;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getHighestBlockAt(int $x, int $z) : ?int{
|
public function getHighestBlockAt(int $x, int $z) : ?int{
|
||||||
for($y = self::EDGE_LENGTH - 1; $y >= 0; --$y){
|
for($y = self::EDGE_LENGTH - 1; $y >= 0; --$y){
|
||||||
if($this->blockLayer->get($x, $y, $z) !== $this->emptyBlockId){
|
if($this->blockLayer->get($x, $y, $z) !== $this->emptyBlockId){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user