Skip to content

Commit

Permalink
check if blockstate is instanceof skull
Browse files Browse the repository at this point in the history
  • Loading branch information
xGinko committed Aug 8, 2024
1 parent f9dfc14 commit bb5fa60
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion shared/src/main/java/me/xginko/aef/utils/MaterialUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bb5fa60

Please sign in to comment.