Universal Graves

Universal Graves

3M Downloads

Error code about blocked_enchantments in configuration

iMoonDay opened this issue ยท 0 comments

commented

Hello, I'm the developer of the Soulbound mod.
Upon player feedback, I've noticed that there seems to be an issue with GraveUtils#hasSkippedEnchantment in your mod.
The skippedEnchantments is a Identifier collection, and you test for containment directly with a string, resulting in always returning false.
I don't know if this method is actually wrong, but it always returns false when I test it.

public static boolean hasSkippedEnchantment(ItemStack stack) {
        var config = ConfigManager.getConfig();
        for (var enchant : stack.getEnchantments().getEnchantments()) {
            //Here is the string type.
            var key = enchant.getKey().get().getValue().toString();
            if (key != null && config.storage.skippedEnchantments.contains(key)) {
                return true;
            }

        }
        return false;
    }
//Here is the identifier type.
@SerializedName("blocked_enchantments")
public Set<Identifier> skippedEnchantments = new HashSet<>();