Golem Registration Order
IcarussOne opened this issue ยท 2 comments
I'm planning to implement new golem materials in my addon, but I've heard there is an issue with how golems in existing worlds would change materials because of the registration order. Would really be nice to have a fix for this. :)
This is a hard one - Thaumcraft internally references golem materials by a byte ID. That ID is assigned on a first-come first-serve basis, which is where the registration order issue comes from. Even worse is that Thaumcraft includes its own materials in a static initializer in GolemProperties, which other than setting a bad example can cause addons to register before Thaumcraft depending on when that class is loaded.
TC Fix already has the basic fix that forces Thaumcraft to register its materials at a consistent, early point (many addons also have this fix, as I was giving it out to anyone having golem issues - multiple things having it is fine). This doesn't do anything for addons, so adding/removing addons can break other addon golem materials in existing worlds. The real fix would be changing golem registrations to use namespaced IDs like Minecraft uses for blocks, items, etc, which then internally get mapped to integer IDs on a per-world basis.
With that basic fix in already, it has already improved this issue by a good amount. Thanks for the detailed info, it should be fine for the most part as long as addons don't get added/removed in the middle of a playthrough or a modpack.
Hopefully a full fix is figured out by then but if not that's fine!