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).
This commit is contained in:
Dylan K. Taylor 2021-07-17 19:06:49 +01:00
parent 17d0767db5
commit 19e81b0cd3
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -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));