[Crash] ... null oredict name
Laike-Endaril opened this issue ยท 2 comments
Version Info
- Minecraft, ... 1.12.2
- Core Lib, ... 1.1.18
Steps to Reproduce
(Easiest / most obvious to see the result is to adapt the code block below and temporarily add it to your dev environment)
...
Crash report (~/logs/latest.log)
(Not relevant in this case; crash was indirect)
...
Somehow, the combination of this mod and Aesthetics (the mod, not the modpack) adds a null name to the oredict list. I have no idea what the exact interaction is, so I'm posting on both trackers.
I ran into this when my Set Bonus mod crashed somewhere I didn't expect it to, which ended up being due to the null in the oredict that I'm talking about. I ended up finding it for sure with this code:
String[] oreDictNames = OreDictionary.getOreNames();
for (int i = lastCacheOreDictSize; i < oreDictNames.length; i++)
{
System.out.println(oreDictNames[i]);
if (Pattern.matches(itemRegex, oreDictNames[i])) matchingOredictIDs.add(i);
}Which prints null immediately before the crash which happens on the next line. I'm going to sanitize my inputs better so that Set Bonus doesn't crash from it, but it could cause unknown, indirect compat issues with other mods.
It seems to have been caused by my OredictItemPredicate mixin. I am not completely sure why it didn't work or wasn't throwing an error about the shadow field before, but the change in b762f6a seems to fix the issue.
It would put null into the ore dictionary whenever an OredictItemPredicate was evaluated. I would guess that Aesthetics just happens to use such a predicate, hence triggering the issue. Anyways, the issue was not caused by Aesthetics specifically, just my core library and any mod using an OredictItemPredicate.
It should be fixed now in version 1.1.18a of my core library for Forge 1.12.
Thank you for reporting the issue!
Link to the issue on the other relevant mod's tracker: Sinhika/Aesthetics#6