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

Public Member Functions

 fromStateId (int $stateId)
 
 getAllKnownStates ()
 
 register (Block $block)
 

Public Attributes

array $blastResistance = []
 
array $blocksDirectSkyLight = []
 
array $light = []
 
array $lightFilter = []
 

Detailed Description

Blocks are stored as state IDs in chunks at runtime (it would waste far too much memory to represent every block as an object). This class maps block state IDs to their corresponding block objects when reading blocks from chunks at runtime.

Definition at line 40 of file RuntimeBlockStateRegistry.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\block\RuntimeBlockStateRegistry::__construct ( )

Definition at line 77 of file RuntimeBlockStateRegistry.php.

Member Function Documentation

◆ fromStateId()

pocketmine\block\RuntimeBlockStateRegistry::fromStateId ( int $stateId)

Definition at line 118 of file RuntimeBlockStateRegistry.php.

◆ getAllKnownStates()

pocketmine\block\RuntimeBlockStateRegistry::getAllKnownStates ( )
Returns
Block[] @phpstan-return array<int, Block>

Definition at line 137 of file RuntimeBlockStateRegistry.php.

◆ register()

pocketmine\block\RuntimeBlockStateRegistry::register ( Block $block)

Maps a block type's state permutations to its corresponding state IDs. This is necessary for the block to be recognized when fetching it by its state ID from chunks at runtime.

Exceptions

InvalidArgumentException if the desired block type ID is already registered

Definition at line 89 of file RuntimeBlockStateRegistry.php.

Member Data Documentation

◆ $blastResistance

array pocketmine\block\RuntimeBlockStateRegistry::$blastResistance = []

Definition at line 75 of file RuntimeBlockStateRegistry.php.

◆ $blocksDirectSkyLight

array pocketmine\block\RuntimeBlockStateRegistry::$blocksDirectSkyLight = []

Definition at line 70 of file RuntimeBlockStateRegistry.php.

◆ $light

array pocketmine\block\RuntimeBlockStateRegistry::$light = []

Definition at line 60 of file RuntimeBlockStateRegistry.php.

◆ $lightFilter

array pocketmine\block\RuntimeBlockStateRegistry::$lightFilter = []

Definition at line 65 of file RuntimeBlockStateRegistry.php.


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