/** * Gets whether this item type has a block representation. * * @return If it has a block */ public boolean hasBlockType() { return getBlockType() != null; }
@Override public BaseBlock getBlockInHand(HandSide handSide) throws WorldEditException { final ItemType typeId = getItemInHand(handSide).getType(); if (typeId.hasBlockType()) { return typeId.getBlockType().getDefaultState().toBaseBlock(); } else { throw new NotABlockException(); } }