mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-03 08:35:20 +00:00
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:
@ -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));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user