diff --git a/src/pocketmine/block/BlockFactory.php b/src/pocketmine/block/BlockFactory.php index 80beb0769..939a25931 100644 --- a/src/pocketmine/block/BlockFactory.php +++ b/src/pocketmine/block/BlockFactory.php @@ -51,9 +51,6 @@ class BlockFactory{ /** @var \SplFixedArray */ 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. * diff --git a/src/pocketmine/level/Level.php b/src/pocketmine/level/Level.php index 4a3c52489..7d4f06a89 100644 --- a/src/pocketmine/level/Level.php +++ b/src/pocketmine/level/Level.php @@ -1085,7 +1085,7 @@ class Level implements ChunkManager, Metadatable{ $state = $subChunk->getFullBlock($x, $y, $z); - if($this->randomTickBlocks[$state & ~BlockFactory::getStateMask($state >> 4)]){ + if($this->randomTickBlocks[$state]){ /** @var Block $block */ $block = BlockFactory::fromFullBlock($state, $this->temporalPosition->setComponents( $chunkX * 16 + $x,