summaryrefslogtreecommitdiffstats
path: root/src/test/java
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-11-16 15:18:28 +1100
committermd_5 <git@md-5.net>2018-11-16 15:18:28 +1100
commitb1d149cfd00b5715474feb304d1bbc8fdffa9bd1 (patch)
tree73256a37fb804d8125143b1756458a6383cff438 /src/test/java
parentc2035aa1d045bfa22fde511c50283b2494cca00e (diff)
downloadcraftbukkit-b1d149cfd00b5715474feb304d1bbc8fdffa9bd1.tar
craftbukkit-b1d149cfd00b5715474feb304d1bbc8fdffa9bd1.tar.gz
craftbukkit-b1d149cfd00b5715474feb304d1bbc8fdffa9bd1.tar.lz
craftbukkit-b1d149cfd00b5715474feb304d1bbc8fdffa9bd1.tar.xz
craftbukkit-b1d149cfd00b5715474feb304d1bbc8fdffa9bd1.zip
SPIGOT-4489: NOTE_BLOCK incorrectly has BlockStateMeta
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
index d4f8e8c3..65b8123a 100644
--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
+++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
@@ -175,21 +175,23 @@ public class ItemMetaTest extends AbstractTestingBase {
for (Block block : queue) {
if (block != null) {
- if (block instanceof ITileEntity) {
- ItemStack stack = CraftItemStack.asNewCraftStack(Item.getItemOf(block));
+ ItemStack stack = CraftItemStack.asNewCraftStack(Item.getItemOf(block));
- // Command blocks aren't unit testable atm
- if (stack.getType() == Material.COMMAND_BLOCK || stack.getType() == Material.CHAIN_COMMAND_BLOCK || stack.getType() == Material.REPEATING_COMMAND_BLOCK) {
- return;
- }
+ // Command blocks aren't unit testable atm
+ if (stack.getType() == Material.COMMAND_BLOCK || stack.getType() == Material.CHAIN_COMMAND_BLOCK || stack.getType() == Material.REPEATING_COMMAND_BLOCK) {
+ return;
+ }
- ItemMeta meta = stack.getItemMeta();
+ ItemMeta meta = stack.getItemMeta();
+ if (block instanceof ITileEntity) {
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());
+ } else {
+ assertTrue(stack + " has unexpected meta of type BlockStateMeta (but is not a tile)", !(meta instanceof BlockStateMeta));
}
}
}