fixed BlockFactory consistency test - remapped states are no longer returned by getAllKnownStates()

This commit is contained in:
Dylan K. Taylor 2022-02-07 18:04:02 +00:00
parent fe2c3d08a0
commit c2d3b23449
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -151,8 +151,13 @@ class BlockTest extends TestCase{
$knownStates = $list["knownStates"];
$remaps = $list["remaps"];
$states = $this->blockFactory->getAllKnownStates();
foreach($states as $k => $state){
$states = [];
for($k = 0; $k < 1024 << Block::INTERNAL_METADATA_BITS; $k++){
$state = $this->blockFactory->fromFullBlock($k);
if($state instanceof UnknownBlock){
continue;
}
$states[$k] = $state;
if($state->getFullId() !== $k){
self::assertArrayHasKey($k, $remaps, "New remap of state $k (" . $state->getName() . ") - consistency check may need regenerating");
self::assertSame($state->getFullId(), $remaps[$k], "Mismatched full IDs of remapped state $k");