private static Block resolveToBlock(@Nonnull final ItemStack stack) { if (stack == null || stack.isEmpty()) return null; final Item item = stack.getItem(); if (item instanceof ItemBlock) return ((ItemBlock) item).getBlock(); if (item instanceof ItemBlockSpecial) return ((ItemBlockSpecial) item).getBlock(); return null; }