SPIGOT-4214: Catch attempts to create BlockData for items

This commit is contained in:
md_5
2018-08-02 20:24:56 +10:00
parent 272426acd7
commit 80c43fc1de
3 changed files with 13 additions and 0 deletions

View File

@@ -51,6 +51,16 @@ public class BlockDataTest extends AbstractTestingBase {
CraftBlockData.newData(Material.CAKE, cakeTest.toString());
}
@Test(expected = IllegalArgumentException.class)
public void testItem() {
CraftBlockData.newData(Material.DIAMOND_AXE, null);
}
@Test(expected = IllegalArgumentException.class)
public void testItemParse() {
CraftBlockData.newData(null, "minecraft:diamond_axe");
}
@Test
public void testClone() {
Cake cakeTest = (Cake) CraftBlockData.fromData(Blocks.CAKE.getBlockData().set(BlockCake.BITES, 3));