Jump to content

Error on custom food


AssassinHero

Recommended Posts

Hey guys,

Well first and for most I get this error on my custom food item

[iNFO] [ForgeModLoader] Configured a dormant chunk cache size of 0

 

the code highlighted for the error is:

		RawLambChop = new RawLambChopFood(5006, 3, 4.0F, true).setUnlocalizedName("Raw Lamb Chop");

 

Here is my whole main class:

package assassinhero.parallelworlds;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.EnumHelper;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import assassinhero.parallelworlds.client.ClientPacketHandler;
import assassinhero.parallelworlds.common.CommonProxy;
import assassinhero.parallelworlds.common.ServerPacketHandler;
import assassinhero.parallelworlds.common.blocks.BlockArcticiteBlock;
import assassinhero.parallelworlds.common.blocks.BlockAscariteBlock;
import assassinhero.parallelworlds.common.blocks.BlockHelliteBlock;
import assassinhero.parallelworlds.common.blocks.BlockNightOre;
import assassinhero.parallelworlds.common.blocks.BlockNightiumBlock;
import assassinhero.parallelworlds.common.blocks.BlockSapphireBlock;
import assassinhero.parallelworlds.common.blocks.BlockTimeOre;
import assassinhero.parallelworlds.common.blocks.BlockTiminiumBlock;
import assassinhero.parallelworlds.common.items.CookedLambChopFood;
import assassinhero.parallelworlds.common.items.ItemHellShardItem;
import assassinhero.parallelworlds.common.items.ItemHellSoulsItem;
import assassinhero.parallelworlds.common.items.ItemIceGemItem;
import assassinhero.parallelworlds.common.items.ItemNightGemItem;
import assassinhero.parallelworlds.common.items.ItemPureSoulsItem;
import assassinhero.parallelworlds.common.items.ItemPurityGemItem;
import assassinhero.parallelworlds.common.items.ItemSapphireItem;
import assassinhero.parallelworlds.common.items.ItemTimeGemItem;
import assassinhero.parallelworlds.common.items.ItemTimeShardItem;
import assassinhero.parallelworlds.common.items.RawLambChopFood;
import assassinhero.parallelworlds.common.items.TimeAxe;
import assassinhero.parallelworlds.common.items.TimeBlade;
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.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkMod.SidedPacketHandler;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;

@NetworkMod(clientSideRequired=true,serverSideRequired=false, 
clientPacketHandlerSpec = @SidedPacketHandler(channels = {"ParallelWorlds" }, packetHandler = ClientPacketHandler.class),
serverPacketHandlerSpec = @SidedPacketHandler(channels = {"ParallelWorlds"}, packetHandler = ServerPacketHandler.class)) 
@Mod(modid="AssassinHero_ParallelWorlds",name="ParallelWorlds",version="1.0") 
public class ParallelWorldsMain { 

@Instance("ParallelWorlds") 
public static ParallelWorldsMain instance = new ParallelWorldsMain();

@SidedProxy(clientSide = "assassinhero.parallelworlds.client.ClientProxy", serverSide = "assassinhero.parallelworlds.common.CommonProxy") 
public static CommonProxy proxy;

public static Block NightOre;
public static Block Nightium;
public static Item NightGem;
public static Block TimeOre;
public static Block Timinium;
public static Item TimeGem;
public static Block Arcticite;
public static Block Hellite;
public static Item HellShard;
public static Block Ascarite;
public static Item HellSoul;
public static Item PureSoul;
public static Item PurityGem;
public static Block SapphireBlock;
public static Item RawLambChop;
public static Item TimePickaxe;
public static Item Sapphire;
public static Item IceGem;
public static Item TimeBlade;
public static Item TimeShard;
public static Item CookedLambChop;
public static Item TimeShovel;
public static Item TimeAxe;

@cpw.mods.fml.common.Mod.PreInit
public void PreInit(FMLPreInitializationEvent event){
	Nightium = new BlockNightiumBlock(3000, Material.iron).setUnlocalizedName("Nightium");
	NightOre = new BlockNightOre(3001, Material.rock).setUnlocalizedName("Night Ore");
	TimeOre = new BlockTimeOre(3003, Material.rock).setUnlocalizedName("Time Ore");
	Timinium = new BlockTiminiumBlock(3004, Material.iron).setUnlocalizedName("Timinium");
	Arcticite = new BlockArcticiteBlock(3005, Material.iron).setUnlocalizedName("Arcticite");
	Hellite = new BlockHelliteBlock(3006, Material.iron).setUnlocalizedName("Hellite");
	Ascarite = new BlockAscariteBlock(3007, Material.iron).setUnlocalizedName("Ascarite");
	SapphireBlock = new BlockSapphireBlock(3008, Material.iron).setUnlocalizedName("Sapphire Block");
	NightGem = new ItemNightGemItem(5000).setUnlocalizedName("Night Gem");
	TimeGem = new ItemTimeGemItem(5001).setUnlocalizedName("Time Gem");
	HellShard = new ItemHellShardItem(5002).setUnlocalizedName("Hell Shard");
	HellSoul = new ItemHellSoulsItem(5003).setUnlocalizedName("Hell Soul");
	PureSoul = new ItemPureSoulsItem(5004).setUnlocalizedName("Pure Soul");
	PurityGem = new ItemPurityGemItem(5005).setUnlocalizedName("Purity Gem");
	RawLambChop = new RawLambChopFood(5006, 3, 4.0F, true).setUnlocalizedName("Raw Lamb Chop");
	Sapphire = new ItemSapphireItem(5007).setUnlocalizedName("Sapphire");
	IceGem = new ItemIceGemItem(5008).setUnlocalizedName("IceGem");
	TimeShard = new ItemTimeShardItem(5009).setUnlocalizedName("Time Shard");
	CookedLambChop = new CookedLambChopFood(5010, 8, 8.0F, true).setUnlocalizedName("Cooked Lamb Chop");
	TimeBlade = new TimeBlade(15000, EnumToolMaterial.TIME).setUnlocalizedName("Time Blade");
	TimePickaxe = new assassinhero.parallelworlds.common.items.TimePickaxe(15001, EnumToolMaterial.TIME).setUnlocalizedName("Time Pickaxe");
	TimeShovel = new assassinhero.parallelworlds.common.items.TimeShovel(15002, EnumToolMaterial.TIME).setUnlocalizedName("Time Shovel");
	TimeAxe = new TimeAxe(15003, EnumToolMaterial.TIME).setUnlocalizedName("TimeAxe");
}


@Init
public void Init(FMLInitializationEvent event){ 
	proxy.registerBlocks();
	proxy.registerItems();
	NetworkRegistry.instance().registerGuiHandler(this, proxy);
	craftingRecipes();
	smeltingRecipes();
	BlockHarvestLevel();
	MinecraftForge();
	EnumToolMaterial();


}

public void craftingRecipes(){
	GameRegistry.addRecipe(new ItemStack(ParallelWorldsMain.Nightium, 1), "XX", "XX", Character.valueOf('X'), ParallelWorldsMain.NightGem);
	GameRegistry.addRecipe(new ItemStack(ParallelWorldsMain.Timinium, 1), "XX", "XX", Character.valueOf('X'), ParallelWorldsMain.TimeGem);
	GameRegistry.addRecipe(new ItemStack(ParallelWorldsMain.Arcticite, 1), "XX", "XX", Character.valueOf('X'), Block.blockSnow);
	GameRegistry.addRecipe(new ItemStack(ParallelWorldsMain.Hellite, 1), "XX", "XX", Character.valueOf('X'), ParallelWorldsMain.HellShard);
	GameRegistry.addRecipe(new ItemStack(ParallelWorldsMain.SapphireBlock, 1), "XXX", "XXX", "XXX", Character.valueOf('X'), ParallelWorldsMain.Sapphire);
	GameRegistry.addRecipe(new ItemStack(ParallelWorldsMain.Ascarite, 1), "XXX", "XXX", "XXX", Character.valueOf('X'), ParallelWorldsMain.PureSoul);
	GameRegistry.addRecipe(new ItemStack(ParallelWorldsMain.TimePickaxe, 1), "XXX", " A ", " A ", Character.valueOf('X'), ParallelWorldsMain.TimeGem, Character.valueOf('A'), Item.stick);
	GameRegistry.addRecipe(new ItemStack(ParallelWorldsMain.TimeGem, 1), "XXX", "XXX", "XXX", Character.valueOf('X'), ParallelWorldsMain.TimeShard);
	GameRegistry.addRecipe(new ItemStack(ParallelWorldsMain.TimeShovel, 1), " X ", " A ", " A ", Character.valueOf('X'), ParallelWorldsMain.TimeGem, Character.valueOf('A'), Item.stick);
	GameRegistry.addRecipe(new ItemStack(ParallelWorldsMain.TimeAxe, 1), "XX ", "XA ", " A ", Character.valueOf('X'), ParallelWorldsMain.TimeGem, Character.valueOf('A'), Item.stick);
	GameRegistry.addShapelessRecipe(new ItemStack(ParallelWorldsMain.PureSoul, 1), new Object[]{ParallelWorldsMain.HellSoul, ParallelWorldsMain.PurityGem});



}

public void smeltingRecipes(){
	GameRegistry.addSmelting(NightOre.blockID, new ItemStack(NightGem, 1), 0.5F);
	GameRegistry.addSmelting(TimeOre.blockID, new ItemStack(TimeShard, 1), 0.5F);

}

public void BlockHarvestLevel(){
	MinecraftForge.setBlockHarvestLevel(Nightium, "pickaxe", 2);
	MinecraftForge.setBlockHarvestLevel(NightOre, "pickaxe", 2);
	MinecraftForge.setBlockHarvestLevel(TimeOre, "pickaxe", 2);
	MinecraftForge.setBlockHarvestLevel(Timinium, "pickaxe", 2);
	MinecraftForge.setBlockHarvestLevel(Arcticite, "pickaxe", 2);
	MinecraftForge.setBlockHarvestLevel(Hellite, "pickaxe", 2);
	MinecraftForge.setBlockHarvestLevel(Ascarite, "pickaxe", 2);
	MinecraftForge.setBlockHarvestLevel(SapphireBlock, "pickaxe", 2);


}

public void MinecraftForge(){
	MinecraftForge.EVENT_BUS.register(new LivingDropsEvent(null, null, null, 0, false, 0));
}

public void EnumToolMaterial(){
	EnumToolMaterial toolTime = EnumHelper.addToolMaterial("Time", 2, 2000, 10.0F, 8, 15);
}


}

 

 

I know the MinecraftFoege.EVENT_BUS is not correct I am working on fixing that...

 

Any solutions?

STOP CRUCIFYING NEW MODDERS!!!!

Link to comment
Share on other sites

That error is unrelated to your mod.

 

This might help (all hail the power of googling your error:

http://www.minecraftforum.net/topic/1641920-minecraft-freezes-in-eclipse-forgemodloader/

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Hey guys,

Well first and for most I get this error on my custom food item

[iNFO] [ForgeModLoader] Configured a dormant chunk cache size of 0

 

the code highlighted for the error is:

		RawLambChop = new RawLambChopFood(5006, 3, 4.0F, true).setUnlocalizedName("Raw Lamb Chop");

....

 

What's the error? Code for the RawLambChopFood class?

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

Hey guys,

Well first and for most I get this error on my custom food item

[iNFO] [ForgeModLoader] Configured a dormant chunk cache size of 0

 

the code highlighted for the error is:

		RawLambChop = new RawLambChopFood(5006, 3, 4.0F, true).setUnlocalizedName("Raw Lamb Chop");

....

 

What's the error? Code for the RawLambChopFood class?

 

package assassinhero.parallelworlds.common.items;

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

public class RawLambChopFood extends ItemFood{

public RawLambChopFood(int par1, int par2, float par3, boolean par4) {
	super(par1, par2, par3, par4);
	setCreativeTab(CreativeTabs.tabFood);
}

public void updateIcons(IconRegister par1iconregister){
	this.itemIcon = par1iconregister.registerIcon("ParallelWorlds:RawLambChop");
}


}

 

Thats the code for the raw lamb chop class

 

i dont get an error all i get is what i have provided

STOP CRUCIFYING NEW MODDERS!!!!

Link to comment
Share on other sites

I am not sure, but my food works fine all i do is

 

// My food
public static Item BlueberryMuffin; 

@Init
public void load(FMLInitializationEvent ev)
{	
//Notice that i used new ItemFood not ItemBlueBerryMuffin or whatever, i don't have a class for such because it's simply not needed.

BlueberryMuffin = 		(new ItemFood(1150,3,4F,false).setUnlocalizedName("Blueberry_muffin"));
				ModLoader.addName(BlueberryMuffin,"Blueberry Muffin");
// Recipe :
GameRegistry.addRecipe(new ItemStack(this.BlueberryMuffin, 2), new Object[]
				    				{
				    		"WWW", "YBY", "SEM",  'W', Item.wheat , 'Y', this.BlueberryBushel, 'B', Item.bowlEmpty , 'S', Item.sugar , 'E', Item.egg , 'M', Item.bucketMilk		//Crafting Line  
				    				});
}	

 

I hope it helped

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.