PocketMine-MP 5.23.3 git-f7687af337d001ddbcc47b8e773f014a33faa662
Loading...
Searching...
No Matches
pocketmine\world\format\SubChunk Class Reference
+ Collaboration diagram for pocketmine\world\format\SubChunk:

Public Member Functions

 __construct (private int $emptyBlockId, private array $blockLayers, private PalettedBlockArray $biomes, private ?LightArray $skyLight=null, private ?LightArray $blockLight=null)
 
 __clone ()
 
 __debugInfo ()
 
 collectGarbage ()
 
 getBiomeArray ()
 
 getBlockLayers ()
 
 getBlockLightArray ()
 
 getBlockSkyLightArray ()
 
 getBlockStateId (int $x, int $y, int $z)
 
 getEmptyBlockId ()
 
 getHighestBlockAt (int $x, int $z)
 
 isEmptyAuthoritative ()
 
 isEmptyFast ()
 
 setBlockLightArray (LightArray $data)
 
 setBlockSkyLightArray (LightArray $data)
 
 setBlockStateId (int $x, int $y, int $z, int $block)
 

Public Attributes

const COORD_BIT_SIZE = 4
 
const COORD_MASK = ~(~0 << self::COORD_BIT_SIZE)
 
const EDGE_LENGTH = 1 << self::COORD_BIT_SIZE
 

Detailed Description

Definition at line 29 of file SubChunk.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\world\format\SubChunk::__construct ( private int $emptyBlockId,
private array $blockLayers,
private PalettedBlockArray $biomes,
private ?LightArray $skyLight = null,
private ?LightArray $blockLight = null )

SubChunk constructor.

Parameters
PalettedBlockArray[]$blockLayers@phpstan-param list<PalettedBlockArray> $blockLayers

Definition at line 40 of file SubChunk.php.

Member Function Documentation

◆ __clone()

pocketmine\world\format\SubChunk::__clone ( )

Definition at line 155 of file SubChunk.php.

◆ __debugInfo()

pocketmine\world\format\SubChunk::__debugInfo ( )
Returns
mixed[]

Definition at line 128 of file SubChunk.php.

◆ collectGarbage()

pocketmine\world\format\SubChunk::collectGarbage ( )

Definition at line 132 of file SubChunk.php.

◆ getBiomeArray()

pocketmine\world\format\SubChunk::getBiomeArray ( )

Definition at line 107 of file SubChunk.php.

◆ getBlockLayers()

pocketmine\world\format\SubChunk::getBlockLayers ( )
Returns
PalettedBlockArray[] @phpstan-return list<PalettedBlockArray>

Definition at line 90 of file SubChunk.php.

◆ getBlockLightArray()

pocketmine\world\format\SubChunk::getBlockLightArray ( )

Definition at line 117 of file SubChunk.php.

◆ getBlockSkyLightArray()

pocketmine\world\format\SubChunk::getBlockSkyLightArray ( )

Definition at line 109 of file SubChunk.php.

◆ getBlockStateId()

pocketmine\world\format\SubChunk::getBlockStateId ( int $x,
int $y,
int $z )

Definition at line 72 of file SubChunk.php.

◆ getEmptyBlockId()

pocketmine\world\format\SubChunk::getEmptyBlockId ( )

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.

Definition at line 70 of file SubChunk.php.

◆ getHighestBlockAt()

pocketmine\world\format\SubChunk::getHighestBlockAt ( int $x,
int $z )

Definition at line 94 of file SubChunk.php.

◆ isEmptyAuthoritative()

pocketmine\world\format\SubChunk::isEmptyAuthoritative ( )

Returns whether this subchunk contains any non-air blocks. This function will do a slow check, usually by garbage collecting first. This is typically useful for disk saving.

Definition at line 53 of file SubChunk.php.

◆ isEmptyFast()

pocketmine\world\format\SubChunk::isEmptyFast ( )

Returns a non-authoritative bool to indicate whether the chunk contains any blocks. This may report non-empty erroneously if the chunk has been modified and not garbage-collected.

Definition at line 62 of file SubChunk.php.

◆ setBlockLightArray()

pocketmine\world\format\SubChunk::setBlockLightArray ( LightArray $data)

Definition at line 121 of file SubChunk.php.

◆ setBlockSkyLightArray()

pocketmine\world\format\SubChunk::setBlockSkyLightArray ( LightArray $data)

Definition at line 113 of file SubChunk.php.

◆ setBlockStateId()

pocketmine\world\format\SubChunk::setBlockStateId ( int $x,
int $y,
int $z,
int $block )

Definition at line 79 of file SubChunk.php.

Member Data Documentation

◆ COORD_BIT_SIZE

const pocketmine\world\format\SubChunk::COORD_BIT_SIZE = 4

Definition at line 30 of file SubChunk.php.

◆ COORD_MASK

const pocketmine\world\format\SubChunk::COORD_MASK = ~(~0 << self::COORD_BIT_SIZE)

Definition at line 31 of file SubChunk.php.

◆ EDGE_LENGTH

const pocketmine\world\format\SubChunk::EDGE_LENGTH = 1 << self::COORD_BIT_SIZE

Definition at line 32 of file SubChunk.php.


The documentation for this class was generated from the following file: