IOreDict
The Forge OreDictionary is like a huge Lexicon in the way that it features many different entries and each entry is described by fitting Items.
When talking about ore Dictionarys, people mostly refer to IOreDictEntries not the whole ore Dictionary.
Importing the package
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import.
import crafttweaker.oredict.IOreDict;
How to retrieve the oreDictionary
You can retrieve the OreDictionary using the oreDict
global keyword.
Methods
So what can be done with the oreDict?
Getting an IOreDictEntry
You can use either of the three ways below to refer to an OreDictEntry, no matter if it already exists or not.
If the oreDictEntry does not yet exist, it will be created.
Iterating through all registered IOreDictEntries
How to check if an ore Dictionary entry exists
You can use the in
or has
operator to check if an IOreDictEntry already exists: