Hello,
I have been trying to create a mod recently, but I'm having some troubles...
My item will load a bit in game. By that, I mean the item appears with it's texture, in it's proper creative tab. What's missing? Well, first off, I gave it a smelting recipe. Unfortunately, that does not work. Another problem? I registered a name for it, but it appears blank. I have no idea what might be wrong with it, but any help would be greatly appreciated.
Oh, and please don't ask for a crash report, as I have none.
package pikadex.displaycase;
import java.awt.event.*;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.*;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
@Mod(modid = "DisplayCase", name = "Display Case", version = "v1.0.0_0 WIP-Alpha")
@NetworkMod(clientSideRequired=true, serverSideRequired=false)
public class ModDisplayCase {
@Instance("ModDisplayCase")
public static ModDisplayCase instance;
@SidedProxy(clientSide="pikadex.displaycase.client.ClientProxy", serverSide="pikadex.displaycase.CommonProxy")
public static CommonProxy proxy;
private static Item tannedLeather = new TanLeather(10000, 64, CreativeTabs.tabMisc, "leathertan");
public void preInit(FMLPreInitializationEvent preevt) {
}
public void load(FMLInitializationEvent evt) {
GameRegistry.registerItem(tannedLeather, "leathertan");
LanguageRegistry.addName(tannedLeather, "Tanned Leather");
GameRegistry.addSmelting(tannedLeather.itemID, new ItemStack(Item.leather), 0.1f);
}
public void postInit(FMLPostInitializationEvent postevt) {
}
}
package pikadex.displaycase;
import java.awt.event.*;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.*;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
@Mod(modid = "DisplayCase", name = "Display Case", version = "v1.0.0_0 WIP-Alpha")
@NetworkMod(clientSideRequired=true, serverSideRequired=false)
public class ModDisplayCase {
@Instance("ModDisplayCase")
public static ModDisplayCase instance;
@SidedProxy(clientSide="pikadex.displaycase.client.ClientProxy", serverSide="pikadex.displaycase.CommonProxy")
public static CommonProxy proxy;
private static Item tannedLeather = new TanLeather(10000, 64, CreativeTabs.tabMisc, "leathertan");
public void preInit(FMLPreInitializationEvent preevt) {
}
public void load(FMLInitializationEvent evt) {
GameRegistry.registerItem(tannedLeather, "leathertan");
LanguageRegistry.addName(tannedLeather, "Tanned Leather");
GameRegistry.addSmelting(tannedLeather.itemID, new ItemStack(Item.leather), 0.1f);
}
public void postInit(FMLPostInitializationEvent postevt) {
}
}
Item Name/Smelting: Added proper Annotations above PreInit, Init, and PostInit Smelting: Set the input and output to their proper IDs (reverses tannedLeather and Item.leather)
For smelting, it's input, output, exp. So your current recipe would smelt tanned leather into untanned leather. Also, you need to add an unlocalized name using .setUnlocalizedName(String).
For smelting, it's input, output, exp. So your current recipe would smelt tanned leather into untanned leather. Also, you need to add an unlocalized name using .setUnlocalizedName(String).
Thanks for the smelting fix.
For setUnlocalizedName, if you looked in the item class, you will see that I put it in there, just as a different method.
I have been trying to create a mod recently, but I'm having some troubles...
My item will load a bit in game. By that, I mean the item appears with it's texture, in it's proper creative tab. What's missing? Well, first off, I gave it a smelting recipe. Unfortunately, that does not work. Another problem? I registered a name for it, but it appears blank. I have no idea what might be wrong with it, but any help would be greatly appreciated.
Oh, and please don't ask for a crash report, as I have none.
Item Name/Smelting: Added proper Annotations above PreInit, Init, and PostInit
Smelting: Set the input and output to their proper IDs (reverses tannedLeather and Item.leather)
Be sure to quote my post if you want a reply.
lol @ Cameronazzi copy-pasting my sig into his
Thanks for the smelting fix.
For setUnlocalizedName, if you looked in the item class, you will see that I put it in there, just as a different method.
Hmm... that might be it. I'll try that out.
Oh, and I did post the item class.
EDIT: Yep! That was it! Thanks for the help.
You posted the main class twice.
Be sure to quote my post if you want a reply.
lol @ Cameronazzi copy-pasting my sig into his