Origins (Forge)

Origins (Forge)

7M Downloads

Can't join server due to: `Internal Exception: java.lang.IllegalArgumentException: Registry ResourceKey[minecraft:root / apoli:configured_power] was missing.`

EmilyBabin opened this issue ยท 7 comments

commented

Internal Exception: java.lang.IllegalArgumentException: Registry ResourceKey[minecraft:root / apoli:configured_power] was missing.

MC - 1.19.2
Forge - 43.2.7
Origins - 1.19.2-1.7.1.0
Caelus API (Forge) - 1.19.2-3.0.0.6

It's really inconsistent. Doesn't happen every time but it happens most times. If we keep persisting we get into the server eventually but sometimes it takes 2-3 tries. Also (unsure if related) sometimes in the game some clients just have their origins disappear. Player A can /set origin to whatever they want just fine, but player B can only /set origin to origins:empty and nothing else. Fixed on relog but still sometimes the Registry error occurs.

commented

You ever get a fix to this?

commented

Nope. A mod author recommended I get the 'spit it out' mod made by Mr Bysco to maybe see what's going on further, but I haven't had the issue since I added the mod. The mod is just supposed to rewrite the disconnect messages to give you more details so it shouldn't fix it but the modpack owner still has the issues and he doesn't have the mod.

commented

Driving me insane. This has been an issue since last year. When will this ever get fixed? And randomly when the server loads all powers and subpowers for some origins are removed. Players are frustrated and I am too at this point.

commented

I'm looking into it now.

commented

This should be fixed next update, although I'm unsure on if it's a proper fix but hey it works.

commented

I've taken another look at this fix, and I think I've made the proper fix now.

Technical Java explanation below

The problem

The ResourceKey class on Mojang's part does not have a proper implementation of the Object#hashCode method. HashMaps use this to check what's in the map, otherwise they'll fallback to equals, which has inaccuracies with getting a value from HashMaps. Which when this doesn't work, it causes this exception.

The solution

The solution was to essentially create a record that stores a ResourceKey that actually has a hashCode implementation this time around. This should then fix the issues with actually getting values from a map, on top of potentially being more performant.

commented

Provided you don't repeatedly run /reload in a short timeframe, consider this bug should be considered fixed next update.