mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-08-30 23:11:06 +00:00
fixed BlockFactory consistency test - remapped states are no longer returned by getAllKnownStates()
This commit is contained in:
parent
fe2c3d08a0
commit
c2d3b23449
@ -151,8 +151,13 @@ class BlockTest extends TestCase{
|
|||||||
$knownStates = $list["knownStates"];
|
$knownStates = $list["knownStates"];
|
||||||
$remaps = $list["remaps"];
|
$remaps = $list["remaps"];
|
||||||
|
|
||||||
$states = $this->blockFactory->getAllKnownStates();
|
$states = [];
|
||||||
foreach($states as $k => $state){
|
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){
|
if($state->getFullId() !== $k){
|
||||||
self::assertArrayHasKey($k, $remaps, "New remap of state $k (" . $state->getName() . ") - consistency check may need regenerating");
|
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");
|
self::assertSame($state->getFullId(), $remaps[$k], "Mismatched full IDs of remapped state $k");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user