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

So way back in the days of 1.4.X, freind helped me with this code, however i need to alter it and i cant get it to work. So basically making an item when crafting with a "ingotTin"(intend to do this code for all the ingots(modpack i use and know alot of people use, spawns different ingots in dungeons)), and it wont resolve and im not a perfect modder but im trying.

 

Anyways, its 1.7.10(yes i know old, dont care, not updating till all favorite mods come out, plus, slowly converting blocks to 1.9 in different dev).

 

This is the original code that allows any ingotTin to craft into my blockTin and back into first registered ingotTin

		if (Storageprops.enabletin) {
		if (!OreDictionary.getOres("ingotTin").isEmpty()) {
			GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(
					StorageBlockMod, 1, 0), "xxx", "xxx", "xxx", 'x',
					"ingotTin"));
			ItemStack tiningot;
			tiningot = OreDictionary.getOres("ingotTin").get(0);
			ItemStack result = tiningot.copy();
			result.stackSize = 9;
			GameRegistry.addShapelessRecipe(result, new ItemStack(
					StorageBlockMod, 1, 0));
			if (Storageprops.gregtechcompat) {
				OreDictionary.registerOre("blockTin", new ItemStack(
						StorageBlockMod, 1, 0));
			}
		}
	}

 

 

This is the one im trying to make work.

	public static void bypassrecipes() {
	// Registers the Item itself and recipe for item
	oredictionarybook = new oredictionarybook(Storageprops.oredictionarybook - 256);
	GameRegistry.registerItem(oredictionarybook, "oredictionarybook");
	GameRegistry.addRecipe(new ItemStack(oredictionarybook, 1),
			"xxx", "xyx", "xxx", 'x', Items.iron_ingot, 'y', Items.emerald);
				//Attempt to fix this.....
	if (!OreDictionary.getOres("ingotTin").isEmpty()) {
		//GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(
		//		StorageBlockMod, 1, 0), "xxx", "xxx", "xxx", 'x',
		//		"ingotTin"));
		ItemStack tiningot;
		tiningot = OreDictionary.getOres("ingotTin").get(0);
		ItemStack result = tiningot.copy();
		result.stackSize = 1;
		GameRegistry.addRecipe(new ShapedOreRecipe(result), " x ", "xyx", " x ", 'x',
				"ingotTin", 'y', oredictionarybook );

		//GameRegistry.addShapelessRecipe(result, new ItemStack(
		//		StorageBlockMod, 1, 0));
		//GameRegistry.addShapelessRecipe(new ShapedOreRecipe(result),
		//		new ItemStack(result), new ItemStack(oredictionarybook, 1, 
		//				OreDictionary.WILDCARD_VALUE));			
		}
	}

 

And it gives me this error

Description Resource Path Location Type

The method addRecipe(ItemStack, Object...) in the type GameRegistry is not applicable for the arguments (ShapedOreRecipe, String, String, String, char, String, char, Item) OreDictionaryBypass.java /Minecraft/src/main/java/com/vanityblocks/Registrations line 32 Java Problem

 

I, cant figure it out for the life of me.

You need to create the

ShapedOreRecipe

with the result, pattern and inputs and then call

GameRegistry.addRecipe(IRecipe)

to add it.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • Author

Thanks for the answer, but do you mind showing me an example, i tend to learn easier when i can read it and see how it works

GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.bucket), "I I", " I ", 'I', "ingotIron"))

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • Author

		if (!OreDictionary.getOres("ingotTin").isEmpty()) {
		// testing purposes
		OreDictionary.registerOre("ingotTin", new ItemStack(
				Items.paper));
		ItemStack tiningot;
		tiningot = OreDictionary.getOres("ingotTin").get(0);
		ItemStack result = tiningot.copy();
		result.stackSize = 1;
		GameRegistry.addRecipe(new ShapedOreRecipe(tiningot));
		GameRegistry.addShapedRecipe(tiningot,  " x ", "xyx", " x ", 'x',
				"ingotTin", 'y', oredictionarybook );	
		}

 

 

Thats what i did, no errors but doesnt work

 

so i changed to this

		if (!OreDictionary.getOres("ingotTin").isEmpty()) {
		// testing purposes
		OreDictionary.registerOre("ingotTin", new ItemStack(
				Items.paper));
		ItemStack tiningot;
		tiningot = OreDictionary.getOres("ingotTin").get(0);
		ItemStack result = tiningot.copy();
		result.stackSize = 1;
		//GameRegistry.addRecipe(new ShapedOreRecipe(tiningot));
		GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(tiningot)," x ", "xyx", " x ", 'x',
				"ingotTin", 'y', oredictionarybook ));
		GameRegistry.addRecipe(new ShapedOreRecipe(tiningot));
		//GameRegistry.addShapedRecipe(tiningot,  " x ", "xyx", " x ", 'x',
		//		"ingotTin", 'y', oredictionarybook );	
		}

and i get this error

Description Resource Path Location Type

The constructor ItemStack(ItemStack) is undefined OreDictionaryBypass.java /Minecraft/src/main/java/com/vanityblocks/Registrations line 33 Java Problem

 

tiningot

is an

ItemStack

and there's no

ItemStack(ItemStack)

constructor. Use

tiningot

directly instead of trying to create a new

ItemStack

from it.

 

Creating a

ShapedOreRecipe

without a pattern or input will crash the game.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • Author

think i may have got it, gonna build it and see, off topic question, is it possible to have another prebuilt mod in my dev enviroment so i can test this without building?

 

off topic question, is it possible to have another prebuilt mod in my dev enviroment so i can test this without building?

 

Yes, you can add it as a dependency through Gradle or put it in the mods folder (but not both). Since you're using 1.7.10, it must be a dev/deobfuscated build of the mod; unless you're running the dev version of CodeChickenCore, which will deobfuscate mods at runtime. In 1.8+, ForgeGradle can deobfuscate dependencies on disk. In 1.8.9+, FML can deobfuscate mods at runtime; completely removing the need for dev builds.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • Author

Thanks, that worked, thanks for not being rude and helping, #minecraftforge tends to be rude xD

 

 

package com.vanityblocks.Registrations;

import com.vanityblocks.Storageprops;
import com.vanityblocks.Items.oredictionarybook;

import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import cpw.mods.fml.common.registry.GameRegistry;

public class OreDictionaryBypass {
public static Item oredictionarybook;

public static void bypassrecipes() {
	// Registers the Item itself and recipe for item
	oredictionarybook = new oredictionarybook(Storageprops.oredictionarybook - 256);
	GameRegistry.registerItem(oredictionarybook, "oredictionarybook");
	GameRegistry.addRecipe(new ItemStack(oredictionarybook, 1),
			"xyx", "yzy", "xyx", 'x', Items.iron_ingot, 'y', Items.emerald, 'z', Items.book);
	//Attempt to fix this.....
	// testing purposes
	//OreDictionary.registerOre("ingotTin", new ItemStack(
	//		Items.paper));
	if (!OreDictionary.getOres("ingotTin").isEmpty()) {
		ItemStack tiningot;
		tiningot = OreDictionary.getOres("ingotTin").get(0);
		ItemStack result = tiningot.copy();
		result.stackSize = 1;
		//GameRegistry.addRecipe(new ShapedOreRecipe(result, " x ", "xyx", " x ", 'x',
		//		"ingotTin", 'y', oredictionarybook ));
		GameRegistry.addRecipe(new ShapelessOreRecipe(result, "ingotTin", oredictionarybook ));
		}
	}
}

 

So for anyone who needs it, theres the code, it uses "result" to define itemstack count, and shapeless and shaped recipe

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.