Jump to content

[Solved] Items reflecting itemID of 0; how to use them in recipes.


linkseyi

Recommended Posts

I am relatively new to Forge, so please bear with me.

 

I have some items, all initialized in a main mod class as such:

 

public static final Item WPUC = new ItemWPUC(512).b("WPUC").d("WPUC");
public static final Item CWP = new ItemCWP(513).b("CWP").d("CWP");

 

I want to use these items in a furnace recipe, however if I use the following it is ineffectual.

 

addSmelting(512, new ItemStack(513, 1, 0), 0.4F);

 

It seems that the actual itemID variable for each of these items is 0, so that defining them by that variable isn't working.  I tried printing the WPUC.itemID to console and reached this conclusion.  Is this a normal feature of Forge, and if so how should I go about creating a furnace recipe?

Link to comment
Share on other sites

no its not

1 why are your names obfuscated ?

2 are you creating the items BEFORE adding them to the recipes ?

3 your variable names and class names .... are horrible ... sorry

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Link to comment
Share on other sites

no its not

1 why are your names obfuscated ?

2 are you creating the items BEFORE adding them to the recipes ?

3 your variable names and class names .... are horrible ... sorry

 

1.  I'm dealing with obfuscated code.  The meat of it should be easily understandable.

2.  The items are static, they are being created when the class is loaded.

3.  That seems irrelevant.

Link to comment
Share on other sites

2.  The items are static, they are being created when the class is loaded.

create them in your preInit instead of staticly

 

3.  That seems irrelevant.

yes and no, you coded in c++ before ? because those names dont really follow java convention

public static final yb CWP

usually class name start with a capital and variable name use the camel notation, and we dont use the hungarian notation, but of course it shouldnt affect the code :P,

 

ps: derp "public static final" <- yeah ok i should look more closely next time, sorry

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Link to comment
Share on other sites

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.