Skip to content

Commit

Permalink
Fix Forge complaining about OreDictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
ThexXTURBOXx committed Feb 13, 2025
1 parent 957225f commit d34c51a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/main/java/com/mr208/ExpandedArmory/ExpandedArmory.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.mr208.ExpandedArmory.Botania.BotaniaIntegration;
import com.mr208.ExpandedArmory.FSP.FSPIntegration;
import com.mr208.ExpandedArmory.Items.GenericIntegration;
import com.mr208.ExpandedArmory.Items.ItemIngot;
import com.mr208.ExpandedArmory.Proxy.EACommonProxy;
import com.mr208.ExpandedArmory.SimpleOres.SimpleOreIntegration;
import com.mr208.ExpandedArmory.Thaumcraft.ThaumcraftIntegration;
Expand Down Expand Up @@ -50,6 +51,8 @@ public void preInit(FMLPreInitializationEvent event) {
if (ExArmConfig.enableFSP && Loader.isModLoaded("Steamcraft"))
FSPIntegration.preInitFSP();
GenericIntegration.preInitGI();

ItemIngot.registerOreDictionary();
}

@Mod.EventHandler
Expand Down
11 changes: 10 additions & 1 deletion src/main/java/com/mr208/ExpandedArmory/Items/ItemIngot.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.mr208.ExpandedArmory.Items;

import java.util.HashMap;
import java.util.Map;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraftforge.oredict.OreDictionary;
Expand All @@ -8,11 +10,18 @@

public class ItemIngot extends Item {

public static final Map<String, ItemIngot> ITEM_INGOTS = new HashMap<>();

public ItemIngot(String oreDict) {
ITEM_INGOTS.put(oreDict, this);
this.setUnlocalizedName(MOD_ID + "_" + oreDict);
this.setCreativeTab(CreativeTabs.tabMaterials);
this.setTextureName(MOD_ID + ":" + oreDict);
OreDictionary.registerOre(oreDict, this);
}

public static void registerOreDictionary() {
for (String oreDict : ITEM_INGOTS.keySet())
OreDictionary.registerOre(oreDict, ITEM_INGOTS.get(oreDict));
}

}

0 comments on commit d34c51a

Please sign in to comment.