Astral Sorcery

Astral Sorcery

63M Downloads

Ore Dict entries might be registered too late

tommyTT opened this issue ยท 3 comments

commented

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:

  1. Make a new CraftTweaker script that contains the following code:
print("OreDict entries for gemAquamarine:");
for item in <ore:gemAquamarine>.items {
  print(item.name);
}
  1. Start Minecraft with Astral Sorcery and CraftTweaker installed.
  2. 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

commented

Moved oredict registration directly after item registration now during registry-init

commented

There's been a lot of changes with CT stuff. Please update to AS 1.10.9 or later and reproduce.

commented

Same result with the latest versions of everything (as available on CurseForge):

Minecraft: 1.12.2
Forge: 14.23.5.2796
Astral Sorcery: 1.10.9
CraftTweaker: 4.1.13