mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Level: fixed randomTickBlocks, also delete some useless code
the randomTickBlocks thing is populated with state IDs anyway, not variants...
This commit is contained in:
@ -51,9 +51,6 @@ class BlockFactory{
|
||||
/** @var \SplFixedArray<float> */
|
||||
public static $blastResistance = null;
|
||||
|
||||
/** @var \SplFixedArray|int[] */
|
||||
private static $stateMasks = null;
|
||||
|
||||
/** @var int[] */
|
||||
public static $staticRuntimeIdMap = [];
|
||||
|
||||
@ -74,8 +71,6 @@ class BlockFactory{
|
||||
self::$diffusesSkyLight = \SplFixedArray::fromArray(array_fill(0, 8192, false));
|
||||
self::$blastResistance = \SplFixedArray::fromArray(array_fill(0, 8192, 0));
|
||||
|
||||
self::$stateMasks = new \SplFixedArray(8192);
|
||||
|
||||
self::register(new ActivatorRail(new BID(Block::ACTIVATOR_RAIL, BaseRail::STRAIGHT_NORTH_SOUTH), "Activator Rail"));
|
||||
self::register(new Air(new BID(Block::AIR), "Air"));
|
||||
self::register(new Anvil(new BID(Block::ANVIL, Anvil::TYPE_NORMAL), "Anvil"));
|
||||
@ -575,7 +570,6 @@ class BlockFactory{
|
||||
|
||||
private static function fillStaticArrays(int $index, Block $block) : void{
|
||||
self::$fullList[$index] = $block;
|
||||
self::$stateMasks[$index] = $block->getStateBitmask();
|
||||
self::$lightFilter[$index] = min(15, $block->getLightFilter() + 1); //opacity plus 1 standard light filter
|
||||
self::$diffusesSkyLight[$index] = $block->diffusesSkyLight();
|
||||
self::$blastResistance[$index] = $block->getBlastResistance();
|
||||
@ -621,10 +615,6 @@ class BlockFactory{
|
||||
return self::get($fullState >> 4, $fullState & 0xf, $pos);
|
||||
}
|
||||
|
||||
public static function getStateMask(int $id) : int{
|
||||
return self::$stateMasks[$id] ?? 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether a specified block state is already registered in the block factory.
|
||||
*
|
||||
|
Reference in New Issue
Block a user