SurvivalPlus ResourcePack

SurvivalPlus ResourcePack

5.8k Downloads

Enchantment Helper

TheButterbrotMan opened this issue ยท 6 comments

commented

Major annoying Crash finally figured out.

commented

Not sure if this is my fault or Crooked Crooks, so I've sent an issue on their end. In a similar issue with CrookedCrooks Ennuil explained:

I did find out why: that mod is trying to get the name of the enchantment type of my enchantment, however, since the type is null, it crashes; Due to a lack of an enchantment API, the null that I'm using was the only solution for making it apply to only crooks (and this is a solution that other people use too) So, yeah, if there was a Enchantment API, this wouldn't happen, but yeah; They'll need to workaround the issue by having a null check before touching the enchantment's type

Perhaps a null check on Numismatic Overhaul is needed to prevent this? Anyway, waiting for a reply on my issue mentioned above and then we begin to sort out this mess.

commented

I can provide you a mass of crashlogs if you need. (Theyre all looking nearly same)

commented

This problem isn't directly the fault of anyone, but caused by the fact you inject into getAvailableEnchantmentResults in your EnchantmentHelperMixin at HEAD and unconditionally cancel. As you have already discovered, the folks who use a null EnchantmentTarget are aware of the issue and have their own respective mixins into this method which prevent an NPE. However, since you replace the enchantment selection logic completely without using an @Overwrite, which would be more correct to do here, their mixin does not get triggered but there is also no inject-time conflict. As such, your enchantment logic runs into the same NPE the injections would have usually prevented. I have not yet discerned what your custom logic is doing, but I am positive it could be replaced by injecting at TAIL and modifying the returned list instead of outright replacing it. This is instantly more compatible, especially considering that TAIL injections stack and as such multiple mods can modify the returned list.
I hope this could clear some things up
Cheers

commented

Thanks for the info, it was really helpful! My apologies for the use of fault, didn't mean to point blame but rather a crude way to ask on which end it should have been fixed. Anyway, I fixed the issue on my end with this commit e0dd84d