public boolean match(ItemStack item) {
        if (getId() != null && getId() == item.getTypeId()) {
            if (dataId == 0 || dataId == item.getDurability()) {
                return true;
            }
        }

        Material mat = Material.getMaterial(name);
        return (mat != null && mat.getId() == item.getTypeId());
    }