throw new IllegalArgumentException("Can't store air block"); if (!blockState.getBlockType().hasItemType()) { throw new IllegalArgumentException("This block cannot be stored");
public TargetMatcher fromInput(String input) throws TargetMatcherParseException { input = input.toLowerCase().trim(); BlockType blockType = BlockTypes.get(input); if (blockType != null) { if (blockType.hasItemType()) { return new ItemBlockMatcher(blockType); } else { return new BlockMatcher(blockType); } } else { ItemType itemType = ItemTypes.get(input); if (itemType == null) { throw new TargetMatcherParseException("Unknown block or item name: " + input); } return new ItemMatcher(itemType); } } }