The Meaning of Life, the Universe, and Everything.
Join Date:
2/17/2012
Posts:
49
Minecraft:
Pyroglyph
Member Details
Hello! I'm making a mod which essentially forces the user to only encounter one type of ore in their Minecraft world. Okay, I didn't explain that well. The mod basically converts all the different copper ores, for example, from the other mods installed to it's own generic copper ore. This eliminates the annoyance of having 4 or 5 different stacks of the same material thus saving inventory space. The mod uses the Ore Dictionary to do this.
What I'm trying to do is to get any copper ore (using the Ore Dictionary) to smelt into my mod's generic ingot.
This is what I have so far:
GameRegistry.addSmelting(Some_OreDict_Magic_Goes_Here, new ItemStack(ingotCopper, 1), 0.7f);
What I want to know is how to use an Ore Dictionary in the input of a smelting recipe. A simple "oreCopper" doesn't work because addSmelting() won't take a String as a first argument.
Edit:
So I tried the code below and it added my generic ore to generic ingot recipe but copper ingots from other mods still smelt to their original ingots and not mine. Is there any way to override this?
for (ItemStack stack : OreDictionary.getOres("oreCopper")) { GameRegistry.addSmelting(stack, new ItemStack(ingotCopper, 1), 0.7f); }
For some reason, I can't do new lines in the code tags. Any help with that as well?
one way to make other mods stuff smelt into yours is to remove their recipe and then add yours in with their ore = your ingot
That's what I'm trying to do. Using OreDict seems like the easier way because if any other new mods come along that use OreDict, my mod will automatically take over it's relevant recipes (which is exactly what I want it to do). I take it you meant code specifically for certain mods when you said "remove their recipe". I just think OreDict will be more functional and will result in less code being written which is in both the developer's and the client's best interests (less code = less effort = smaller jarfile).
yea what i meant was add each copper mod into your library and remove their recipe that way then make a new one for each diff mod using copper but im sure there is an easier way?
So I tried the code below and it added my generic ore to generic ingot recipe but copper ingots from other mods still smelt to their original ingots and not mine. Is there any way to override this?
for (ItemStack stack : OreDictionary.getOres("oreCopper")) { GameRegistry.addSmelting(stack, new ItemStack(ingotCopper, 1), 0.7f); }
The original mod's smelting recipe takes precedence over yours. Try removing them.
The original mod's smelting recipe takes precedence over yours. Try removing them.
I have been trying. I found a code snippet on the Forge Forums and added it to my own.
I call AddRecipes() once all the items and blocks have been registered and have been added to the OreDict.
Code is on Pastebin because I can't stand code not being formatted on this. Code is here.
However, this code only seems to go through the vanilla recipes, which isn't what I'm looking for. I'm looking for the entire recipe list after all the other mods recipes have been created.
if you change the item.brewingstand to the modname.ingotname it should search for it remove it then yours should be there, then that just goes in the init section after the registering and such
if you change the item.brewingstand to the modname.ingotname it should search for it remove it then yours should be there
Items.brewing_stand is an Item. I'm looking for something to do with a string which relates to an OreDict entry. I'm going to try and pass the resultItem.getItem() in RemoveRecipes(ItemStack resultItem) in place of the brewing stand because RemoveRecipe() is called from inside an OreDict iterator anyway (refer to this).
Hello! I'm making a mod which essentially forces the user to only encounter one type of ore in their Minecraft world. Okay, I didn't explain that well. The mod basically converts all the different copper ores, for example, from the other mods installed to it's own generic copper ore. This eliminates the annoyance of having 4 or 5 different stacks of the same material thus saving inventory space. The mod uses the Ore Dictionary to do this.
What I'm trying to do is to get any copper ore (using the Ore Dictionary) to smelt into my mod's generic ingot.
This is what I have so far:
What I want to know is how to use an Ore Dictionary in the input of a smelting recipe. A simple "oreCopper" doesn't work because addSmelting() won't take a String as a first argument.
Edit:
So I tried the code below and it added my generic ore to generic ingot recipe but copper ingots from other mods still smelt to their original ingots and not mine. Is there any way to override this?
For some reason, I can't do new lines in the code tags. Any help with that as well?
No, my computer is not too slow.
[email protected], GALAX GTX 980Ti HOF 6GB, Seagate 1TB 7200RPM HDD, Crucial MX100 256GB SSD, 2x Kingston 8GB@1866MHz, EVGA NEX750G PSU
one way to make other mods stuff smelt into yours is to remove their recipe and then add yours in with their ore = your ingot
That's what I'm trying to do. Using OreDict seems like the easier way because if any other new mods come along that use OreDict, my mod will automatically take over it's relevant recipes (which is exactly what I want it to do). I take it you meant code specifically for certain mods when you said "remove their recipe". I just think OreDict will be more functional and will result in less code being written which is in both the developer's and the client's best interests (less code = less effort = smaller jarfile).
No, my computer is not too slow.
[email protected], GALAX GTX 980Ti HOF 6GB, Seagate 1TB 7200RPM HDD, Crucial MX100 256GB SSD, 2x Kingston 8GB@1866MHz, EVGA NEX750G PSU
yea what i meant was add each copper mod into your library and remove their recipe that way then make a new one for each diff mod using copper but im sure there is an easier way?
The original mod's smelting recipe takes precedence over yours. Try removing them.
I have been trying. I found a code snippet on the Forge Forums and added it to my own.
I call AddRecipes() once all the items and blocks have been registered and have been added to the OreDict.
Code is on Pastebin because I can't stand code not being formatted on this. Code is here.
However, this code only seems to go through the vanilla recipes, which isn't what I'm looking for. I'm looking for the entire recipe list after all the other mods recipes have been created.
No, my computer is not too slow.
[email protected], GALAX GTX 980Ti HOF 6GB, Seagate 1TB 7200RPM HDD, Crucial MX100 256GB SSD, 2x Kingston 8GB@1866MHz, EVGA NEX750G PSU
this is what im using to remove my recipes and its a lil diff from what you got
List<IRecipe> recipies = CraftingManager.getInstance().getRecipeList();
Iterator<IRecipe> remover = recipies.iterator();
while (remover.hasNext())
{
ItemStack itemstack = remover.next().getRecipeOutput();
if(itemstack != null && itemstack.getItem() == Items.brewing_stand)
{
remover.remove();
}
if you change the item.brewingstand to the modname.ingotname it should search for it remove it then yours should be there, then that just goes in the init section after the registering and such
Items.brewing_stand is an Item. I'm looking for something to do with a string which relates to an OreDict entry. I'm going to try and pass the resultItem.getItem() in RemoveRecipes(ItemStack resultItem) in place of the brewing stand because RemoveRecipe() is called from inside an OreDict iterator anyway (refer to this).
No, my computer is not too slow.
[email protected], GALAX GTX 980Ti HOF 6GB, Seagate 1TB 7200RPM HDD, Crucial MX100 256GB SSD, 2x Kingston 8GB@1866MHz, EVGA NEX750G PSU
People are confusing crafting and smelting here.
Anyways, your issue is that the smelting manager simply take the first entry that works, so just edit that.
Map<ItemStack, ItemStack> map = FurnacesRecipes.instance().getSmeltingList();
Set<ItemStack> set = map.keySet();
for(ItemStack stack : set){
//Find that "ingotCopper" stack using the OreDictionary
for(int i : OreDictionary.getOreIDs(stack)){
if(OreDictionary.getOreName(i).equals("ingotCopper"))
map.put(stack, 'yourStuff');//Replace with the right product
break;
}
}
Also, make sure this runs after all the mods have setup their smelting.
Why not just go over world gen at the end, and replace all the oredict'd ore with your own?