Closed Foreck1 closed 2 years ago
Reproduced minimally: https://gist.github.com/codetaylor/9858ee82ab257397b565dc138a083e92
This has a two-factor causation:
This created a unique case where both the capability reference for LemonLib and Pyrotech is not injected by the CapabilityManager and both references are null. Then, when LemonLib asks for the capability matching its reference, null
, Pyrotech's capability was being returned because its reference was also null
, matching, and it happened to be in the list before LemonLib's capability.
The only reason that LemonLib's capability retrieval works is because it is the only capability reference in your entire mod list that is null
. When it asks for the capability matching null
, its reference is null
and it matches. Pyrotech came along and threw a wrench in the mix by not properly registering its capability, subsequently also matching null
.
In stand-alone testing of Pyrotech, the null
referenced capability worked just fine because, again, it was the only null
referenced capability in the mod list.
Fixed in 1.12.2-1.6.0-RC2
Issue Description
Hunting module crashes with LemonLib on world creation
What Happens
java.lang.ClassCastException: com.codetaylor.mc.pyrotech.modules.hunting.capability.SpearEntityData cannot be cast to party.lemons.lemonlib.handler.cooldown.ICooldownHandler
What You Expect to Happen
Script
-
Crash Log
https://gist.github.com/Foreck1/424540403192e0d5983d1f125aeeddc7
Affected Versions