Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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?

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-

  • Author

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.

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-

  • Author

I fixed it.  I ended up using (new ItemStack[yd](itemVarname, 1, 0).itemID[d]) for anyone concerned.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.