PocketMine-MP 5.21.2 git-a6534ecbbbcf369264567d27e5ed70f7f5be9816
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 30 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

Definition at line 40 of file SubChunk.php.

Member Function Documentation

◆ __clone()

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

Definition at line 153 of file SubChunk.php.

◆ __debugInfo()

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

Definition at line 127 of file SubChunk.php.

◆ collectGarbage()

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

Definition at line 131 of file SubChunk.php.

◆ getBiomeArray()

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

Definition at line 106 of file SubChunk.php.

◆ getBlockLayers()

pocketmine\world\format\SubChunk::getBlockLayers ( )
Returns
PalettedBlockArray[]

Definition at line 89 of file SubChunk.php.

◆ getBlockLightArray()

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

Definition at line 116 of file SubChunk.php.

◆ getBlockSkyLightArray()

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

Definition at line 108 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 93 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 120 of file SubChunk.php.

◆ setBlockSkyLightArray()

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

Definition at line 112 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 31 of file SubChunk.php.

◆ COORD_MASK

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

Definition at line 32 of file SubChunk.php.

◆ EDGE_LENGTH

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

Definition at line 33 of file SubChunk.php.


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