mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 09:19:42 +00:00
Chunk: remove column methods
these were (mostly) unused, and the places they were used breaks the interface definitions. It also exposes internals that are sensitive to change.
This commit is contained in:
parent
77fd57e11a
commit
8a062f440d
@ -461,66 +461,6 @@ class Chunk{
|
||||
$this->biomeIds{($z << 4) | $x} = chr($biomeId & 0xff);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a column of block IDs from bottom to top at the specified X/Z chunk block coordinates.
|
||||
* @param int $x 0-15
|
||||
* @param int $z 0-15
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBlockIdColumn(int $x, int $z) : string{
|
||||
$result = "";
|
||||
foreach($this->subChunks as $subChunk){
|
||||
$result .= $subChunk->getBlockIdColumn($x, $z);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a column of block meta values from bottom to top at the specified X/Z chunk block coordinates.
|
||||
* @param int $x 0-15
|
||||
* @param int $z 0-15
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBlockDataColumn(int $x, int $z) : string{
|
||||
$result = "";
|
||||
foreach($this->subChunks as $subChunk){
|
||||
$result .= $subChunk->getBlockDataColumn($x, $z);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a column of sky light values from bottom to top at the specified X/Z chunk block coordinates.
|
||||
* @param int $x 0-15
|
||||
* @param int $z 0-15
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBlockSkyLightColumn(int $x, int $z) : string{
|
||||
$result = "";
|
||||
foreach($this->subChunks as $subChunk){
|
||||
$result .= $subChunk->getBlockSkyLightColumn($x, $z);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a column of block light values from bottom to top at the specified X/Z chunk block coordinates.
|
||||
* @param int $x 0-15
|
||||
* @param int $z 0-15
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBlockLightColumn(int $x, int $z) : string{
|
||||
$result = "";
|
||||
foreach($this->subChunks as $subChunk){
|
||||
$result .= $subChunk->getBlockLightColumn($x, $z);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
|
@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\level\generator\populator;
|
||||
|
||||
use pocketmine\block\Block;
|
||||
use pocketmine\block\BlockFactory;
|
||||
use pocketmine\block\Liquid;
|
||||
use pocketmine\level\biome\Biome;
|
||||
@ -43,9 +44,9 @@ class GroundCover extends Populator{
|
||||
$diffY = 1;
|
||||
}
|
||||
|
||||
$column = $chunk->getBlockIdColumn($x, $z);
|
||||
for($y = 127; $y > 0; --$y){
|
||||
if($column{$y} !== "\x00" and !BlockFactory::get(ord($column{$y}))->isTransparent()){
|
||||
$id = $chunk->getBlockId($x, $y, $z);
|
||||
if($id !== Block::AIR and !BlockFactory::get($id)->isTransparent()){
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -53,10 +54,11 @@ class GroundCover extends Populator{
|
||||
$endY = $startY - count($cover);
|
||||
for($y = $startY; $y > $endY and $y >= 0; --$y){
|
||||
$b = $cover[$startY - $y];
|
||||
if($column{$y} === "\x00" and $b->isSolid()){
|
||||
$id = $chunk->getBlockId($x, $y, $z);
|
||||
if($id === Block::AIR and $b->isSolid()){
|
||||
break;
|
||||
}
|
||||
if($b->canBeFlowedInto() and BlockFactory::get(ord($column{$y})) instanceof Liquid){
|
||||
if($b->canBeFlowedInto() and BlockFactory::get($id) instanceof Liquid){
|
||||
continue;
|
||||
}
|
||||
if($b->getDamage() === 0){
|
||||
|
Loading…
x
Reference in New Issue
Block a user