src/main/java/com/github/klikli_dev/occultism/util/StorageUtil.java
/**
     * Checks if stack matches the given tag filter (wildcard match)
     */
Checks if stack matches the given tag filter (wildcard match)
Checks if stack matches the given tag filter ( wildcard match )
public static boolean matchesFilter(ItemStack stack, String tagFilter) {
        if (tagFilter.isEmpty())
            return false;
        String[] filters = tagFilter.split(";");
        for (String filter : filters) {
            boolean equals = stack.getItem().getTags().stream().anyMatch(rl -> {
                return FilenameUtils.wildcardMatch(rl.toString(), filter, IOCase.INSENSITIVE);
            });
            if (equals) {
                return true;
            }
        }
        return false;
    }
public static boolean matchesFilter ( ItemStack stack , String tagFilter ) { if ( tagFilter . isEmpty ( ) ) return false ; String [ ] filters = tagFilter . split ( ";" ) ; for ( String filter : filters ) { boolean equals = stack . getItem ( ) . getTags ( ) . stream ( ) . anyMatch ( rl -> { return FilenameUtils . wildcardMatch ( rl . toString ( ) , filter , IOCase . INSENSITIVE ) ; } ) ; if ( equals ) { return true ; } } return false ; }
Checks if stack matches the given tag filter (wildcard match)
Checks if stack matches the given tag filter ( wildcard match )