From bb5fa605a2667c29720ffffdeb853553cf09cd30 Mon Sep 17 00:00:00 2001 From: xGinko Date: Thu, 8 Aug 2024 21:16:22 +0200 Subject: [PATCH] check if blockstate is instanceof skull --- shared/src/main/java/me/xginko/aef/utils/MaterialUtil.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shared/src/main/java/me/xginko/aef/utils/MaterialUtil.java b/shared/src/main/java/me/xginko/aef/utils/MaterialUtil.java index 4084234a..7a426219 100755 --- a/shared/src/main/java/me/xginko/aef/utils/MaterialUtil.java +++ b/shared/src/main/java/me/xginko/aef/utils/MaterialUtil.java @@ -67,7 +67,8 @@ public static boolean isPlayerHead(ItemStack itemStack) { if (itemStack.getItemMeta() instanceof BlockStateMeta) { BlockStateMeta blockStateMeta = (BlockStateMeta) itemStack.getItemMeta(); - return blockStateMeta.hasBlockState() && ((Skull) blockStateMeta.getBlockState()).getSkullType() == SkullType.PLAYER; + if (blockStateMeta.hasBlockState() && blockStateMeta.getBlockState() instanceof Skull) + return ((Skull) blockStateMeta.getBlockState()).getSkullType() == SkullType.PLAYER; } return false;