Fixed crash when getting an item from a block which came from an item which came from a block

had a stroke yet?
This commit is contained in:
Dylan K. Taylor
2023-06-02 16:16:54 +01:00
parent 007ef833d4
commit 9c6d4093ae
2 changed files with 11 additions and 1 deletions

View File

@ -124,4 +124,12 @@ class BlockTest extends TestCase{
$block = $this->blockFactory->fromStateId(Block::EMPTY_STATE_ID);
self::assertInstanceOf(Air::class, $block);
}
public function testAsItemFromItem() : void{
$block = VanillaBlocks::FLOWER_POT();
$item = $block->asItem();
$defaultBlock = $item->getBlock();
$item2 = $defaultBlock->asItem();
self::assertTrue($item2->equalsExact($item));
}
}