Call one of the overloads of OreDictionary.registerOre in the init phase with the Block, Item or ItemStack you want to add to the Ore Dictionary and the ore name to add it under (e.g. oreCopper, gemRuby, ingotBrass).
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Call one of the overloads of OreDictionary.registerOre in the init phase with the Block, Item or ItemStack you want to add to the Ore Dictionary and the ore name to add it under (e.g. oreCopper, gemRuby, ingotBrass).
Can i put the ore registration in the main class or not...
Can i put the ore registration in the main class or not...
You can call OreDictionary.registerOre from any class as long as it's done in the init phase (i.e. called from the @EventHandler method with the FMLInitializationEvent argument). I'd recommend creating a class that adds all of your mod's recipes and adding any Ore Dictionary entries in there as well.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
You can call OreDictionary.registerOre from any class as long as it's done in the init phase (i.e. called from the @EventHandler method with the FMLInitializationEvent argument). I'd recommend creating a class that adds all of your mod's recipes and adding any Ore Dictionary entries in there as well.
thanks, it worked! I'm begginer in mod creation! XD
public static Item "pyriteNugget"
public void OreDictionary()
OreDictionary.registerOre("blockGold", Amass.pyriteBlock);
OreDictionary.registerOre("nuggetGold", new ItemStack(pyriteNugget));
@Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION)
public class Amass
{
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event)
{
ModItems.init();
ModBlocks.init();
oreDictionary();
//it is posible to replace loadItems with init
}
@Mod.EventHandler
public void Init(FMLInitializationEvent event)
{
public static Item "pyriteNugget"
public void OreDictionary()
{
OreDictionary.registerOre(pyriteNugget){
nuggetPyrite
}
}
OreDictionary.registerOre("blockGold", Amass.pyriteBlock);
OreDictionary.registerOre("nuggetGold", new ItemStack(pyriteNugget));
}
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent event)
{
public class ModItems
{
public static Item pyriteNugget = new AmassItem().setUnlocalizedName("pyriteNugget");
public static Item pyriteIngot = new AmassItem().setUnlocalizedName("pyriteIngot");
public static void init()
{
RegisterHelper.registerItem(pyriteIngot);
RegisterHelper.registerItem(pyriteNugget);
}
}
public class RegisterHelper
{
public static void registerBlock(Block block)
{
GameRegistry.registerBlock(block, Reference.MODID + block.getUnlocalizedName().substring(5));
}
public static Item "pyriteNugget"
public void OreDictionary()
OreDictionary.registerOre("blockGold", Amass.pyriteBlock);
OreDictionary.registerOre("nuggetGold", new ItemStack(pyriteNugget));
What you've posted isn't even valid Java. You can't make a mod until you have a solid understanding of Java.
There are three overloads of OreDictionary.registerOre: All of them take a String (the ore name) as the first argument and an Item, Block or ItemStack (the item/block to register) as the second argument.
The first two statements in the OreDictionary method are valid, the third isn't.
Side note: Methods should be camelCase and start with a verb, e.g. doSomething rather than Something.
I would also recommend updating to 1.8.9. Forge for 1.9 will released properly soon, 1.7.10 will be extremely outdated at that point.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I'm also new to [1.8] modding, and would like some help. I've looked at the OreDictionary class and understand somewhat. Here's what I have (in my recipe handler class)
// OreDictionary
private static boolean hasInit = false;
private static List<String> idToName = new ArrayList<String>();
private static Map<String, Integer> nameToId = new HashMap<String, Integer>(128);
private static List<List<ItemStack>> idToStack = Lists.newArrayList();
private static List<List<ItemStack>> idToStackUn = Lists.newArrayList();
private static Map<Integer, List<Integer>> stackToId = Maps.newHashMapWithExpectedSize((int)(128 * 0.75));
public static final ImmutableList<ItemStack> EMPTY_LIST = ImmutableList.of();
public static final int WILDCARD_VALUE = Short.MAX_VALUE;
private static void registerOre(String string, ItemStack itemStack){}
static {
initVanillaEntries();
}
public static void initVanillaEntries()
{
if (!hasInit)
{
registerOre("drinkMilk", new ItemStack(Items.milk_bucket));
registerOre("drinkMilk", new ItemStack(ModItems.bottled_milk));
}
This seems right to me but I'd like a second opinion.
Don't copy and paste random parts of the Ore Dictionary code into your class. All you need to do is call one of the overloads of OreDictionary.registerOre.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Ah, well... hate to sound like a total newbie but how do I do that exactly?
Yes, yes, I know "Learn java before modding minecraft" but this is how people learn in general, by asking others on forums and I figured I'd learn java by modding that way I'm doing something I enjoy and can share with the community while learning a new skill.
Was there a particular part of my post you didn't understand?
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
As I said in post #7, OreDictionary.registerOre is a method with three different overloads. You need to call this method with the appropriate arguments, i.e. a String (the ore name) and a Block, Item or ItemStack (the ore).
This page briefly explains method overloading. This page briefly explains method calling. These are fundamental concepts that you need to know before you make a mod.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
this is an old thread for 1.7, but it discusses something i have a question on. i am not a modder. but today i noticed wood from trees added by the biom o'plenty mod aren't treated as wood by thermal dynamics filters. how do i add the woods added by the mod in the ore dictionary? is there a simple document explaining it for non-programmers?
note that i am playing on a 1.12 modpack (direwolf)
this is an old thread for 1.7, but it discusses something i have a question on. i am not a modder. but today i noticed wood from trees added by the biom o'plenty mod aren't treated as wood by thermal dynamics filters. how do i add the woods added by the mod in the ore dictionary? is there a simple document explaining it for non-programmers?
note that i am playing on a 1.12 modpack (direwolf)
The Ore Dictionary is generally configured by mods, not users.
You may be able to use something like CraftTweaker to add items to the Ore Dictionary, but I'm not very familiar with it myself.
If you're sure that they aren't in the Ore Dictionary, you may want to report this to the authors of BoP so that they can fix it themselves.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
[HELP] Adding an ore to Ore Dictionary [1.7.10]
[FORGE]
I need help to add an modded ore to OreDic.
Minecraft----> modded Minecraft 1.7.10
Program-----> Eclipse
Call one of the overloads of OreDictionary.registerOre in the init phase with the Block, Item or ItemStack you want to add to the Ore Dictionary and the ore name to add it under (e.g. oreCopper, gemRuby, ingotBrass).
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Can i put the ore registration in the main class or not...
You can call OreDictionary.registerOre from any class as long as it's done in the init phase (i.e. called from the @EventHandler method with the FMLInitializationEvent argument). I'd recommend creating a class that adds all of your mod's recipes and adding any Ore Dictionary entries in there as well.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
thanks, it worked! I'm begginer in mod creation! XD
Um, how do you do that? Like this?
public static Item "pyriteNugget"
public void OreDictionary()
OreDictionary.registerOre("blockGold", Amass.pyriteBlock);
OreDictionary.registerOre("nuggetGold", new ItemStack(pyriteNugget));
OreDictionary.registerOre(pyriteNugget){
nuggetPyrite
}
This is my code
package com.gmail.zahoover.Amass;
import com.gmail.zahoover.Amass.help.Reference;
import com.gmail.zahoover.Amass.init.ModBlocks;
import com.gmail.zahoover.Amass.init.ModItems;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
@Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION)
public class Amass
{
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event)
{
ModItems.init();
ModBlocks.init();
oreDictionary();
//it is posible to replace loadItems with init
}
@Mod.EventHandler
public void Init(FMLInitializationEvent event)
{
public static Item "pyriteNugget"
public void OreDictionary()
{
OreDictionary.registerOre(pyriteNugget){
nuggetPyrite
}
}
OreDictionary.registerOre("blockGold", Amass.pyriteBlock);
OreDictionary.registerOre("nuggetGold", new ItemStack(pyriteNugget));
}
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent event)
{
}
}
package com.gmail.zahoover.Amass.init;
import com.gmail.zahoover.Amass.help.RegisterHelper;
import com.gmail.zahoover.Amass.items.AmassItem;
import net.minecraft.item.Item;
public class ModItems
{
public static Item pyriteNugget = new AmassItem().setUnlocalizedName("pyriteNugget");
public static Item pyriteIngot = new AmassItem().setUnlocalizedName("pyriteIngot");
public static void init()
{
RegisterHelper.registerItem(pyriteIngot);
RegisterHelper.registerItem(pyriteNugget);
}
}
package com.gmail.zahoover.Amass.help;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
public class RegisterHelper
{
public static void registerBlock(Block block)
{
GameRegistry.registerBlock(block, Reference.MODID + block.getUnlocalizedName().substring(5));
}
public static void registerItem(Item item)
{
GameRegistry.registerItem(item, Reference.MODID + item.getUnlocalizedName().substring(5));
}
}
What you've posted isn't even valid Java. You can't make a mod until you have a solid understanding of Java.
There are three overloads of OreDictionary.registerOre: All of them take a String (the ore name) as the first argument and an Item, Block or ItemStack (the item/block to register) as the second argument.
The first two statements in the OreDictionary method are valid, the third isn't.
Side note: Methods should be camelCase and start with a verb, e.g. doSomething rather than Something.
I would also recommend updating to 1.8.9. Forge for 1.9 will released properly soon, 1.7.10 will be extremely outdated at that point.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I'm also new to [1.8] modding, and would like some help. I've looked at the OreDictionary class and understand somewhat. Here's what I have (in my recipe handler class)
This seems right to me but I'd like a second opinion.
Don't copy and paste random parts of the Ore Dictionary code into your class. All you need to do is call one of the overloads of OreDictionary.registerOre.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Ah, well... hate to sound like a total newbie but how do I do that exactly?
Yes, yes, I know "Learn java before modding minecraft" but this is how people learn in general, by asking others on forums and I figured I'd learn java by modding that way I'm doing something I enjoy and can share with the community while learning a new skill.
Was there a particular part of my post you didn't understand?
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Calling an overload.
As I said in post #7, OreDictionary.registerOre is a method with three different overloads. You need to call this method with the appropriate arguments, i.e. a String (the ore name) and a Block, Item or ItemStack (the ore).
This page briefly explains method overloading. This page briefly explains method calling. These are fundamental concepts that you need to know before you make a mod.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
this is an old thread for 1.7, but it discusses something i have a question on. i am not a modder. but today i noticed wood from trees added by the biom o'plenty mod aren't treated as wood by thermal dynamics filters. how do i add the woods added by the mod in the ore dictionary? is there a simple document explaining it for non-programmers?
note that i am playing on a 1.12 modpack (direwolf)
The Ore Dictionary is generally configured by mods, not users.
You may be able to use something like CraftTweaker to add items to the Ore Dictionary, but I'm not very familiar with it myself.
If you're sure that they aren't in the Ore Dictionary, you may want to report this to the authors of BoP so that they can fix it themselves.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.