From 19e81b0cd355bdf5863ebc049e8881985a576f00 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 17 Jul 2021 19:06:49 +0100 Subject: [PATCH] BlockFactory: Be aware of potential size changes to metadata bits during testing I found the need to use more bits (for example, bells have 32 states in 1.12). --- src/block/BlockFactory.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/block/BlockFactory.php b/src/block/BlockFactory.php index 69f11dbb1..6da50285e 100644 --- a/src/block/BlockFactory.php +++ b/src/block/BlockFactory.php @@ -94,12 +94,12 @@ class BlockFactory{ public $blastResistance; public function __construct(){ - $this->fullList = new \SplFixedArray(16384); + $this->fullList = new \SplFixedArray(1024 << Block::INTERNAL_METADATA_BITS); - $this->light = \SplFixedArray::fromArray(array_fill(0, 16384, 0)); - $this->lightFilter = \SplFixedArray::fromArray(array_fill(0, 16384, 1)); - $this->blocksDirectSkyLight = \SplFixedArray::fromArray(array_fill(0, 16384, false)); - $this->blastResistance = \SplFixedArray::fromArray(array_fill(0, 16384, 0.0)); + $this->light = \SplFixedArray::fromArray(array_fill(0, 1024 << Block::INTERNAL_METADATA_BITS, 0)); + $this->lightFilter = \SplFixedArray::fromArray(array_fill(0, 1024 << Block::INTERNAL_METADATA_BITS, 1)); + $this->blocksDirectSkyLight = \SplFixedArray::fromArray(array_fill(0, 1024 << Block::INTERNAL_METADATA_BITS, false)); + $this->blastResistance = \SplFixedArray::fromArray(array_fill(0, 1024 << Block::INTERNAL_METADATA_BITS, 0.0)); $railBreakInfo = new BlockBreakInfo(0.7); $this->register(new ActivatorRail(new BID(Ids::ACTIVATOR_RAIL, 0), "Activator Rail", $railBreakInfo));