Jump to content

Recommended Posts

Posted

I use ordictonary and it fail... Im so sad... Because nothing work. not the source of elorams redpower. not the source out of Forestry. not the source out of universal eletricty...

(I only use the source to get inspiration how to things work)

 

here is the recipe (when i use it it will crash the game at start)

 

      ModLoader.addRecipe(new ItemStack(mod_KingdomAge.copperIngot, 1, 40), new Object[]{ "YX", Character.valueOf('X'), "ingotCoppet", Character.valueOf('Y'), "ingotTin"});

 

(why copper ingot is so high? i use only for normal items one id) i tryed the recipe out of the fore tutorial too and it dont work because i use the modloader style... (of modding but i work with fml)

 

thanks for reading.

 

Moritz

Posted

It crashes because you cannot use Strings as items for the crafting recipe! There must be a method in the OreDictionary which gives you an ItemStack back. This ItemStack can be used then in the recipe.

 

PS: One tip: Don't use ModLoader methods anymore. For recipes use GameRegistry.addRecipe(...). For other ModLoader methods, snoop a bit in the ModLoader class to find the right method.

 

EDIT: Use OreDictionary.getOreID("oreNameHere") to get the ID for the ore.

 

Here's an example code:

GameRegistry.addRecipe(new ItemStack(mod_KingdomAge.copperIngot, 1, 40), "YX", 'X', new ItemStack(OreDictionary.getOreID("ingotCopper"), 1, 0), 'Y', new ItemStack(OreDictionary.getOreID("ingotTin"), 1, 0));

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

  Quote

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted

Please check your code before responding, 1) it's horrible code, 2) Thats not how those functions work, go read the ore dict javadocs, its' there. I've also written samples if you search.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

the code what you gave me is does not work on my mod.. (Errors 5 i think) i tried the code directly out of the mod redpower to test it. this code did not make a error, crash, and now the bad thing no recipe... i do not know how i can fix that.... I poste my codes. maybe this helps out..

Posted

This code Is my modFile...

 

I hope you can help me because i can't make recipes with oredictonary...

 

I deleted all recipe because this comes at my last test when i release a test version

 

 

  Reveal hidden contents

 

 

Now the Code of the items ItemCopperIngot.java

 

 

  Reveal hidden contents
Posted

So yeah, I searched a bit and found this on the wiki:

http://www.minecraftforge.net/wiki/How_to_use_the_ore_dictionary

 

You should read through this. I tested it myself and it works.

 

 

@Lex: Sorry for that, It was waay to late for me xP

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

  Quote

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted

What failed? Please give more info about this.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

  Quote

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted

Your mod_ file would be enough.

 

EDIT: Nvm, I used that one posted above. Here's a more or less cleaned mod_ file:

https://gist.github.com/dc7f29572c8bcab492c0

 

PS: You should really check out this tutorial:

http://www.minecraftforge.net/wiki/Tutorials/Upgrading_To_Forge_for_1.3.1

 

It will teach you how to make your mods right and throw out any ModLoader stuff.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

  Quote

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted

Thanks. My modfile will be for only 3 days on the next post downloadfile... sry i can not post with my ipod touch(G2) on github... I use dropbox to share my code.. and why i do not use minecraft 1.3.1 because i make some of my mods for friends an they use 1.2.5. And i have to read the changes and that does need more time for mod which is at a testing phase... When its at the realease Time i update the mod... Thanks to the answer

Posted

Ok i understand it right now i try gameRegistry... If it make fail i change back to modloader... the only thing what i use on

modloader is RegisterBlock and AddRecipe

Posted

Ok First of All the item Checker is only to check item is a fake or is an original... Secend one i already Importet all OreDictonary Classes. Third one i do not Need Sharpless Recipes. I need only Sharped Recipes. forth one. The public void Load is only for recipes and the public mod_KingdomAge for the rest (kinda sorting). but at all thanks now im testing it and tomorow you get an other answer...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.