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

Updating screen events java.lang.ArrayIndexOutOfBoundsException: -1


Recommended Posts

Minecraft crashes when i craft a tool in crafting bench and i get this in crash report:

 

 

 

 

---- Minecraft Crash Report ----

// My bad.

 

Time: 1/31/16 7:39 PM

Description: Updating screen events

 

java.lang.ArrayIndexOutOfBoundsException: -1

at net.minecraft.item.ItemStack.onCrafting(ItemStack.java:481)

at net.minecraft.inventory.SlotCrafting.onCrafting(SlotCrafting.java:70)

at net.minecraft.inventory.SlotCrafting.onPickupFromSlot(SlotCrafting.java:127)

at net.minecraft.inventory.Container.slotClick(Container.java:438)

at net.minecraft.client.multiplayer.PlayerControllerMP.windowClick(PlayerControllerMP.java:478)

at net.minecraft.client.gui.inventory.GuiContainer.handleMouseClick(GuiContainer.java:676)

at net.minecraft.client.gui.inventory.GuiContainer.checkHotbarKeys(GuiContainer.java:715)

at net.minecraft.client.gui.inventory.GuiContainer.keyTyped(GuiContainer.java:689)

at net.minecraft.client.gui.GuiScreen.handleKeyboardInput(GuiScreen.java:370)

at net.minecraft.client.gui.GuiScreen.handleInput(GuiScreen.java:321)

at net.minecraft.client.Minecraft.runTick(Minecraft.java:1731)

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1039)

at net.minecraft.client.Minecraft.run(Minecraft.java:962)

at net.minecraft.client.main.Main.main(Main.java:164)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:497)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

at GradleStart.main(Unknown Source)

 

 

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

---------------------------------------------------------------------------------------

 

-- Head --

Stacktrace:

at net.minecraft.item.ItemStack.onCrafting(ItemStack.java:481)

at net.minecraft.inventory.SlotCrafting.onCrafting(SlotCrafting.java:70)

at net.minecraft.inventory.SlotCrafting.onPickupFromSlot(SlotCrafting.java:127)

at net.minecraft.inventory.Container.slotClick(Container.java:438)

at net.minecraft.client.multiplayer.PlayerControllerMP.windowClick(PlayerControllerMP.java:478)

at net.minecraft.client.gui.inventory.GuiContainer.handleMouseClick(GuiContainer.java:676)

at net.minecraft.client.gui.inventory.GuiContainer.checkHotbarKeys(GuiContainer.java:715)

at net.minecraft.client.gui.inventory.GuiContainer.keyTyped(GuiContainer.java:689)

at net.minecraft.client.gui.GuiScreen.handleKeyboardInput(GuiScreen.java:370)

at net.minecraft.client.gui.GuiScreen.handleInput(GuiScreen.java:321)

 

-- Affected screen --

Details:

Screen name: net.minecraft.client.gui.inventory.GuiCrafting

 

-- Affected level --

Details:

Level name: MpServer

All players: 1 total; [EntityClientPlayerMP['SackboyAlamode'/226, l='MpServer', x=-733.92, y=5.62, z=-710.56]]

Chunk stats: MultiplayerChunkCache: 25, 25

Level seed: 0

Level generator: ID 01 - flat, ver 0. Features enabled: false

Level generator options:

Level spawn location: World: (-723,4,-712), Chunk: (at 13,0,8 in -46,-45; contains blocks -736,0,-720 to -721,255,-705), Region: (-2,-2; contains chunks -64,-64 to -33,-33, blocks -1024,0,-1024 to -513,255,-513)

Level time: 8306 game time, 8306 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: 46 total; [EntitySlime['Slime'/26244, l='MpServer', x=-738.78, y=4.00, z=-709.31], EntitySlime['Slime'/298816, l='MpServer', x=-700.53, y=2.58, z=-787.64], EntitySheep['Sheep'/70, l='MpServer', x=-760.84, y=4.00, z=-676.97], EntitySlime['Slime'/298818, l='MpServer', x=-683.32, y=3.71, z=-756.52], EntitySheep['Sheep'/71, l='MpServer', x=-762.81, y=4.00, z=-681.84], EntityCow['Cow'/72, l='MpServer', x=-757.53, y=4.00, z=-672.50], EntitySlime['Slime'/74889, l='MpServer', x=-673.86, y=3.13, z=-694.50], EntityCow['Cow'/73, l='MpServer', x=-766.97, y=4.00, z=-681.53], EntitySlime['Slime'/102920, l='MpServer', x=-783.99, y=3.50, z=-751.18], EntityChicken['Chicken'/74, l='MpServer', x=-764.03, y=4.00, z=-685.22], EntitySlime['Slime'/108939, l='MpServer', x=-758.11, y=4.47, z=-714.58], EntityChicken['Chicken'/75, l='MpServer', x=-761.53, y=4.00, z=-675.63], EntitySlime['Slime'/413131, l='MpServer', x=-735.90, y=3.13, z=-668.52], EntityItemFrame['entity.ItemFrame.name'/83, l='MpServer', x=-738.94, y=4.50, z=-709.50], EntityItemFrame['entity.ItemFrame.name'/84, l='MpServer', x=-738.94, y=4.50, z=-710.50], EntityItemFrame['entity.ItemFrame.name'/85, l='MpServer', x=-738.94, y=4.50, z=-711.50], EntityItemFrame['entity.ItemFrame.name'/86, l='MpServer', x=-738.94, y=5.50, z=-711.50], EntityItemFrame['entity.ItemFrame.name'/87, l='MpServer', x=-738.94, y=5.50, z=-709.50], EntityItemFrame['entity.ItemFrame.name'/88, l='MpServer', x=-738.50, y=4.50, z=-709.06], EntitySlime['Slime'/339869, l='MpServer', x=-683.86, y=5.12, z=-721.49], EntitySlime['Slime'/186010, l='MpServer', x=-735.21, y=5.06, z=-716.80], EntityItemFrame['entity.ItemFrame.name'/89, l='MpServer', x=-737.50, y=4.50, z=-709.06], EntityItemFrame['entity.ItemFrame.name'/90, l='MpServer', x=-738.50, y=5.50, z=-709.06], EntityItemFrame['entity.ItemFrame.name'/91, l='MpServer', x=-737.50, y=5.50, z=-709.06], EntityItemFrame['entity.ItemFrame.name'/92, l='MpServer', x=-737.50, y=6.50, z=-709.06], EntityItemFrame['entity.ItemFrame.name'/93, l='MpServer', x=-738.50, y=4.50, z=-711.94], EntityItemFrame['entity.ItemFrame.name'/94, l='MpServer', x=-738.50, y=4.50, z=-711.94], EntitySlime['Slime'/51422, l='MpServer', x=-726.12, y=4.00, z=-719.50], EntityItemFrame['entity.ItemFrame.name'/95, l='MpServer', x=-738.50, y=5.50, z=-711.94], EntityItemFrame['entity.ItemFrame.name'/96, l='MpServer', x=-737.50, y=5.50, z=-711.94], EntityItemFrame['entity.ItemFrame.name'/97, l='MpServer', x=-737.50, y=4.50, z=-711.94], EntityItemFrame['entity.ItemFrame.name'/98, l='MpServer', x=-737.50, y=6.50, z=-711.94], EntitySlime['Slime'/99, l='MpServer', x=-765.74, y=3.44, z=-773.49], EntityCow['Cow'/100, l='MpServer', x=-751.47, y=4.00, z=-676.34], EntitySlime['Slime'/448355, l='MpServer', x=-738.13, y=4.81, z=-680.10], EntitySlime['Slime'/371424, l='MpServer', x=-723.11, y=4.00, z=-746.94], EntitySlime['Slime'/58666, l='MpServer', x=-738.20, y=3.42, z=-761.41], EntitySlime['Slime'/74477, l='MpServer', x=-696.41, y=4.62, z=-740.15], EntitySlime['Slime'/288169, l='MpServer', x=-758.50, y=4.00, z=-742.41], EntitySlime['Slime'/53232, l='MpServer', x=-676.29, y=3.64, z=-688.75], EntitySlime['Slime'/123888, l='MpServer', x=-671.32, y=3.25, z=-739.22], EntityClientPlayerMP['SackboyAlamode'/226, l='MpServer', x=-733.92, y=5.62, z=-710.56], EntitySlime['Slime'/190006, l='MpServer', x=-785.71, y=3.13, z=-648.22], EntitySlime['Slime'/311666, l='MpServer', x=-685.82, y=3.90, z=-723.86], EntitySlime['Slime'/135284, l='MpServer', x=-723.94, y=4.00, z=-749.42], EntitySlime['Slime'/51389, l='MpServer', x=-805.80, y=4.67, z=-639.09]]

Retry entities: 0 total; []

Server brand: fml,forge

Server type: Integrated singleplayer server

Stacktrace:

at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:415)

at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2566)

at net.minecraft.client.Minecraft.run(Minecraft.java:984)

at net.minecraft.client.main.Main.main(Main.java:164)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:497)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

at GradleStart.main(Unknown Source)

 

-- System Details --

Details:

Minecraft Version: 1.7.10

Operating System: Windows 8.1 (amd64) version 6.3

Java Version: 1.8.0_51, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 319920552 bytes (305 MB) / 555220992 bytes (529 MB) up to 1657274368 bytes (1580 MB)

JVM Flags: 0 total;

AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1558 4 mods loaded, 4 mods active

States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

UCHIJAAAA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)

UCHIJAAAA FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar)

UCHIJAAAA Forge{10.13.4.1558} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar)

UCHIJAAAA Industrial{1.0.0} [industrialization] (bin)

GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.3.12804 Compatibility Profile Context 13.352.1004.1010' Renderer: 'AMD Radeon R5 Graphics'

Launched Version: 1.7.10

LWJGL: 2.9.1

OpenGL: AMD Radeon R5 Graphics GL version 4.3.12804 Compatibility Profile Context 13.352.1004.1010, ATI Technologies Inc.

GL Caps: Using GL 1.3 multitexturing.

Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.

Anisotropic filtering is supported and maximum anisotropy is 16.

Shaders are available because OpenGL 2.1 is supported.

 

Is Modded: Definitely; Client brand changed to 'fml,forge'

Type: Client (map_client.txt)

Resource Packs: []

Current Language: English (US)

Profiler Position: N/A (disabled)

Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

Anisotropic Filtering: Off (1)

 

 

Link to post
Share on other sites

You posted this in the wrong section, which is probably why diesieben07 thought this was about your own mod's GUI. Modder Support is for mod developers, Support is for users.

 

This crash occurred because you tried to craft an item without an ID. Report this to the author of the mod you were trying to craft an item from.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to post
Share on other sites

Revision, i tested with my recipes for the other 4 types of broadswords(diamond,iron,wood,gold) and get the same crash in all of them, the code in my crafting recipes class being:

 

GameRegistry.addRecipe(new ItemStack(ModItems.ironBroadsword), "CBA", "BAB", "DBC", 'C', Items.string, 'B', Items.iron_ingot, 'A', Blocks.iron_block, 'D', Items.stick);

Link to post
Share on other sites

thank you Choonster for clarifying, i was unclear, i am developing a mod and am having trouble crafting items in my mod in a vanilla crafting table, specifically a sword Stone Broadsword, and tested that all of the crafting recipes for the different types of broadswords didn't work with the same crash. I am also a new mod developer, but i understand some java and have played minecraft for a while, i have been making this mod for about a month, making blocks and items, but as you can see having trouble with swords...

Link to post
Share on other sites

So to be clear, the crash happens using the vanilla crafting bench with the recipe you showed? If that's the case, try rolling back to an earlier version of Forge such as 1448 and testing if the crash still occurs there.

 

Some Forge releases occasionally have issues such as this, and testing on a known stable version can at least rule out Forge as the culprit. Personally, I've had the best experience with the 1448 release for 1.7.10, which is why I recommend testing against that.

 

If you still have issues on 1448, post your custom Item class, if there is one, and any other code that may relate to your issue.

Link to post
Share on other sites

is the item id its unlocalized name? or do you have to specifically set an id?

 

The item ID is automatically set when you register your item using

GameRegistry.registerItem

. You must register every

Item

you add.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to post
Share on other sites

Thank you coolAlias for the quick, descriptive reply.  i will change the forge directory now and post my results when i check it. To clarify though, i have had success crafting other items such as blocks, but not the swords. Thank you choonster, i have registered all of my items i have added in my ModItems Class

Link to post
Share on other sites

Thank you coolAlias for the quick, descriptive reply.  i will change the forge directory now and post my results when i check it. To clarify though, i have had success crafting other items such as blocks, but not the swords. Thank you choonster, i have registered all of my items i have added in my ModItems Class

If your other crafting recipes work, it is very unlikely to be an issue with Forge - that's just something to check when all else fails, and I didn't see anything in your recipe that looked off. ;)

 

Post your sword class, if possible, and any custom recipe handler involved in those recipes.

Link to post
Share on other sites

i checked with forge 1448 , same crash though. I use a single ModCrafting class for recipe registering.

 

My ItemModSword Class Is:

 

package com.SackboyAlamode.Industrialization.item;

 

import com.SackboyAlamode.Industrialization.Main;

 

import net.minecraft.item.ItemSword;

 

public class ItemModSword extends ItemSword{

 

public ItemModSword(String unlocalizedName, ToolMaterial material) {

super(material);

this.setUnlocalizedName(unlocalizedName);

this.setTextureName(Main.MODID + ":" + unlocalizedName);

 

}

 

}

 

 

My ModItems Class is:

 

package com.SackboyAlamode.Industrialization.item;

 

 

 

import com.SackboyAlamode.Industrialization.Main;

 

import cpw.mods.fml.common.registry.GameRegistry;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.item.Item;

import net.minecraft.item.Item.ToolMaterial;

import net.minecraftforge.common.util.EnumHelper;

 

public final class ModItems {

//Materials

//("MaterialName", harvestLevel, durability, miningSpeed, damageVsEntites, enchantability);

public static ToolMaterial AWOOD = EnumHelper.addToolMaterial("AWOOD", 2, 512, 7.0F, 1.0F, 1);

public static ToolMaterial ASTONE = EnumHelper.addToolMaterial("ASTONE", 2, 1024, 7.0F, 2.0F, 5);

public static ToolMaterial AIRON = EnumHelper.addToolMaterial("AIRON", 2, 2048, 7.0F, 4.0F, 15);

public static ToolMaterial AGOLD = EnumHelper.addToolMaterial("AGOLD", 2, 256, 7.0F, 3.0F, 30);

public static ToolMaterial ADIAMOND = EnumHelper.addToolMaterial("ADIAMOND", 2, 8192, 6.0F, 6.0F, 10);

public static ToolMaterial BWOOD = EnumHelper.addToolMaterial("BWOOD", 2, 512, 7.0F, 1.5F, 1);

public static ToolMaterial BSTONE = EnumHelper.addToolMaterial("BSTONE", 2, 1024, 7.0F, 2.5F, 5);

public static ToolMaterial BIRON = EnumHelper.addToolMaterial("BIRON", 2, 2048, 7.0F, 7.0F, 15);

public static ToolMaterial BGOLD = EnumHelper.addToolMaterial("BGOLD", 2, 256, 7.0F, 5.0F, 30);

public static ToolMaterial BDIAMOND = EnumHelper.addToolMaterial("BDIAMOND", 2, 8192, 11.0F, 11.0F, 10);

 

//Items

public static Item woodGrindstone;

public static Item stoneGrindstone;

public static Item ironGrindstone;

public static Item goldGrindstone;

public static Item diamondGrindstone;

public static Item woodBroadsword;

public static Item stoneBroadsword;

public static Item ironBroadsword;

public static Item goldBroadsword;

public static Item diamondBroadsword;

public static Item sharpenedWoodBroadsword;

public static Item sharpenedStoneBroadsword;

public static Item sharpenedIronBroadsword;

public static Item sharpenedGoldBroadsword;

public static Item sharpenedDiamondBroadsword;

 

public static final void init() {

//Creating Items

woodGrindstone = new Item().setUnlocalizedName("woodGrindstone").setCreativeTab(CreativeTabs.tabTools).setTextureName(Main.MODID + ":woodGrindstone");

stoneGrindstone = new Item().setUnlocalizedName("stoneGrindstone").setCreativeTab(CreativeTabs.tabTools).setTextureName(Main.MODID + ":stoneGrindstone");

ironGrindstone = new Item().setUnlocalizedName("ironGrindstone").setCreativeTab(CreativeTabs.tabTools).setTextureName(Main.MODID + ":ironGrindstone");

goldGrindstone = new Item().setUnlocalizedName("goldGrindstone").setCreativeTab(CreativeTabs.tabTools).setTextureName(Main.MODID + ":goldGrindstone");

diamondGrindstone = new Item().setUnlocalizedName("diamondGrindstone").setCreativeTab(CreativeTabs.tabTools).setTextureName(Main.MODID + ":diamondGrindstone");

woodBroadsword = new Item().setUnlocalizedName("woodBroadsword").setCreativeTab(CreativeTabs.tabCombat).setTextureName(Main.MODID + ":woodBroadsword");

stoneBroadsword = new Item().setUnlocalizedName("stoneBroadsword").setCreativeTab(CreativeTabs.tabCombat).setTextureName(Main.MODID + ":stoneBroadsword");

ironBroadsword = new Item().setUnlocalizedName("ironBroadsword").setCreativeTab(CreativeTabs.tabCombat).setTextureName(Main.MODID + ":ironBroadsword");

goldBroadsword = new Item().setUnlocalizedName("goldBroadsword").setCreativeTab(CreativeTabs.tabCombat).setTextureName(Main.MODID + ":goldBroadsword");

diamondBroadsword = new Item().setUnlocalizedName("diamondBroadsword").setCreativeTab(CreativeTabs.tabCombat).setTextureName(Main.MODID + ":diamondBroadsword");

sharpenedWoodBroadsword = new Item().setUnlocalizedName("sharpenedWoodBroadsword").setCreativeTab(CreativeTabs.tabCombat).setTextureName(Main.MODID + ":sharpenedWoodBroadsword");

sharpenedStoneBroadsword = new Item().setUnlocalizedName("sharpenedStoneBroadsword").setCreativeTab(CreativeTabs.tabCombat).setTextureName(Main.MODID + ":sharpenedStoneBroadsword");

sharpenedIronBroadsword = new Item().setUnlocalizedName("sharpenedIronBroadsword").setCreativeTab(CreativeTabs.tabCombat).setTextureName(Main.MODID + ":sharpenedIronBroadsword");

sharpenedGoldBroadsword = new Item().setUnlocalizedName("sharpenedGoldBroadsword").setCreativeTab(CreativeTabs.tabCombat).setTextureName(Main.MODID + ":sharpenedGoldBroadsword");

sharpenedDiamondBroadsword = new Item().setUnlocalizedName("sharpenedDiamondBroadsword").setCreativeTab(CreativeTabs.tabCombat).setTextureName(Main.MODID + ":sharpenedDiamondBroadsword");

//Registering Items

GameRegistry.registerItem(new ItemModSword("woodBroadsword", AWOOD), "woodBroadsword");

GameRegistry.registerItem(new ItemModSword("stoneBroadsword", ASTONE), "stoneBroadsword");

GameRegistry.registerItem(new ItemModSword("ironBroadsword", AIRON), "ironBroadsword");

GameRegistry.registerItem(new ItemModSword("goldBroadsword", AGOLD), "goldBroadsword");

GameRegistry.registerItem(new ItemModSword("diamondBroadsword", ADIAMOND), "diamondBroadsword");

GameRegistry.registerItem(new ItemModSword("sharpenedWoodBroadsword", BWOOD), "sharpenedWoodBroadsword");

GameRegistry.registerItem(new ItemModSword("sharpenedStoneBroadsword", BSTONE), "sharpenedStoneBroadsword");

GameRegistry.registerItem(new ItemModSword("sharpenedIronBroadsword", BIRON), "sharpenedIronBroadsword");

GameRegistry.registerItem(new ItemModSword("sharpenedGoldBroadsword", BGOLD), "sharpenedGoldBroadsword");

GameRegistry.registerItem(new ItemModSword("sharpenedDiamondBroadsword", BDIAMOND), "sharpenedDiamondBroadsword");

GameRegistry.registerItem(woodGrindstone, "woodGrindstone");

GameRegistry.registerItem(stoneGrindstone, "stoneGrindstone");

GameRegistry.registerItem(ironGrindstone, "ironGrindstone");

GameRegistry.registerItem(goldGrindstone, "goldGrindstone");

GameRegistry.registerItem(diamondGrindstone, "diamondGrindstone");

}

 

}

 

My ModCrafting Class is:

 

package com.SackboyAlamode.Industrialization.crafting;

 

import com.SackboyAlamode.Industrialization.block.ModBlocks;

import com.SackboyAlamode.Industrialization.item.ModItems;

 

import cpw.mods.fml.common.registry.GameRegistry;

import net.minecraft.init.Blocks;

import net.minecraft.init.Items;

import net.minecraft.item.ItemStack;

 

 

public class ModCrafting {

public static final void init() {

//Recipes

//Blocks

GameRegistry.addRecipe(new ItemStack(ModBlocks.compressedWood), "ABA", "BAB", "ABA", 'A', Blocks.log, 'B', Blocks.planks);

GameRegistry.addRecipe(new ItemStack(ModBlocks.compressedStone), "ABA", "BAB", "ABA", 'A', Blocks.stone, 'B', Blocks.cobblestone);

GameRegistry.addRecipe(new ItemStack(ModBlocks.compressedSand), "ABA", "BAB", "ABA", 'A', Blocks.sand, 'B', Blocks.sandstone);

GameRegistry.addRecipe(new ItemStack(ModBlocks.compressedDirt), "ABA", "BAB", "ABA", 'A', Blocks.dirt, 'B', ModBlocks.mixedDirt);

GameRegistry.addRecipe(new ItemStack(ModBlocks.compressedGravel), "ABA", "BAB", "ABA", 'A', Blocks.gravel, 'B', Blocks.cobblestone);

GameRegistry.addRecipe(new ItemStack(ModBlocks.compressedCobblestone), "ABA", "BAB", "ABA", 'A', Blocks.cobblestone, 'B', Blocks.stone);

GameRegistry.addRecipe(new ItemStack(ModBlocks.lantern), "ABA", "BCB", "ABA", 'A', Blocks.planks, 'B', Items.paper, 'C', Blocks.torch);

GameRegistry.addRecipe(new ItemStack(ModBlocks.paperWrappedPlanks), "AAA", "ABA", "AAA", 'A', Items.paper, 'B', Blocks.planks);

//Items

GameRegistry.addRecipe(new ItemStack(ModItems.woodBroadsword), "CBA", "BAB", "DBC", 'C', Items.string, 'B', Blocks.planks, 'A', ModBlocks.compressedWood, 'D', Items.stick);

GameRegistry.addRecipe(new ItemStack(ModItems.stoneBroadsword), "CBA", "BAB", "DBC", 'C', Items.string, 'B', Blocks.stone, 'A', ModBlocks.compressedStone, 'D', Items.stick);

GameRegistry.addRecipe(new ItemStack(ModItems.ironBroadsword), "CBA", "BAB", "DBC", 'C', Items.string, 'B', Items.iron_ingot, 'A', Blocks.iron_block, 'D', Items.stick);

GameRegistry.addRecipe(new ItemStack(ModItems.goldBroadsword), "CBA", "BAB", "DBC", 'C', Items.string, 'B', Items.gold_ingot, 'A', Blocks.gold_block, 'D', Items.stick);

GameRegistry.addRecipe(new ItemStack(ModItems.diamondBroadsword), "CBA", "BAB", "DBC", 'C', Items.string, 'B', Items.diamond, 'A', Blocks.diamond_block, 'D', Items.stick);

GameRegistry.addRecipe(new ItemStack(ModItems.woodGrindstone), "ABA", "B B", "ABA", 'A', Blocks.planks, 'B', ModBlocks.compressedWood);

GameRegistry.addRecipe(new ItemStack(ModItems.stoneGrindstone), "ABA", "BCB", "ABA", 'A', Blocks.stone, 'B', ModBlocks.compressedStone, 'C', ModItems.woodGrindstone);

GameRegistry.addRecipe(new ItemStack(ModItems.ironGrindstone), "ABA", "BCB", "ABA", 'A', Items.iron_ingot, 'B', Blocks.iron_block, 'C', ModItems.stoneGrindstone);

GameRegistry.addRecipe(new ItemStack(ModItems.goldGrindstone), "ABA", "BCB", "ABA", 'A', Items.gold_ingot, 'B', Blocks.gold_block, 'C', ModItems.ironGrindstone);

GameRegistry.addRecipe(new ItemStack(ModItems.diamondGrindstone), "ABA", "BCB", "ABA", 'A', Items.diamond, 'B', Blocks.diamond_block, 'C', ModItems.goldGrindstone);

//Shapeless Recipes

//Blocks

GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.mixedDirt), new Object[] {Blocks.gravel,Blocks.dirt});

GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedWoodBroadsword), new Object[] {ModItems.woodGrindstone,ModItems.woodBroadsword});

GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedWoodBroadsword), new Object[] {ModItems.woodBroadsword,ModItems.stoneGrindstone});

GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedWoodBroadsword), new Object[] {ModItems.woodBroadsword,ModItems.ironGrindstone});

GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedWoodBroadsword), new Object[] {ModItems.woodBroadsword,ModItems.goldGrindstone});

GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedWoodBroadsword), new Object[] {ModItems.woodBroadsword,ModItems.diamondGrindstone});

GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedStoneBroadsword), new Object[] {ModItems.stoneBroadsword,ModItems.stoneGrindstone});

GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedStoneBroadsword), new Object[] {ModItems.stoneBroadsword,ModItems.ironGrindstone});

GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedStoneBroadsword), new Object[] {ModItems.stoneBroadsword,ModItems.goldGrindstone});

GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedStoneBroadsword), new Object[] {ModItems.stoneBroadsword,ModItems.diamondGrindstone});

GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedIronBroadsword), new Object[] {ModItems.ironBroadsword,ModItems.ironGrindstone});

GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedIronBroadsword), new Object[] {ModItems.ironBroadsword,ModItems.goldGrindstone});

GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedIronBroadsword), new Object[] {ModItems.ironBroadsword,ModItems.diamondGrindstone});

GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedGoldBroadsword), new Object[] {ModItems.goldBroadsword,ModItems.goldGrindstone});

GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedGoldBroadsword), new Object[] {ModItems.goldBroadsword,ModItems.diamondGrindstone});

GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedDiamondBroadsword), new Object[] {ModItems.diamondBroadsword,ModItems.diamondGrindstone});

//Items

}

 

 

 

}

 

 

 

 

 

Thanks for the help guys, i am not going to be able to reply until tomorrow however and will check what you all have posted then. Again, thanks for the amazing assistance.

 

 

 

 

 

Link to post
Share on other sites

i checked with forge 1448 , same crash though. I use a single ModCrafting class for recipe registering.

 

My ItemModSword Class Is:

package com.SackboyAlamode.Industrialization.item;

import com.SackboyAlamode.Industrialization.Main;

import net.minecraft.item.ItemSword;

public class ItemModSword extends ItemSword{

public ItemModSword(String unlocalizedName, ToolMaterial material) {
	super(material);
	this.setUnlocalizedName(unlocalizedName);
	this.setTextureName(Main.MODID + ":" + unlocalizedName);

}

}


My ModItems Class is:

package com.SackboyAlamode.Industrialization.item;



import com.SackboyAlamode.Industrialization.Main;

import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraftforge.common.util.EnumHelper;

public final class ModItems {
//Materials
//("MaterialName", harvestLevel, durability, miningSpeed, damageVsEntites, enchantability);
	public static ToolMaterial AWOOD = EnumHelper.addToolMaterial("AWOOD", 2, 512, 7.0F, 1.0F, 1);
	public static ToolMaterial ASTONE = EnumHelper.addToolMaterial("ASTONE", 2, 1024, 7.0F, 2.0F, 5);
	public static ToolMaterial AIRON = EnumHelper.addToolMaterial("AIRON", 2, 2048, 7.0F, 4.0F, 15);
	public static ToolMaterial AGOLD = EnumHelper.addToolMaterial("AGOLD", 2, 256, 7.0F, 3.0F, 30);
	public static ToolMaterial ADIAMOND = EnumHelper.addToolMaterial("ADIAMOND", 2, 8192, 6.0F, 6.0F, 10);
	public static ToolMaterial BWOOD = EnumHelper.addToolMaterial("BWOOD", 2, 512, 7.0F, 1.5F, 1);
	public static ToolMaterial BSTONE = EnumHelper.addToolMaterial("BSTONE", 2, 1024, 7.0F, 2.5F, 5);
	public static ToolMaterial BIRON = EnumHelper.addToolMaterial("BIRON", 2, 2048, 7.0F, 7.0F, 15);
	public static ToolMaterial BGOLD = EnumHelper.addToolMaterial("BGOLD", 2, 256, 7.0F, 5.0F, 30);
	public static ToolMaterial BDIAMOND = EnumHelper.addToolMaterial("BDIAMOND", 2, 8192, 11.0F, 11.0F, 10);

	//Items
	public static Item woodGrindstone;
	public static Item stoneGrindstone;
	public static Item ironGrindstone;
	public static Item goldGrindstone;
	public static Item diamondGrindstone;
	public static Item woodBroadsword;
	public static Item stoneBroadsword;
	public static Item ironBroadsword;
	public static Item goldBroadsword;
	public static Item diamondBroadsword;
	public static Item sharpenedWoodBroadsword;
	public static Item sharpenedStoneBroadsword;
	public static Item sharpenedIronBroadsword;
	public static Item sharpenedGoldBroadsword;
	public static Item sharpenedDiamondBroadsword;

public static final void init() {
	//Creating Items
		woodGrindstone = new Item().setUnlocalizedName("woodGrindstone").setCreativeTab(CreativeTabs.tabTools).setTextureName(Main.MODID + ":woodGrindstone");
		stoneGrindstone = new Item().setUnlocalizedName("stoneGrindstone").setCreativeTab(CreativeTabs.tabTools).setTextureName(Main.MODID + ":stoneGrindstone");
		ironGrindstone = new Item().setUnlocalizedName("ironGrindstone").setCreativeTab(CreativeTabs.tabTools).setTextureName(Main.MODID + ":ironGrindstone");
		goldGrindstone = new Item().setUnlocalizedName("goldGrindstone").setCreativeTab(CreativeTabs.tabTools).setTextureName(Main.MODID + ":goldGrindstone");
		diamondGrindstone = new Item().setUnlocalizedName("diamondGrindstone").setCreativeTab(CreativeTabs.tabTools).setTextureName(Main.MODID + ":diamondGrindstone");
		woodBroadsword = new Item().setUnlocalizedName("woodBroadsword").setCreativeTab(CreativeTabs.tabCombat).setTextureName(Main.MODID + ":woodBroadsword");
		stoneBroadsword = new Item().setUnlocalizedName("stoneBroadsword").setCreativeTab(CreativeTabs.tabCombat).setTextureName(Main.MODID + ":stoneBroadsword");
		ironBroadsword = new Item().setUnlocalizedName("ironBroadsword").setCreativeTab(CreativeTabs.tabCombat).setTextureName(Main.MODID + ":ironBroadsword");
		goldBroadsword = new Item().setUnlocalizedName("goldBroadsword").setCreativeTab(CreativeTabs.tabCombat).setTextureName(Main.MODID + ":goldBroadsword");
		diamondBroadsword = new Item().setUnlocalizedName("diamondBroadsword").setCreativeTab(CreativeTabs.tabCombat).setTextureName(Main.MODID + ":diamondBroadsword");
		sharpenedWoodBroadsword = new Item().setUnlocalizedName("sharpenedWoodBroadsword").setCreativeTab(CreativeTabs.tabCombat).setTextureName(Main.MODID + ":sharpenedWoodBroadsword");
		sharpenedStoneBroadsword = new Item().setUnlocalizedName("sharpenedStoneBroadsword").setCreativeTab(CreativeTabs.tabCombat).setTextureName(Main.MODID + ":sharpenedStoneBroadsword");
		sharpenedIronBroadsword = new Item().setUnlocalizedName("sharpenedIronBroadsword").setCreativeTab(CreativeTabs.tabCombat).setTextureName(Main.MODID + ":sharpenedIronBroadsword");
		sharpenedGoldBroadsword = new Item().setUnlocalizedName("sharpenedGoldBroadsword").setCreativeTab(CreativeTabs.tabCombat).setTextureName(Main.MODID + ":sharpenedGoldBroadsword");
		sharpenedDiamondBroadsword = new Item().setUnlocalizedName("sharpenedDiamondBroadsword").setCreativeTab(CreativeTabs.tabCombat).setTextureName(Main.MODID + ":sharpenedDiamondBroadsword");
	//Registering Items
		GameRegistry.registerItem(new ItemModSword("woodBroadsword", AWOOD), "woodBroadsword");
		GameRegistry.registerItem(new ItemModSword("stoneBroadsword", ASTONE), "stoneBroadsword");
		GameRegistry.registerItem(new ItemModSword("ironBroadsword", AIRON), "ironBroadsword");
		GameRegistry.registerItem(new ItemModSword("goldBroadsword", AGOLD), "goldBroadsword");
		GameRegistry.registerItem(new ItemModSword("diamondBroadsword", ADIAMOND), "diamondBroadsword");
		GameRegistry.registerItem(new ItemModSword("sharpenedWoodBroadsword", BWOOD), "sharpenedWoodBroadsword");
		GameRegistry.registerItem(new ItemModSword("sharpenedStoneBroadsword", BSTONE), "sharpenedStoneBroadsword");
		GameRegistry.registerItem(new ItemModSword("sharpenedIronBroadsword", BIRON), "sharpenedIronBroadsword");
		GameRegistry.registerItem(new ItemModSword("sharpenedGoldBroadsword", BGOLD), "sharpenedGoldBroadsword");
		GameRegistry.registerItem(new ItemModSword("sharpenedDiamondBroadsword", BDIAMOND), "sharpenedDiamondBroadsword");
		GameRegistry.registerItem(woodGrindstone, "woodGrindstone");
		GameRegistry.registerItem(stoneGrindstone, "stoneGrindstone");
		GameRegistry.registerItem(ironGrindstone, "ironGrindstone");
		GameRegistry.registerItem(goldGrindstone, "goldGrindstone");
		GameRegistry.registerItem(diamondGrindstone, "diamondGrindstone");
}

}

My ModCrafting Class is:

package com.SackboyAlamode.Industrialization.crafting;

import com.SackboyAlamode.Industrialization.block.ModBlocks;
import com.SackboyAlamode.Industrialization.item.ModItems;

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


public class ModCrafting {
public static final void init() {
//Recipes
	//Blocks
		GameRegistry.addRecipe(new ItemStack(ModBlocks.compressedWood), "ABA", "BAB", "ABA", 'A', Blocks.log, 'B', Blocks.planks);
		GameRegistry.addRecipe(new ItemStack(ModBlocks.compressedStone), "ABA", "BAB", "ABA", 'A', Blocks.stone, 'B', Blocks.cobblestone);
		GameRegistry.addRecipe(new ItemStack(ModBlocks.compressedSand), "ABA", "BAB", "ABA", 'A', Blocks.sand, 'B', Blocks.sandstone);
		GameRegistry.addRecipe(new ItemStack(ModBlocks.compressedDirt), "ABA", "BAB", "ABA", 'A', Blocks.dirt, 'B', ModBlocks.mixedDirt);
		GameRegistry.addRecipe(new ItemStack(ModBlocks.compressedGravel), "ABA", "BAB", "ABA", 'A', Blocks.gravel, 'B', Blocks.cobblestone);
		GameRegistry.addRecipe(new ItemStack(ModBlocks.compressedCobblestone), "ABA", "BAB", "ABA", 'A', Blocks.cobblestone, 'B', Blocks.stone);
		GameRegistry.addRecipe(new ItemStack(ModBlocks.lantern), "ABA", "BCB", "ABA", 'A', Blocks.planks, 'B', Items.paper, 'C', Blocks.torch);
		GameRegistry.addRecipe(new ItemStack(ModBlocks.paperWrappedPlanks), "AAA", "ABA", "AAA", 'A', Items.paper, 'B', Blocks.planks);
	//Items
		GameRegistry.addRecipe(new ItemStack(ModItems.woodBroadsword), "CBA", "BAB", "DBC", 'C', Items.string, 'B', Blocks.planks, 'A', ModBlocks.compressedWood, 'D', Items.stick);
		GameRegistry.addRecipe(new ItemStack(ModItems.stoneBroadsword), "CBA", "BAB", "DBC", 'C', Items.string, 'B', Blocks.stone, 'A', ModBlocks.compressedStone, 'D', Items.stick);
		GameRegistry.addRecipe(new ItemStack(ModItems.ironBroadsword), "CBA", "BAB", "DBC", 'C', Items.string, 'B', Items.iron_ingot, 'A', Blocks.iron_block, 'D', Items.stick);
		GameRegistry.addRecipe(new ItemStack(ModItems.goldBroadsword), "CBA", "BAB", "DBC", 'C', Items.string, 'B', Items.gold_ingot, 'A', Blocks.gold_block, 'D', Items.stick);
		GameRegistry.addRecipe(new ItemStack(ModItems.diamondBroadsword), "CBA", "BAB", "DBC", 'C', Items.string, 'B', Items.diamond, 'A', Blocks.diamond_block, 'D', Items.stick);
		GameRegistry.addRecipe(new ItemStack(ModItems.woodGrindstone), "ABA", "B B", "ABA", 'A', Blocks.planks, 'B', ModBlocks.compressedWood);
		GameRegistry.addRecipe(new ItemStack(ModItems.stoneGrindstone), "ABA", "BCB", "ABA", 'A', Blocks.stone, 'B', ModBlocks.compressedStone, 'C', ModItems.woodGrindstone);
		GameRegistry.addRecipe(new ItemStack(ModItems.ironGrindstone), "ABA", "BCB", "ABA", 'A', Items.iron_ingot, 'B', Blocks.iron_block, 'C', ModItems.stoneGrindstone);
		GameRegistry.addRecipe(new ItemStack(ModItems.goldGrindstone), "ABA", "BCB", "ABA", 'A', Items.gold_ingot, 'B', Blocks.gold_block, 'C', ModItems.ironGrindstone);
		GameRegistry.addRecipe(new ItemStack(ModItems.diamondGrindstone), "ABA", "BCB", "ABA", 'A', Items.diamond, 'B', Blocks.diamond_block, 'C', ModItems.goldGrindstone);
//Shapeless Recipes
	//Blocks
		GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.mixedDirt), new Object[] {Blocks.gravel,Blocks.dirt});
		GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedWoodBroadsword), new Object[] {ModItems.woodGrindstone,ModItems.woodBroadsword});
		GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedWoodBroadsword), new Object[] {ModItems.woodBroadsword,ModItems.stoneGrindstone});
		GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedWoodBroadsword), new Object[] {ModItems.woodBroadsword,ModItems.ironGrindstone});
		GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedWoodBroadsword), new Object[] {ModItems.woodBroadsword,ModItems.goldGrindstone});
		GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedWoodBroadsword), new Object[] {ModItems.woodBroadsword,ModItems.diamondGrindstone});
		GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedStoneBroadsword), new Object[] {ModItems.stoneBroadsword,ModItems.stoneGrindstone});
		GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedStoneBroadsword), new Object[] {ModItems.stoneBroadsword,ModItems.ironGrindstone});
		GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedStoneBroadsword), new Object[] {ModItems.stoneBroadsword,ModItems.goldGrindstone});
		GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedStoneBroadsword), new Object[] {ModItems.stoneBroadsword,ModItems.diamondGrindstone});
		GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedIronBroadsword), new Object[] {ModItems.ironBroadsword,ModItems.ironGrindstone});
		GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedIronBroadsword), new Object[] {ModItems.ironBroadsword,ModItems.goldGrindstone});
		GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedIronBroadsword), new Object[] {ModItems.ironBroadsword,ModItems.diamondGrindstone});
		GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedGoldBroadsword), new Object[] {ModItems.goldBroadsword,ModItems.goldGrindstone});
		GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedGoldBroadsword), new Object[] {ModItems.goldBroadsword,ModItems.diamondGrindstone});
		GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sharpenedDiamondBroadsword), new Object[] {ModItems.diamondBroadsword,ModItems.diamondGrindstone});
	//Items
}



}

 

 

 

 

Thanks for the help guys, i am not going to be able to reply until tomorrow however and will check what you all have posted then. Again, thanks for the amazing assistance.

 

Firstly,

 works wonders. 

 

Secondly, none of the sword crafting recipes work?

 

 

I'm back from being gone for... I think its been about a year. I'm pretty sure nobody remembers me, but hello anybody who does!

Link to post
Share on other sites

My crafting recipies are called in the preinitilization, and my items/blocks are both called in the initilization. I use proxies, if that makes a difference, the crafting recipies and the blocks/items being called in the common proxy. None of the sword crafting recipies work, all resulting in the same crash. It doesnt matter if you shift click the items from the crafting bench or normal click it, same crash in both. I was having trouble launching my game, i cant specifically remember the crash, but the fix was adding this code to my items class. I added it to all my sword types, respecive names changed of course.

 

stoneBroadsword = new Item().setUnlocalizedName("stoneBroadsword").setCreativeTab(CreativeTabs.tabCombat).setTextureName(Main.MODID + ":stoneBroadsword");

 

And i am not sure that it doesnt some how clash with this code, also in my items class

 

GameRegistry.registerItem(new ItemModSword("stoneBroadsword", ASTONE), "stoneBroadsword");

 

 

 

Sorry about the code, didnt know how to use


Link to post
Share on other sites

You are not registering the item instance you used in the recipe.

Having the same name isn't going to magically link the instances.

Here the items used in recipes are of Item type, while the items added in registry are of ItemModSword type.

Solve the inconsistency.

Link to post
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.

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.



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.