Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.7.2] [Solved] Recipes doesn't work. Crash.


SackCastellon
 Share

Recommended Posts

I've registered recipes as usually:

 

 

RecipeLoader.class

package SackCastellon.craftablehorsearmor.loader;

import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.registry.GameRegistry;

public class RecipeLoader {

public static final Item Stirrup = (Item)Item.field_150901_e.getObject("stirrup");

public void load() {

	Item.field_150901_e.func_148756_a(500, "stirrup", (new Item()).setUnlocalizedName("Stirrup").setCreativeTab(CreativeTabs.tabMisc).setTextureName(Reference.TexturePath + "Stirrup"));

}
}

 

ItemLoader.class

package SackCastellon.craftablehorsearmor.loader;

import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.registry.GameRegistry;

public class RecipeLoader {

public static void load() {

	 GameRegistry.addRecipe(new ItemStack(ItemLoader.Stirrup, 2), new Object[] {" I ", "I I", "III", 'I', Items.iron_ingot});
}
}

 

Main class

package SackCastellon.craftablehorsearmor;

import java.io.File;

import SackCastellon.core.helper.LogHelper;
import SackCastellon.craftablehorsearmor.loader.RecipeLoader;
import SackCastellon.craftablehorsearmor.proxy.CommonProxy;
import SackCastellon.craftablehorsearmor.reference.Reference;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
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.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;

@Mod(modid=Reference.MODID, name=Reference.NAME, version=Reference.VERSION, dependencies=Reference.DEPENDENCIES)
public class CraftableHorseArmor {	

    @Instance(Reference.MODID)
    public static CraftableHorseArmor instance;

    @SidedProxy(clientSide=Reference.CLPROXY, serverSide=Reference.CMPROXY)
    public static CommonProxy proxy;
   
    @EventHandler
    public void preInit(FMLPreInitializationEvent event) {

// Items
    	
    	LogHelper.info(Reference.MODID, "Loading items.");
    	
	try {

    	ItemLoader.load();
    	
		LogHelper.info(Reference.MODID, "Items succesfully loaded.");

	} catch(Exception e) {

		LogHelper.severe(Reference.MODID, "Could not load items.");
	} 

}
   
    @EventHandler
    public void load(FMLInitializationEvent event) {
    	
// Recipes
    	
    	LogHelper.info(Reference.MODID, "Loading Recipes.");
    	
	try {

    	RecipeLoader.load();
    	
		LogHelper.info(Reference.MODID, "Recipes succesfully loaded.");

	} catch(Exception e) {

		LogHelper.severe(Reference.MODID, "Could not load Recipes.");
	} 
    }
   
    @EventHandler
    public void postInit(FMLPostInitializationEvent event) {}

}

 

But when i run minecraft i get this crash:

 

 

Crash

[02:21:35] [Client thread/FATAL]: Reported exception thrown!
net.minecraft.util.ReportedException: Rendering item
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1139) ~[EntityRenderer.class:?]
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:979) ~[Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:869) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:103) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_25]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_25]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]
Caused by: java.lang.NullPointerException
at net.minecraft.item.ItemStack.getItemDamage(ItemStack.java:231) ~[itemStack.class:?]
at net.minecraft.client.renderer.entity.RenderItem.renderItemIntoGUI(RenderItem.java:406) ~[RenderItem.class:?]
at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:548) ~[RenderItem.class:?]
at net.minecraft.client.gui.inventory.GuiContainer.func_146977_a(GuiContainer.java:271) ~[GuiContainer.class:?]
at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:101) ~[GuiContainer.class:?]
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1109) ~[EntityRenderer.class:?]
... 9 more
---- Minecraft Crash Report ----
// Everything's going to plan. No, really, that was supposed to happen.

Time: 1/01/14 2:21
Description: Rendering item

java.lang.NullPointerException: Rendering item
at net.minecraft.item.ItemStack.getItemDamage(ItemStack.java:231)
at net.minecraft.client.renderer.entity.RenderItem.renderItemIntoGUI(RenderItem.java:406)
at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:548)
at net.minecraft.client.gui.inventory.GuiContainer.func_146977_a(GuiContainer.java:271)
at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:101)
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1109)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:979)
at net.minecraft.client.Minecraft.run(Minecraft.java:869)
at net.minecraft.client.main.Main.main(Main.java:103)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Stacktrace:
at net.minecraft.item.ItemStack.getItemDamage(ItemStack.java:231)
at net.minecraft.client.renderer.entity.RenderItem.renderItemIntoGUI(RenderItem.java:406)

-- Item being rendered --
Details:
Item Type: null
Item Aux: ~~ERROR~~ NullPointerException: null
Item NBT: null
Item Foil: ~~ERROR~~ NullPointerException: null
Stacktrace:
at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:548)
at net.minecraft.client.gui.inventory.GuiContainer.func_146977_a(GuiContainer.java:271)
at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:101)

-- Screen render details --
Details:
Screen name: net.minecraft.client.gui.inventory.GuiCrafting
Mouse location: Scaled: (176, 65). Absolute: (353, 348)
Screen size: Scaled: (427, 240). Absolute: (854, 480). Scale factor of 2

-- Affected level --
Details:
Level name: MpServer
All players: 1 total; [EntityClientPlayerMP['Player72'/2, l='MpServer', x=743,57, y=58,62, z=517,93]]
Chunk stats: MultiplayerChunkCache: 225, 225
Level seed: 0
Level generator: ID 01 - flat, ver 0. Features enabled: false
Level generator options: 
Level spawn location: World: (740,4,514), Chunk: (at 4,0,2 in 46,32; contains blocks 736,0,512 to 751,255,527), Region: (1,1; contains chunks 32,32 to 63,63, blocks 512,0,512 to 1023,255,1023)
Level time: 58474 game time, 58474 day time
Level dimension: 0
Level storage version: 0x00000 - Unknown?
Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
Forced entities: 3 total; [EntitySpider['Spider'/0, l='MpServer', x=718,53, y=56,00, z=531,75], EntitySpider['Spider'/1, l='MpServer', x=737,78, y=56,00, z=496,22], EntityClientPlayerMP['Player72'/2, l='MpServer', x=743,57, y=58,62, z=517,93]]
Retry entities: 0 total; []
Server brand: fml,forge
Server type: Integrated singleplayer server
Stacktrace:
at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:384)
at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2430)
at net.minecraft.client.Minecraft.run(Minecraft.java:891)
at net.minecraft.client.main.Main.main(Main.java:103)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

-- System Details --
Details:
Minecraft Version: 1.7.2
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_25, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 68640496 bytes (65 MB) / 414646272 bytes (395 MB) up to 878051328 bytes (837 MB)
JVM Flags: 0 total; 
AABB Pool Size: 20006 (1120336 bytes; 1 MB) allocated, 61 (3416 bytes; 0 MB) used
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v9.01-pre FML v7.2.28.976 Minecraft Forge 10.12.0.976 6 mods loaded, 6 mods active
mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
FML{7.2.28.976} [Forge Mod Loader] (forge-1.7.2-10.12.0.976-mcp.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Forge{10.12.0.976} [Minecraft Forge] (forge-1.7.2-10.12.0.976-mcp.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
examplemod{1.0} [Example Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
SKC-Core{1.1.0.0} [sKC Core] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
SKC-CraftableHorseArmor{1.1.0.0} [Craftable Horse Armor] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Launched Version: 1.7.2
LWJGL: 2.9.0
OpenGL: Intel(R) HD Graphics GL version 2.1.0 - Build 8.15.10.2827, Intel
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Packs: []
Current Language: ~~ERROR~~ NullPointerException: null
Profiler Position: N/A (disabled)
Vec3 Pool Size: 262 (14672 bytes; 0 MB) allocated, 61 (3416 bytes; 0 MB) used
Anisotropic Filtering: Off (1)
#@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Juanjo hijo\AppData\Roaming\Modding\forge-1.7.2-10.12.0.976-src\.\crash-reports\crash-2014-01-01_02.21.35-client.txt
AL lib: (EE) alc_cleanup: 1 device not closed

 

I couldn't find the problem.

So hope someone can find it.

 

Thanks for helping and have a happy new year.  :)

 

SOLUTION:

 

Click here: http://www.minecraftforge.net/forum/index.php/topic,15103.msg76893.html#msg76893

Or go to the penultimate message

Link to comment
Share on other sites

I'm unclear as the code changes from 1.6 to 1.7 as far as this or if you left code out for just the post but by looking at what you posted I can see

You forgot to put this at the top of your load eventhandler

proxy.registerRenderers();

 

Also another change to help you is how your associating your other files functions.

 

try:

 

ItemLoader:

package SackCastellon.craftablehorsearmor.loader;

import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.registry.GameRegistry;

public class ItemLoader {
       private static ItemStack stirrupStack = new ItemStack(this.Stirrup, 2);
      private static ItemStack ironStack = new ItemStack(Items.ingot, 1);

public static void load() {

	 GameRegistry.addRecipe(stirrupStack ," I ","I I","III",
            				'I',ironStack);
}
}

 

Also With that hopefully your already registering the stirrup Item using gameregistry and languageregistry prior to your recipe registry

 

below would be how you bring it into your load event.

 

package SackCastellon.craftablehorsearmor;

import java.io.File;

import SackCastellon.core.helper.LogHelper;
import SackCastellon.craftablehorsearmor.loader.RecipeLoader;
import SackCastellon.craftablehorsearmor.proxy.CommonProxy;
import SackCastellon.craftablehorsearmor.reference.Reference;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
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.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;

@Mod(modid=Reference.MODID, name=Reference.NAME, version=Reference.VERSION, dependencies=Reference.DEPENDENCIES)
public class CraftableHorseArmor {	

    @Instance(Reference.MODID)
    public static CraftableHorseArmor instance;

    @SidedProxy(clientSide=Reference.CLPROXY, serverSide=Reference.CMPROXY)
    public static CommonProxy proxy;
   
    public static ItemLoader registerItems = new ItemLoader ();

    @EventHandler
    public void preInit(FMLPreInitializationEvent event) {}
   
    @EventHandler
    public void load(FMLInitializationEvent event) {
    	
         proxy.registerRenderers();
// Items
    	registerItems.load();
    	
    }
   
    @EventHandler
    public void postInit(FMLPostInitializationEvent event) {}

}

Link to comment
Share on other sites

I get recipes work in my mod. Code is below

	GameRegistry.addRecipe(new ItemStack(mysimpletool, 1), new Object[]{ "XXX", " # ", " # ", ('X'), Items.apple, ('#'), Items.coal});

 

mysimple tool is described in main class of mod

public static Item mysimpletool;

and in preInit in mainclass

mysimpletool = new ItemMySimpleTool().setUnlocalizedName("mysimpletool");

 

P.S. I would appreciate if you say me how to register textures

[spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler]LOL,Its nothing interesting here

[spoiler=Spoiler]And here too

[spoiler=Spoiler]But that image is pretty good

 

 

 

 

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

I get recipes work in my mod. Code is below

	GameRegistry.addRecipe(new ItemStack(mysimpletool, 1), new Object[]{ "XXX", " # ", " # ", ('X'), Items.apple, ('#'), Items.coal});

 

mysimple tool is described in main class of mod

public static Item mysimpletool;

and in preInit in mainclass

mysimpletool = new ItemMySimpleTool().setUnlocalizedName("mysimpletool");

 

P.S. I would appreciate if you say me how to register textures

 

Thanks, it works

Link to comment
Share on other sites

I get recipes work in my mod. Code is below

	GameRegistry.addRecipe(new ItemStack(mysimpletool, 1), new Object[]{ "XXX", " # ", " # ", ('X'), Items.apple, ('#'), Items.coal});

 

mysimple tool is described in main class of mod

public static Item mysimpletool;

and in preInit in mainclass

mysimpletool = new ItemMySimpleTool().setUnlocalizedName("mysimpletool");

 

P.S. I would appreciate if you say me how to register textures

 

That should work

 

public static Item mysimpletool;

 

mysimpletool = new ItemMySimpleTool().setUnlocalizedName("mysimpletool").setTextureName("yourmodid:mysimpletool"); 

 

GameRegistry.registerItem(mysimpletool, "mysimpletool");

 

Link to comment
Share on other sites

I get recipes work in my mod. Code is below

	GameRegistry.addRecipe(new ItemStack(mysimpletool, 1), new Object[]{ "XXX", " # ", " # ", ('X'), Items.apple, ('#'), Items.coal});

 

mysimple tool is described in main class of mod

public static Item mysimpletool;

and in preInit in mainclass

mysimpletool = new ItemMySimpleTool().setUnlocalizedName("mysimpletool");

 

P.S. I would appreciate if you say me how to register textures

 

That should work

 

public static Item mysimpletool;

 

mysimpletool = new ItemMySimpleTool().setUnlocalizedName("mysimpletool").setTextureName("yourmodid:mysimpletool"); 

 

GameRegistry.registerItem(mysimpletool, "mysimpletool");

 

Yes, it works, but i already used it

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

 Share



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I've been trying to get a server running on my Raspberry Pi, but run.sh won't function properly! I've used chmod, but it fails every time I try to run it. Here's the output: pi@raspberrypi:~/🅱️orge $ sudo chmod +x run.sh pi@raspberrypi:~/🅱️orge $ ./run.sh Exception in thread "main" java.lang.ExceptionInInitializerError at cpw.mods.securejarhandler@1.0.3/cpw.mods.jarhandling.SecureJar.from(SecureJar.java:58) at cpw.mods.securejarhandler@1.0.3/cpw.mods.jarhandling.SecureJar.from(SecureJar.java:50) at cpw.mods.securejarhandler@1.0.3/cpw.mods.jarhandling.SecureJar.from(SecureJar.java:42) at cpw.mods.bootstraplauncher@1.0.0/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:93) Caused by: java.lang.IllegalArgumentException: Error decoding percent encoded characters at java.base/sun.net.www.ParseUtil.decode(ParseUtil.java:218) at java.base/jdk.internal.loader.URLClassPath$FileLoader.<init>(URLClassPath.java:1219) at java.base/jdk.internal.loader.URLClassPath$3.run(URLClassPath.java:488) at java.base/jdk.internal.loader.URLClassPath$3.run(URLClassPath.java:482) at java.base/java.security.AccessController.doPrivileged(AccessController.java:712) at java.base/jdk.internal.loader.URLClassPath.getLoader(URLClassPath.java:481) at java.base/jdk.internal.loader.URLClassPath.getLoader(URLClassPath.java:449) at java.base/jdk.internal.loader.URLClassPath$1.next(URLClassPath.java:345) at java.base/jdk.internal.loader.URLClassPath$1.hasMoreElements(URLClassPath.java:356) at java.base/jdk.internal.loader.BuiltinClassLoader$1.hasNext(BuiltinClassLoader.java:408) at java.base/jdk.internal.loader.BuiltinClassLoader$1.hasMoreElements(BuiltinClassLoader.java:416) at java.base/java.lang.CompoundEnumeration.next(ClassLoader.java:2725) at java.base/java.lang.CompoundEnumeration.hasMoreElements(ClassLoader.java:2734) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass(ServiceLoader.java:1210) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1228) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1273) at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1309) at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1393) at java.base/java.nio.file.spi.FileSystemProvider.loadInstalledProviders(FileSystemProvider.java:156) at java.base/java.nio.file.spi.FileSystemProvider$1.run(FileSystemProvider.java:207) at java.base/java.nio.file.spi.FileSystemProvider$1.run(FileSystemProvider.java:204) at java.base/java.security.AccessController.doPrivileged(AccessController.java:318) at java.base/java.nio.file.spi.FileSystemProvider.installedProviders(FileSystemProvider.java:204) at cpw.mods.securejarhandler@1.0.3/cpw.mods.jarhandling.impl.Jar.<clinit>(Jar.java:29) ... 4 more (Yes, the 🅱️s are intentional)
    • when i press install on any version it says "adfoc.us redirected you too many times" and i cant install any version. please help.
    • I've got flywheel installed but it still gives me the exit on error
    • https://www.dropbox.com/s/zrit7mgov31left/2022-08-14-7.log?dl=0
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.