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

Not getting errors but can't get the recipe working, and there's not much online to compare to.

I want to make 9 pieces into 1 part. I have a "piece" item and a "part" item, each item has 3 subsets.

Any help is greatly appreciated.

 

package pstones.items;

import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;

public class Items {

public static Item piece;
    public static Item part;
    
    public static void init(){
       
        piece = new ItemPiece(ItemRef.PIECE_ID);
        part = new ItemPart(ItemRef.PART_ID);
    }
    public static void addNames(){
        
       
        for (int i = 0; i < ItemRef.PIECE_NAMES.length; i++){
            LanguageRegistry.addName(new ItemStack(piece, 1, i), ItemRef.PIECE_NAMES[i]);
        }
        
        for (int i = 0; i < ItemRef.PART_NAMES.length; i++){
            LanguageRegistry.addName(new ItemStack(part, 1, i), ItemRef.PART_NAMES[i]);
        }
    }
    

    public static void registerRecipes(){
    	for(int i = 0;i < 3;i++){
    		GameRegistry.addRecipe(new ItemStack(ItemRef.PART_DEFAULT,1,i), "XXX","XXX","XXX", Character.valueOf('X'), new ItemStack(ItemRef.PIECE_DEFAULT,1,i));
    		}

    }

}

Hmmm maybe because you are implement your referenceclass for the Items instead your Items^^"

I think that it has something to do with your for loop, that could be making the wrong numbers that represent the metadata that you require. Try removing it and declearing each recipe individually (I know, it's a pain to do), that is what i have in a previous mod that I made, and that worked.

  • Author

Of course I catch my error after I post something in a forum. I forgot to initialize recipes in the main class. ::) thank you for help

 

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.