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

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

GameRegistry.addSmelting(CLASS.block.blockID, new ItemStack(Item.appleGold, 3), 1.0F);

 

CLASS = Class in which the block is to be found

block = the name of the block

Developer of Primeval Forest.

  • Author

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

The class of the item? or the class the main class?

  • Author

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.

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.

  • Author

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),"

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.

  • Author

 

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

oh ik its cus i changed the main class file since then.

  • Author

 

Use the constructor with 3 Integers:

new ItemStack(divineStone.itemID, 1, 0)

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

 

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.

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.