use of net.minecraft.server.v1_12_R1.ItemReed in project PaperDev by Kamillaova.
the class ItemMetaTest method testBlockStateMeta.
@Test
public void testBlockStateMeta() {
for (Item item : (Iterable<Item>) Item.REGISTRY) {
Block block = null;
if (item instanceof ItemBlock) {
block = ((ItemBlock) item).getBlock();
} else if (item instanceof ItemReed) {
block = ((ItemReed) item).a;
}
if (block != null) {
if (block instanceof ITileEntity) {
ItemStack stack = CraftItemStack.asNewCraftStack(Item.getItemOf(block));
// Command blocks aren't unit testable atm
if (stack.getType() == Material.AIR || stack.getType() == Material.COMMAND || stack.getType() == Material.COMMAND_CHAIN || stack.getType() == Material.COMMAND_REPEATING) {
return;
}
ItemMeta meta = stack.getItemMeta();
assertTrue(stack + " has meta of type " + meta + " expected BlockStateMeta", meta instanceof BlockStateMeta);
BlockStateMeta blockState = (BlockStateMeta) meta;
assertNotNull(stack + " has null block state", blockState.getBlockState());
blockState.setBlockState(blockState.getBlockState());
}
}
}
}
Aggregations