Jump to content

Smelting Recipes Not Working Forge Latest


TehNuker

Recommended Posts

Guys I need help, my smelting recipes don't work......

Here is my main.

package mods.Divine.common;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.Configuration;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid = "Divine", name = "Divine", version = "1.0")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)

public class Divine 
{

//Blocks
public static Block divineOre;
static int divineOreID;

//Items
public static Item divineStone;
public static Item divineChunks;
public static Item divineGem;
public static Item divineSugar;
static int divineStoneID;
static int divineChunksID;
static int divineGemID;
static int divineSugarID;

 @Instance("Divine")
 public static Divine instance;

 @SidedProxy(clientSide = "mods.Divine.client.ClientProxyDivine", serverSide = "mods.divine.CommonProxyDivine")
 public static CommonProxyDivine proxy;

@PreInit
public void preInit(FMLPreInitializationEvent event)
{
	Configuration config = new Configuration(event.getSuggestedConfigurationFile());

	//Blocks
	divineOreID = config.get("Block ID's", "Divine Ore ID", 1551).getInt();
	//Items
	divineStoneID = config.get("Item ID's", "Divine Stone ID", 3843).getInt();
	divineChunksID = config.get("Item ID's", "Divine Chunks ID", 3844).getInt();
	divineGemID = config.get("Item ID's", "Divine Gem ID", 3845).getInt();
	divineSugarID = config.get("Item ID's", "Divine Sugar ID", 3846).getInt();		

	config.save();
}

@Init
public void load(FMLInitializationEvent event)
{
	divineOre = new BlockDivineOre(divineOreID, Material.iron).setUnlocalizedName("tiledivineore").setLightValue(0.50F).setHardness(2.5F).setResistance(12F).setStepSound(Block.soundStoneFootstep);
	divineStone = new ItemDivineStone(divineStoneID).setUnlocalizedName("Divine Stone");
	divineChunks = new ItemDivineChunks(divineChunksID).setUnlocalizedName("Divine Chunks");
	divineGem = new ItemDivineGem(divineGemID).setUnlocalizedName("Divine Gem");
	divineSugar = new ItemDivineSugar(divineSugarID, 2, 2.0F, true).setUnlocalizedName("Divine Sugar");

	gameRegisters();
	languageRegisters();
	craftingRecipes();
	smeltingRecipes();

}

private static void gameRegisters()
{
	GameRegistry.registerBlock(divineOre, "divineOre");
	GameRegistry.registerItem(divineStone, "divineStone");
	GameRegistry.registerItem(divineChunks, "divineChunks");
	GameRegistry.registerItem(divineGem, "divineGem");
	GameRegistry.registerItem(divineSugar, "divineSugar");
	GameRegistry.registerWorldGenerator(new WorldGeneratorDivine());
}

public void smeltingRecipes()
{
	GameRegistry.addSmelting(Divine.divineChunksID, new ItemStack (Divine.divineStoneID), 1.0f);
}

public void craftingRecipes()
{
	GameRegistry.addRecipe(new ItemStack(Divine.divineGem), new Object[]
	{
		"SSS", "SSS", "SSS",
		'S', divineStone,
	});
}

private static void languageRegisters()
{
	LanguageRegistry.addName(divineOre, "Divine Ore");
	LanguageRegistry.addName(divineStone, "Divine Stone");
	LanguageRegistry.addName(divineChunks, "Divine Chunks");
	LanguageRegistry.addName(divineGem, "Divine Gem");
	LanguageRegistry.addName(divineSugar, "Divine Sugar");
}

}

Here is my DivineStone:

package mods.Divine.common;

import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;

public class ItemDivineStone extends Item
{

public ItemDivineStone(int par1) 
{
	super(par1);
	setMaxStackSize(64);
	setCreativeTab(CreativeTabs.tabMaterials);
	setUnlocalizedName("divineStone");
}

@Override
public void updateIcons(IconRegister iconRegister)
{
         iconIndex = iconRegister.registerIcon("Divine:DivineStone");
}

}

Help pls....tell me if you need more...

Link to comment
Share on other sites

thanks, but would you mind putting it in code for me just for example?

I did this....

GameRegistry.addSmelting(ItemDivineChunks.DivineChunks.itemID, new ItemStack(Divine.DivineStoneID), 1.0f);

Right? well if it is..its not cus its still messed up.

Link to comment
Share on other sites

Hmm, it doesn't look like an issue with the smelting command you had originally as long as you are turning chunks into stone.  If it's the other way around, then the parameters are backwards.  It looks like you are setting everything up correctly for the items, so the only thing I can think of is either use the item id of the items instead of the config variables, or explicitly tell the ItemStack to make one stone, shown here:

GameRegistry.addSmelting(divineChunks.itemID, new ItemStack (divineStone.itemID,1), 1.0f);

That should fix it hopefully.

Link to comment
Share on other sites

Hmm, it doesn't look like an issue with the smelting command you had originally as long as you are turning chunks into stone.  If it's the other way around, then the parameters are backwards.  It looks like you are setting everything up correctly for the items, so the only thing I can think of is either use the item id of the items instead of the config variables, or explicitly tell the ItemStack to make one stone, shown here:

GameRegistry.addSmelting(divineChunks.itemID, new ItemStack (divineStone.itemID,1), 1.0f);

That should fix it hopefully.

i did exactly what you said and it still errors the "new ItemStack(DivineStone.itemID, 1),"

Link to comment
Share on other sites

Hmm, it doesn't look like an issue with the smelting command you had originally as long as you are turning chunks into stone.  If it's the other way around, then the parameters are backwards.  It looks like you are setting everything up correctly for the items, so the only thing I can think of is either use the item id of the items instead of the config variables, or explicitly tell the ItemStack to make one stone, shown here:

GameRegistry.addSmelting(divineChunks.itemID, new ItemStack (divineStone.itemID,1), 1.0f);

That should fix it hopefully.

i did exactly what you said and it still errors the "new ItemStack(DivineStone.itemID, 1),"

 

Use the constructor with 3 Integers:

new ItemStack(divineStone.itemID, 1, 0)

 

or the one with the Item and the integer as parameters:

new ItemStack(divineStone, 1)

 

Also please watch out for capitalizing, since Java is case-sensitive!

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

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.

Link to comment
Share on other sites

 

Use the constructor with 3 Integers:

new ItemStack(divineStone.itemID, 1, 0)

 

 

well that one worked! and btw what is the 0 for?

 

It's the Metadata / Damage value of an item / block.

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

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.

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.