TerraformersMC / Campanion

A camping companion mod that adds items and utilities to improve your life away from home
GNU Lesser General Public License v3.0
81 stars 31 forks source link

Loyalty can't be applied to tridents #85

Closed copygirl closed 3 years ago

copygirl commented 4 years ago

Due to the mixin to Enchantment.isAcceptableItem, loyalty can't be put on any item anymore including Vanilla tridents.

Additionally, one question: One of my friends was hoping loyalty could be put on spears. Is this not supposed to be possible?

Prospector commented 4 years ago

Ah, yeah that is a problem. Also yes, loyalty isn't supposed to be able to be put on spears, but piercing should. The enchantments are super bugged though, definitely need to fix that.

ghost commented 4 years ago

I'm just gonna link this so when I get around to tweaking the PR we can look into addressing this again https://github.com/FabricMC/fabric/pull/1102

copygirl commented 4 years ago

Depending on how long it will take for the PR to be included, a simple fix could still be applied to the mixin in Campanion.

Not that it's a huge issue for me personally. As the server owner I just went into creative and applied the enchantment that way. But players not able or willing to "cheat" this way might be affected. Loyalty is arguably the most important enchantment on tridents.

edit: Something along the lines of:

if (stack.getItem() instanceof SpearItem) {
    if ((Object) this == Enchantments.PIERCING || (Object) this == Enchantments.IMPALING) {
        info.setReturnValue(true);
    } else if ((Object) this == Enchantments.LOYALTY) {
        info.setReturnValue(false);
    }
}
Wyn-Price commented 3 years ago

Fixed in https://github.com/TerraformersMC/Campanion/commit/d5d100bbb6225ea33999a866cf42762f9fe83585