PocketMine-MP 5.25.1 git-694aa17cc916a954b10fe12721c81b1dc73eecd5
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 $collisionInfo = []
 
array $light = []
 
array $lightFilter = []
 
const COLLISION_CUBE = 1
 
const COLLISION_CUSTOM = 0
 
const COLLISION_MAY_OVERFLOW = 3
 
const COLLISION_NONE = 2
 

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 41 of file RuntimeBlockStateRegistry.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\block\RuntimeBlockStateRegistry::__construct ( )

Definition at line 90 of file RuntimeBlockStateRegistry.php.

Member Function Documentation

◆ fromStateId()

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

Definition at line 197 of file RuntimeBlockStateRegistry.php.

◆ getAllKnownStates()

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

Definition at line 216 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 102 of file RuntimeBlockStateRegistry.php.

Member Data Documentation

◆ $blastResistance

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

Definition at line 81 of file RuntimeBlockStateRegistry.php.

◆ $blocksDirectSkyLight

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

Definition at line 76 of file RuntimeBlockStateRegistry.php.

◆ $collisionInfo

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

Definition at line 88 of file RuntimeBlockStateRegistry.php.

◆ $light

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

Definition at line 66 of file RuntimeBlockStateRegistry.php.

◆ $lightFilter

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

Definition at line 71 of file RuntimeBlockStateRegistry.php.

◆ COLLISION_CUBE

const pocketmine\block\RuntimeBlockStateRegistry::COLLISION_CUBE = 1

Definition at line 45 of file RuntimeBlockStateRegistry.php.

◆ COLLISION_CUSTOM

const pocketmine\block\RuntimeBlockStateRegistry::COLLISION_CUSTOM = 0

Definition at line 44 of file RuntimeBlockStateRegistry.php.

◆ COLLISION_MAY_OVERFLOW

const pocketmine\block\RuntimeBlockStateRegistry::COLLISION_MAY_OVERFLOW = 3

Definition at line 47 of file RuntimeBlockStateRegistry.php.

◆ COLLISION_NONE

const pocketmine\block\RuntimeBlockStateRegistry::COLLISION_NONE = 2

Definition at line 46 of file RuntimeBlockStateRegistry.php.


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