Jump to content

Recommended Posts

Posted

I have been having problems with recipes.

 

 

 

package aliztermod.common;


import net.minecraft.src.Block;
import net.minecraft.src.EnumToolMaterial;
import net.minecraft.src.Item;
import net.minecraft.src.ItemStack;
import net.minecraftforge.common.EnumHelper;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;


@Mod(modid = "Alizter_aliztermod", name = "Alizter's Mod", version = "0.1")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)


public class Aliztermod 
{
public static Item malingot;
public static Block malblock;


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

@Init
public void load(FMLInitializationEvent event)
{
	//Malisidite Ingot
	malingot = new Itemmalingot(1600)
	.setMaxStackSize(64).setIconIndex(5).setItemName("malingot");
	LanguageRegistry.addName(malingot, "Malisidite Ingot");
	GameRegistry.addSmelting(malore.blockID, new ItemStack(malingot), 0.1f);
	GameRegistry.addShapelessRecipe(new ItemStack(malingot, 9), new ItemStack(malblock));

	//Malisidite Block
	malblock = new BlockMalBlock(1502, 6).setBlockName("MalBlock");
	GameRegistry.registerBlock(malblock);
	LanguageRegistry.addName(malblock, "Malisisdite Block");
	ItemStack malingotstack = new ItemStack(malingot);
	GameRegistry.addRecipe(new ItemStack(malblock), "xxx", "xxx", "xxx",
			'x', malingotstack);

}
}


 

 

 

I have taken out a lot of stuff that you do not need to see so don't correct me on stuff like you've forgotten something completely unrelated to this.

 

As you can see I have a recipe for malblock that you can craft with 9 of malingot. Now when i try and craft 9 malingot with one malblock using a shapeless crafting recipe it crashes minecraft. I have tried my other mod blocks instead of mablock to craft 9 malingots and it works just fine. Its an issue with malblock. I've tried changing names but I don't think that would help because eclipse would of picked it up. I think it may be a problem with conflicting recipes? The fact that malblock was crafted with malingots but then malblock can be crafted into malingots. Im not sure if that would even be a possible error but it might.

 

Here is the crash report when I try and run the code above ( With the  other bits of code as well)

 

Eclipse Console

 

 

2012-11-03 11:26:07 [iNFO] [ForgeModLoader] Forge Mod Loader version 4.2.8.424 for Minecraft 1.4.2 loading
2012-11-03 11:26:09 [iNFO] [sTDOUT] 27 achievements
2012-11-03 11:26:09 [iNFO] [sTDOUT] 208 recipes
2012-11-03 11:26:09 [iNFO] [sTDOUT] Setting user: Player20, -
2012-11-03 11:26:09 [iNFO] [sTDERR] Client asked for parameter: server
2012-11-03 11:26:09 [iNFO] [sTDOUT] LWJGL Version: 2.4.2
2012-11-03 11:26:10 [iNFO] [ForgeModLoader] Attempting early MinecraftForge initialization
2012-11-03 11:26:10 [iNFO] [sTDOUT] MinecraftForge v6.0.1.349 Initialized
2012-11-03 11:26:10 [iNFO] [ForgeModLoader] MinecraftForge v6.0.1.349 Initialized
2012-11-03 11:26:10 [iNFO] [ForgeModLoader] Completed early MinecraftForge initialization
2012-11-03 11:26:10 [iNFO] [ForgeModLoader] Searching C:\Users\Ali\Desktop\MCP\jars\mods for mods
2012-11-03 11:26:12 [iNFO] [ForgeModLoader] Forge Mod Loader has identified 4 mods to load
2012-11-03 11:26:12 [iNFO] [ForgeModLoader] Configured a dormant chunk cache size of 0
2012-11-03 11:26:12 [iNFO] [sTDOUT] Starting up SoundSystem...
2012-11-03 11:26:12 [iNFO] [sTDOUT] Initializing LWJGL OpenAL
2012-11-03 11:26:12 [iNFO] [sTDOUT]     (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
2012-11-03 11:26:12 [iNFO] [sTDOUT] OpenAL initialized.
2012-11-03 11:26:13 [sEVERE] [ForgeModLoader] Fatal errors were detected during the transition from INITIALIZATION to POSTINITIALIZATION. Loading cannot continue
2012-11-03 11:26:13 [sEVERE] [ForgeModLoader] 
mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized
Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized
Alizter_aliztermod [Alizter's Mod] (bin) Unloaded->Constructed->Pre-initialized->Errored
2012-11-03 11:26:13 [sEVERE] [ForgeModLoader] The following problems were captured during this phase
2012-11-03 11:26:13 [sEVERE] [ForgeModLoader] Caught exception from Alizter_aliztermod
java.lang.NullPointerException
at net.minecraft.src.ItemStack.<init>(ItemStack.java:37)
at net.minecraft.src.ItemStack.<init>(ItemStack.java:32)
at aliztermod.common.Aliztermod.load(Aliztermod.java:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:440)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
at com.google.common.eventbus.EventBus.post(EventBus.java:268)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:140)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
at com.google.common.eventbus.EventBus.post(EventBus.java:268)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:83)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:651)
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:196)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:465)
at net.minecraft.client.Minecraft.run(Minecraft.java:752)
at java.lang.Thread.run(Thread.java:722)
2012-11-03 11:26:13 [iNFO] [sTDERR] java.lang.NullPointerException
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at net.minecraft.src.ItemStack.<init>(ItemStack.java:37)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at net.minecraft.src.ItemStack.<init>(ItemStack.java:32)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at aliztermod.common.Aliztermod.load(Aliztermod.java:68)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at java.lang.reflect.Method.invoke(Method.java:601)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:440)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at java.lang.reflect.Method.invoke(Method.java:601)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventBus.post(EventBus.java:268)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:140)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at java.lang.reflect.Method.invoke(Method.java:601)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventBus.post(EventBus.java:268)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:83)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at cpw.mods.fml.common.Loader.initializeMods(Loader.java:651)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:196)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.startGame(Minecraft.java:465)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.run(Minecraft.java:752)
2012-11-03 11:26:13 [iNFO] [sTDERR] 	at java.lang.Thread.run(Thread.java:722)

 

 

 

Minecraft Crash Report

 

 

--- BEGIN ERROR REPORT 72bff487 --------
Generated 03/11/12 11:26

- Minecraft Version: 1.4.2
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0_07, Oracle Corporation
- Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 760172240 bytes (724 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
- JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
- AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
- FML: MCP v7.19 FML v4.2.8.424 Minecraft Forge 6.0.1.349 4 mods loaded, 4 mods active
mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized
Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized
Alizter_aliztermod [Alizter's Mod] (bin) Unloaded->Constructed->Pre-initialized->Errored
- LWJGL: 2.4.2
- OpenGL: AMD Radeon HD 6700 Series   GL version 4.1.10516 Compatibility Profile Context, ATI Technologies Inc.
- Is Modded: Definitely; 'forge,fml'
- Type: Client
- Texture Pack: Default
- Profiler Position: N/A (disabled)
- Vec3 Pool Size: ~ERROR~ NullPointerException: null

java.lang.NullPointerException
at net.minecraft.src.ItemStack.<init>(ItemStack.java:37)
at net.minecraft.src.ItemStack.<init>(ItemStack.java:32)
at aliztermod.common.Aliztermod.load(Aliztermod.java:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:440)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
at com.google.common.eventbus.EventBus.post(EventBus.java:268)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:140)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
at com.google.common.eventbus.EventBus.post(EventBus.java:268)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:83)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:651)
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:196)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:465)
at net.minecraft.client.Minecraft.run(Minecraft.java:752)
at java.lang.Thread.run(Thread.java:722)
--- END ERROR REPORT fa1095d4 ----------


 

 

 

I would really appreciate if somebody could Help me with this as it is really annoying me.

Thank you.

 

~Alizter

Posted

Because you're using a block in your recipe before initializing it, which causes an NPE. I suggest to create your recipes after you initalize all blocks and items.

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

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