Skip to content

Item ID vs Translation String #13

@dosluke

Description

@dosluke

hey you have a .tolowercase call on one side of a check but not the other which causes things to fail. string pattern=orString.tolower BUT NOT when final String itemName = in the following function which i believe is the cause of an error im seeing where stuff is randomly not matched in random situations

private boolean canItemPassHopper(final String hopperName, final ItemStack item) {
if (hopperName == null) return true;

    nextCondition: for (final String condition : hopperName.split(",")) {
        nextAnd: for (final String andString : condition.split("&")) {
            for (final String orString : andString.split("\\|")) {
                final String pattern = orString.toLowerCase().strip();
                if (canItemPassPattern(pattern, item)) continue nextAnd;
            }
            continue nextCondition;
        }
        return true;
    }

    return false;
}

private boolean canItemPassPattern(final String pattern, final ItemStack item) {
    final String itemName = item.getType().getKey().getKey();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions