summaryrefslogtreecommitdiffstats
path: root/src/test/java/org/bukkit
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-08-02 20:24:56 +1000
committermd_5 <git@md-5.net>2018-08-02 20:24:56 +1000
commit80c43fc1deaa164a5eb85aa779eb26a7deca7287 (patch)
treed8581a51c9bcf1e75d83c525edb21f9d2e8ea24d /src/test/java/org/bukkit
parent272426acd7cfb50978f478f49d835c8541da2a4e (diff)
downloadcraftbukkit-80c43fc1deaa164a5eb85aa779eb26a7deca7287.tar
craftbukkit-80c43fc1deaa164a5eb85aa779eb26a7deca7287.tar.gz
craftbukkit-80c43fc1deaa164a5eb85aa779eb26a7deca7287.tar.lz
craftbukkit-80c43fc1deaa164a5eb85aa779eb26a7deca7287.tar.xz
craftbukkit-80c43fc1deaa164a5eb85aa779eb26a7deca7287.zip
SPIGOT-4214: Catch attempts to create BlockData for items
Diffstat (limited to 'src/test/java/org/bukkit')
-rw-r--r--src/test/java/org/bukkit/BlockDataTest.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/java/org/bukkit/BlockDataTest.java b/src/test/java/org/bukkit/BlockDataTest.java
index bd2c249b..e43de765 100644
--- a/src/test/java/org/bukkit/BlockDataTest.java
+++ b/src/test/java/org/bukkit/BlockDataTest.java
@@ -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));