Ore Dict entries might be registered too late
tommyTT opened this issue ยท 3 comments
Issue Description:
The ore dictionary entries from Astral Sorcery are empty when being accessed by a CraftTweaker script.
What happens:
In my CraftTweaker script I need to iterate through the items of certain ore dictionary entries, e.g. "gemAquamarine". This entry however doesn't have any items associated with it.
What you expected to happen:
When CraftTweaker runs the scripts the ore dictionary entries should be fully initialized from the Astral Sorcery mod itself.
Steps to reproduce:
- Make a new CraftTweaker script that contains the following code:
print("OreDict entries for gemAquamarine:");
for item in <ore:gemAquamarine>.items {
print(item.name);
}
- Start Minecraft with Astral Sorcery and CraftTweaker installed.
- Look into the crafttweaker.log file for the output.
This should print the name of the aquamarine item to the log file, but no iteration happens since the items from the mod are not yet registered.
Analysis
Looking at the Astral Sorcery code, I found that the ore dictionary items are registered during the Init phase of Forge. The Forge Docs however suggest, this should happen during the PreInit phase after initializing the blocks and items. Please check to see, if the registration can/should be moved according to the documentation or if this needs to stay this way.
Affected Versions:
Minecraft: 1.12.2
Forge: 14.23.5.2780
Astral Sorcery: 1.10.3
CraftTweaker: 4.1.13
Moved oredict registration directly after item registration now during registry-init
There's been a lot of changes with CT stuff. Please update to AS 1.10.9 or later and reproduce.