I've been building a mod that simply adds crafting recipes to already existing yet uncraftable items and blocks. The first iteration compiled properly, loads and happily play in Minecraft. After building this mod, I deleted and re-extracted my forge source folder as the first attempt didn't bring with it all the source libraries. Now when I attempt to recompile the mod, I get a crash on launch, with the following report:
Crash Report:
---- Minecraft Crash Report ----
// Don't be sad, have a hug! <3
Time: 04/04/15 23:25
Description: Initializing game
java.lang.ClassCastException: net.minecraft.item.ItemSeeds cannot be cast to java.lang.Character
at net.minecraft.item.crafting.CraftingManager.func_92103_a(SourceFile:1112)
at net.minecraftforge.fml.common.registry.GameRegistry.addShapedRecipe(GameRegistry.java:236)
at com.cookiehook.CookiehookCrafting.CookiehookCrafting.init(CookiehookCrafting.java:29)
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.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:518)
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 com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:187)
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 com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:692)
at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:291)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:484)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:325)
at net.minecraft.client.main.Main.main(SourceFile:120)
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:135)
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.crafting.CraftingManager.func_92103_a(SourceFile:1112)
at net.minecraftforge.fml.common.registry.GameRegistry.addShapedRecipe(GameRegistry.java:236)
at com.cookiehook.CookiehookCrafting.CookiehookCrafting.init(CookiehookCrafting.java:29)
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.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:518)
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 com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:187)
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 com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:692)
at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:291)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:484)
-- Initialization --
Details:
Stacktrace:
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:325)
at net.minecraft.client.main.Main.main(SourceFile:120)
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:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
-- System Details --
Details:
Minecraft Version: 1.8
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.8.0_40, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 148285816 bytes (141 MB) / 278835200 bytes (265 MB) up to 1060372480 bytes (1011 MB)
JVM Flags: 6 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx1G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v9.10 FML v8.0.42.1341 Minecraft Forge 11.14.1.1341 4 mods loaded, 4 mods active
mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
FML{8.0.42.1341} [Forge Mod Loader] (forge-1.8-11.14.1.1341.jar) Unloaded->Constructed->Pre-initialized->Initialized
Forge{11.14.1.1341} [Minecraft Forge] (forge-1.8-11.14.1.1341.jar) Unloaded->Constructed->Pre-initialized->Initialized
examplemod{1.1} [examplemod] (CookiehookCrafting-1.1.jar) Unloaded->Constructed->Pre-initialized->Errored
Loaded coremods (and transformers):
Launched Version: 1.8-Forge11.14.1.1341
LWJGL: 2.9.1
OpenGL: Mobile Intel(R) 4 Series Express Chipset Family GL version 2.1.0 - Build 8.15.10.2869, Intel
GL Caps: Using GL 1.3 multitexturing.
Using GL 1.3 texture combiners.
Using framebuffer objects because EXT_framebuffer_object is supported.
Shaders are available because OpenGL 2.1 is supported.
VBOs are available because OpenGL 1.5 is supported.
Using VBOs: No
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Packs: []
Current Language: English (UK)
Profiler Position: N/A (disabled)
@Mod(modid = CookiehookCrafting.MODID, version = CookiehookCrafting.VERSION)
public class CookiehookCrafting
{
public static final String MODID = "examplemod";
public static final String VERSION = "1.1";
@EventHandler
public void Preinit(FMLPreInitializationEvent event)
{
}
@EventHandler
public void init(FMLInitializationEvent event)
{
//Shapeless Recipes
GameRegistry.addShapedRecipe(new ItemStack(Blocks.grass), Items.wheat_seeds, new ItemStack(Blocks.dirt, 1, 0));
GameRegistry.addShapedRecipe(new ItemStack(Blocks.dirt, 1, 2), new ItemStack(Blocks.dirt, 1, 0), Blocks.gravel, Blocks.leaves);
GameRegistry.addShapedRecipe(new ItemStack(Blocks.dirt, 1, 2), new ItemStack(Blocks.dirt, 1, 0), Blocks.gravel, Blocks.leaves2);
//Smelting Recipes
GameRegistry.addSmelting(Blocks.gravel, new ItemStack(Items.flint), 0.2F);
GameRegistry.addSmelting(new ItemStack(Blocks.dirt, 1, 0), new ItemStack(Blocks.dirt, 1, 1), 0.2F);
@EventHandler
public void Postinit(FMLPostInitializationEvent event)
{
}
}
As the only change to the code is addition of another two recipes (which still crashes if I comment them out), I'm fairly sure my problem is somewhere in the compiling, but I don't know what! Can anybody help me?
How exactly are you setting up your forge and what did you mean by "re-extract"? After extracting the download you need to run the gradlew setupDecompWorkspace and then gradlew eclipse commands for it to download everything and set it up as a project.
I've downloaded the minecraft forge src.zip folder from http://files.minecraftforge.net/, then extract that into it's own folder using WinRAR. I've ran "gradlew setupDecompWorkspace eclipse" in that folder. I then set up Eclipse so that the workspace used is the "eclipse" folder within the extracted forge folder. This all appeared to work correctly, yet when I run "gradlew.bat build" and put the mod file created into my minecraft mods folder, I get the crash report above.
I've heard sometimes that it is better to run gradlew setupDecompWorkspace separately and then gradlew eclipse. Not sure if that would make a difference, but worth trying.
When I build I run gradlew build not gradlew.bat build. Not sure if that makes a difference.
In Eclipse do you see that the forgeSrc library is there?
I've just run the two separately, and used "gradlew build" instead of "gradlew.bat build", with no change, still get the same report.
I do see the forgeSrc library.
minecraft {
version = "1.8-11.14.1.1334"
runDir = "eclipse"
// the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not allways work.
// simply re-run your setup task after changing the mappings to update your workspace.
mappings = "snapshot_20141130"
}
dependencies {
// you may put jars on which you depend on in ./libs
// or you may define them like so..
//compile "some.group:artifact:version:classifier"
//compile "some.group:artifact:version"
// real examples
//compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
//compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
processResources
{
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
Hmmm, I think that build.gradle looks pretty much correct. The main thing different from mine is I use a different run directory, but I do that purposefully.
I think someone who is more experienced in gradle will have to help you.
Thanks for trying
What do you mean by "run from Eclipse"?
Well, when testing a mod you don't have to build it. Instead you create a Run Configuration in Eclipse and just hit that "play" button (green triangle) and it compiles and runs right there.
FIXED!
Coolmanzz2, I set up a new folder and mod as you said, then copied my recipes from my .txt file backup over bit by bit, finding some errors that weren't there before:
GameRegistry.addShapelessRecipe(new ItemStack(Blocks.grass), Items.wheat_seeds, new ItemStack(Blocks.dirt, 1, 0));
Had auto-filled to be a an "addShapedRecipe", without me noticing, which is what was throwing the first error: (Parameters for a shapeless recipe aren't compatible with a shaped recipe)
Error: "java.lang.ClassCastException: net.minecraft.item.ItemSeeds cannot be cast to java.lang.Character"
I also had to retype one of my shaped recipes, as it was then throwing string errors:
GameRegistry.addRecipe(new ItemStack(Items.name_tag),
"A ",
"BCD",
'A', Items.string, 'B', Items.iron_ingot, 'C', Items.paper, 'D', new ItemStack(Items.dye, 1, 0));
Now it loads properly! I can only guess that in copying from eclipse to notepad and back again lost some important formatting that retyping fixed.
Thanks Coolmanzz2 for prompting me to make a new folder and move my mod over bit by bit.
Thanks Jabelar for getting me started and showing me how to play mods within Eclipse.
I've been building a mod that simply adds crafting recipes to already existing yet uncraftable items and blocks. The first iteration compiled properly, loads and happily play in Minecraft. After building this mod, I deleted and re-extracted my forge source folder as the first attempt didn't bring with it all the source libraries. Now when I attempt to recompile the mod, I get a crash on launch, with the following report:
Crash Report:
---- Minecraft Crash Report ----
// Don't be sad, have a hug! <3
Time: 04/04/15 23:25
Description: Initializing game
java.lang.ClassCastException: net.minecraft.item.ItemSeeds cannot be cast to java.lang.Character
at net.minecraft.item.crafting.CraftingManager.func_92103_a(SourceFile:1112)
at net.minecraftforge.fml.common.registry.GameRegistry.addShapedRecipe(GameRegistry.java:236)
at com.cookiehook.CookiehookCrafting.CookiehookCrafting.init(CookiehookCrafting.java:29)
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.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:518)
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 com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:187)
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 com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:692)
at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:291)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:484)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:325)
at net.minecraft.client.main.Main.main(SourceFile:120)
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:135)
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.crafting.CraftingManager.func_92103_a(SourceFile:1112)
at net.minecraftforge.fml.common.registry.GameRegistry.addShapedRecipe(GameRegistry.java:236)
at com.cookiehook.CookiehookCrafting.CookiehookCrafting.init(CookiehookCrafting.java:29)
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.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:518)
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 com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:187)
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 com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:692)
at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:291)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:484)
-- Initialization --
Details:
Stacktrace:
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:325)
at net.minecraft.client.main.Main.main(SourceFile:120)
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:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
-- System Details --
Details:
Minecraft Version: 1.8
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.8.0_40, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 148285816 bytes (141 MB) / 278835200 bytes (265 MB) up to 1060372480 bytes (1011 MB)
JVM Flags: 6 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx1G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v9.10 FML v8.0.42.1341 Minecraft Forge 11.14.1.1341 4 mods loaded, 4 mods active
mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
FML{8.0.42.1341} [Forge Mod Loader] (forge-1.8-11.14.1.1341.jar) Unloaded->Constructed->Pre-initialized->Initialized
Forge{11.14.1.1341} [Minecraft Forge] (forge-1.8-11.14.1.1341.jar) Unloaded->Constructed->Pre-initialized->Initialized
examplemod{1.1} [examplemod] (CookiehookCrafting-1.1.jar) Unloaded->Constructed->Pre-initialized->Errored
Loaded coremods (and transformers):
Launched Version: 1.8-Forge11.14.1.1341
LWJGL: 2.9.1
OpenGL: Mobile Intel(R) 4 Series Express Chipset Family GL version 2.1.0 - Build 8.15.10.2869, Intel
GL Caps: Using GL 1.3 multitexturing.
Using GL 1.3 texture combiners.
Using framebuffer objects because EXT_framebuffer_object is supported.
Shaders are available because OpenGL 2.1 is supported.
VBOs are available because OpenGL 1.5 is supported.
Using VBOs: No
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Packs: []
Current Language: English (UK)
Profiler Position: N/A (disabled)
our spoiler here.
Code:
package com.cookiehook.CookiehookCrafting;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;
@Mod(modid = CookiehookCrafting.MODID, version = CookiehookCrafting.VERSION)
public class CookiehookCrafting
{
public static final String MODID = "examplemod";
public static final String VERSION = "1.1";
@EventHandler
public void Preinit(FMLPreInitializationEvent event)
{
}
@EventHandler
public void init(FMLInitializationEvent event)
{
//Shapeless Recipes
GameRegistry.addShapedRecipe(new ItemStack(Blocks.grass), Items.wheat_seeds, new ItemStack(Blocks.dirt, 1, 0));
GameRegistry.addShapedRecipe(new ItemStack(Blocks.dirt, 1, 2), new ItemStack(Blocks.dirt, 1, 0), Blocks.gravel, Blocks.leaves);
GameRegistry.addShapedRecipe(new ItemStack(Blocks.dirt, 1, 2), new ItemStack(Blocks.dirt, 1, 0), Blocks.gravel, Blocks.leaves2);
//Smelting Recipes
GameRegistry.addSmelting(Blocks.gravel, new ItemStack(Items.flint), 0.2F);
GameRegistry.addSmelting(new ItemStack(Blocks.dirt, 1, 0), new ItemStack(Blocks.dirt, 1, 1), 0.2F);
//Shaped Recipes
//Horse Items
GameRegistry.addRecipe(new ItemStack(Items.saddle),
" A ",
"ABA",
" C ",
'A', Items.leather, 'B', Items.iron_ingot, 'C', Items.leather_boots);
GameRegistry.addRecipe(new ItemStack(Items.iron_horse_armor),
" A",
"BBB",
"CDC",
'A', Items.iron_helmet, 'B', Blocks.iron_block, 'C', Items.string, 'D', Items.saddle);
GameRegistry.addRecipe(new ItemStack(Items.golden_horse_armor),
" A",
"BBB",
"CDC",
'A', Items.golden_helmet, 'B', Blocks.gold_block, 'C', Items.string, 'D', Items.saddle);
GameRegistry.addRecipe(new ItemStack(Items.diamond_horse_armor),
" A",
"BBB",
"CDC",
'A', Items.diamond_helmet, 'B', Blocks.diamond_block, 'C', Items.string, 'D', Items.saddle);
//Ores
GameRegistry.addRecipe(new ItemStack(Blocks.iron_ore),
"AAA",
"ABA",
"AAA",
'A', new ItemStack(Blocks.stone, 1, 0), 'B', Items.iron_ingot);
GameRegistry.addRecipe(new ItemStack(Blocks.gold_ore),
"AAA",
"ABA",
"AAA",
'A', new ItemStack(Blocks.stone, 1, 0), 'B', Items.gold_ingot);
GameRegistry.addRecipe(new ItemStack(Blocks.coal_ore),
"AAA",
"ABA",
"AAA",
'A', new ItemStack(Blocks.stone, 1, 0), 'B', Items.coal);
GameRegistry.addRecipe(new ItemStack(Blocks.emerald_ore),
"AAA",
"ABA",
"AAA",
'A', new ItemStack(Blocks.stone, 1, 0), 'B', Items.emerald);
GameRegistry.addRecipe(new ItemStack(Blocks.diamond_ore),
"AAA",
"ABA",
"AAA",
'A', new ItemStack(Blocks.stone, 1, 0), 'B', Items.diamond);
GameRegistry.addRecipe(new ItemStack(Blocks.redstone_ore),
"ABA",
"BBB",
"ABA",
'A', new ItemStack(Blocks.stone, 1, 0), 'B', Items.redstone);
GameRegistry.addRecipe(new ItemStack(Blocks.lapis_ore),
"BBB",
"BAB",
"BBB",
'A', new ItemStack(Blocks.stone, 1, 0), 'B', new ItemStack(Items.dye, 1, 4));
GameRegistry.addRecipe(new ItemStack(Blocks.quartz_ore),
"AAA",
"ABA",
"AAA",
'A', Blocks.netherrack, 'B', Items.quartz);
//Skulls
GameRegistry.addRecipe(new ItemStack(Items.skull, 1, 0),
"ABA",
"BAB",
"AAA",
'A', Items.bone, 'B', new ItemStack(Blocks.stone, 1, 0));
GameRegistry.addRecipe(new ItemStack(Items.skull, 1, 1),
"CBC",
"BAB",
"DDD",
'A', new ItemStack(Items.skull, 1, 0), 'B', Blocks.coal_block, 'C', Items.ender_eye, 'D', Items.quartz);
GameRegistry.addRecipe(new ItemStack(Items.skull, 1, 2),
"ABA",
"BAB",
"AAA",
'A', Items.rotten_flesh, 'B', new ItemStack(Blocks.dirt, 1, 0));
GameRegistry.addRecipe(new ItemStack(Items.skull, 1, 3),
"ABA",
"BAB",
"AAA",
'A', new ItemStack(Blocks.log, 1, 0), 'B', new ItemStack(Blocks.grass, 1, 0));
GameRegistry.addRecipe(new ItemStack(Items.skull, 1, 4),
"ABA",
"BAB",
"AAA",
'A', Items.gunpowder, 'B', new ItemStack(Blocks.leaves, 1, 0));
//Monster Eggs
GameRegistry.addRecipe(new ItemStack(Blocks.monster_egg, 1, 0),
"AAA",
"BCD",
"AAA",
'A', new ItemStack(Blocks.stone, 1, 0), 'B', new ItemStack(Items.skull, 1, 2), 'C', Items.egg, 'D', new ItemStack(Items.skull, 1, 0));
GameRegistry.addRecipe(new ItemStack(Blocks.monster_egg, 1, 1),
"AAA",
"BCD",
"AAA",
'A', Blocks.cobblestone, 'B', new ItemStack(Items.skull, 1, 2), 'C', Items.egg, 'D', new ItemStack(Items.skull, 1, 0));
GameRegistry.addRecipe(new ItemStack(Blocks.monster_egg, 1, 2),
"AAA",
"BCD",
"AAA",
'A', new ItemStack(Blocks.stonebrick, 1, 0), 'B', new ItemStack(Items.skull, 1, 2), 'C', Items.egg, 'D', new ItemStack(Items.skull, 1, 0));
GameRegistry.addRecipe(new ItemStack(Blocks.monster_egg, 1, 3),
"AAA",
"BCD",
"AAA",
'A', new ItemStack(Blocks.stonebrick, 1, 1), 'B', new ItemStack(Items.skull, 1, 2), 'C', Items.egg, 'D', new ItemStack(Items.skull, 1, 0));
GameRegistry.addRecipe(new ItemStack(Blocks.monster_egg, 1, 4),
"AAA",
"BCD",
"AAA",
'A', new ItemStack(Blocks.stonebrick, 1, 2), 'B', new ItemStack(Items.skull, 1, 2), 'C', Items.egg, 'D', new ItemStack(Items.skull, 1, 0));
GameRegistry.addRecipe(new ItemStack(Blocks.monster_egg, 1, 5),
"AAA",
"BCD",
"AAA",
'A', new ItemStack(Blocks.stonebrick, 1, 3), 'B', new ItemStack(Items.skull, 1, 2), 'C', Items.egg, 'D', new ItemStack(Items.skull, 1, 0));
//Vines
GameRegistry.addRecipe(new ItemStack(Blocks.vine, 3),
"A",
"A",
"A",
'A', Blocks.leaves);
GameRegistry.addRecipe(new ItemStack(Blocks.vine, 3),
"B",
"A",
"A",
'A', Blocks.leaves, 'B', Blocks.leaves2);
GameRegistry.addRecipe(new ItemStack(Blocks.vine, 3),
"A",
"B",
"A",
'A', Blocks.leaves, 'B', Blocks.leaves2);
GameRegistry.addRecipe(new ItemStack(Blocks.vine, 3),
"A",
"A",
"B",
'A', Blocks.leaves, 'B', Blocks.leaves2);
GameRegistry.addRecipe(new ItemStack(Blocks.vine, 3),
"B",
"B",
"A",
'A', Blocks.leaves, 'B', Blocks.leaves2);
GameRegistry.addRecipe(new ItemStack(Blocks.vine, 3),
"B",
"A",
"B",
'A', Blocks.leaves, 'B', Blocks.leaves2);
GameRegistry.addRecipe(new ItemStack(Blocks.vine, 3),
"A",
"B",
"B",
'A', Blocks.leaves, 'B', Blocks.leaves2);
GameRegistry.addRecipe(new ItemStack(Blocks.vine, 3),
"B",
"B",
"B",
'B', Blocks.leaves2);
GameRegistry.addRecipe(new ItemStack(Items.string, 4),
"A",
"A",
'A', new ItemStack(Blocks.wool, 1, 0));
GameRegistry.addRecipe(new ItemStack(Blocks.web, 3),
"A A",
" A ",
"A A",
'A', Items.string);
GameRegistry.addRecipe(new ItemStack(Items.name_tag),
"A",
"BCD",
'A', Items.string, 'B', Items.iron_ingot, 'C', Items.paper, 'D', new ItemStack(Items.dye, 1, 0));
GameRegistry.addRecipe(new ItemStack(Blocks.obsidian),
"AB",
"BB",
'A', Items.water_bucket, 'B', Items.lava_bucket);
GameRegistry.addRecipe(new ItemStack(Items.diamond),
"AAA",
"ABA",
"ACA",
'A', Blocks.coal_block, 'B', Items.coal, 'C', Blocks.piston);
GameRegistry.addRecipe(new ItemStack(Blocks.mycelium),
"ABA",
"BCB",
"ABA",
'A', Blocks.red_mushroom, 'B', Blocks.brown_mushroom, 'C', new ItemStack(Blocks.dirt, 1, 2));
GameRegistry.addRecipe(new ItemStack(Blocks.ice, 4),
"AAA",
"ABA",
"AAA",
'A', Items.snowball, 'B', Items.water_bucket);
}
@EventHandler
public void Postinit(FMLPostInitializationEvent event)
{
}
}
As the only change to the code is addition of another two recipes (which still crashes if I comment them out), I'm fairly sure my problem is somewhere in the compiling, but I don't know what! Can anybody help me?
Check out my Youtube channel, where I build a theme park in vanilla Minecraft!
https://www.youtube.com/playlist?list=PLeCiIIOoWhe-mq3nYd_nXXrKw9MkjnUU7
How exactly are you setting up your forge and what did you mean by "re-extract"? After extracting the download you need to run the gradlew setupDecompWorkspace and then gradlew eclipse commands for it to download everything and set it up as a project.
I've downloaded the minecraft forge src.zip folder from http://files.minecraftforge.net/, then extract that into it's own folder using WinRAR. I've ran "gradlew setupDecompWorkspace eclipse" in that folder. I then set up Eclipse so that the workspace used is the "eclipse" folder within the extracted forge folder. This all appeared to work correctly, yet when I run "gradlew.bat build" and put the mod file created into my minecraft mods folder, I get the crash report above.
Check out my Youtube channel, where I build a theme park in vanilla Minecraft!
https://www.youtube.com/playlist?list=PLeCiIIOoWhe-mq3nYd_nXXrKw9MkjnUU7
I've heard sometimes that it is better to run gradlew setupDecompWorkspace separately and then gradlew eclipse. Not sure if that would make a difference, but worth trying.
When I build I run gradlew build not gradlew.bat build. Not sure if that makes a difference.
In Eclipse do you see that the forgeSrc library is there?
What does your build.gradle file have in it?
I've just run the two separately, and used "gradlew build" instead of "gradlew.bat build", with no change, still get the same report.
I do see the forgeSrc library.
Build.gradle file:
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
}
}
apply plugin: 'forge'
version = "1.1"
group= "com.cookiehook.CookiehookCrafting" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "CookiehookCrafting"
minecraft {
version = "1.8-11.14.1.1334"
runDir = "eclipse"
// the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not allways work.
// simply re-run your setup task after changing the mappings to update your workspace.
mappings = "snapshot_20141130"
}
dependencies {
// you may put jars on which you depend on in ./libs
// or you may define them like so..
//compile "some.group:artifact:version:classifier"
//compile "some.group:artifact:version"
// real examples
//compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
//compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
// for more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html
}
processResources
{
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
Check out my Youtube channel, where I build a theme park in vanilla Minecraft!
https://www.youtube.com/playlist?list=PLeCiIIOoWhe-mq3nYd_nXXrKw9MkjnUU7
Hmmm, I think that build.gradle looks pretty much correct. The main thing different from mine is I use a different run directory, but I do that purposefully.
I think someone who is more experienced in gradle will have to help you.
Does the mod run from Eclipse?
Thanks for trying
What do you mean by "run from Eclipse"?
Check out my Youtube channel, where I build a theme park in vanilla Minecraft!
https://www.youtube.com/playlist?list=PLeCiIIOoWhe-mq3nYd_nXXrKw9MkjnUU7
Well, when testing a mod you don't have to build it. Instead you create a Run Configuration in Eclipse and just hit that "play" button (green triangle) and it compiles and runs right there.
I explain how to set this up on this tutorial page (go down to the section that says Run Configurations): http://jabelarminecraft.blogspot.com/p/quick-tips-eclipse.html
Well that's something I've never seen before! Alas, doesn't works, I set up according to your blog, hit play, and get this:
[00:27:59] [main/INFO] [GradleStart]: userProperties: {}
[00:27:59] [main/INFO] [GradleStart]: assetsDir: C:/Users/Shaun/.gradle/caches/minecraft/assets
[00:27:59] [main/INFO] [GradleStart]: assetIndex: 1.8
[00:27:59] [main/INFO] [GradleStart]: accessToken: accessToken
[00:27:59] [main/INFO] [GradleStart]: version: 1.8
[00:27:59] [main/INFO] [GradleStart]: Extra: [--tweakClass, net.minecraft.fml.common.launcher.FMLTweaker]
[00:28:00] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/Shaun/.gradle/caches/minecraft/assets, --assetIndex, 1.8, --accessToken, {REDACTED}, --version, 1.8, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraft.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
[00:28:00] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[00:28:00] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[00:28:00] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraft.fml.common.launcher.FMLTweaker
[00:28:00] [main/ERROR] [LaunchWrapper]: Unable to launch
java.lang.ClassNotFoundException: net.minecraft.fml.common.launcher.FMLTweaker
at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_40]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_40]
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) ~[?:1.8.0_40]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_40]
at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:106) ~[launchwrapper-1.11.jar:?]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_40]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_40]
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_40]
at java.lang.Class.forName(Unknown Source) ~[?:1.8.0_40]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:98) [launchwrapper-1.11.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]
at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]
at GradleStart.main(Unknown Source) [start/:?]
Check out my Youtube channel, where I build a theme park in vanilla Minecraft!
https://www.youtube.com/playlist?list=PLeCiIIOoWhe-mq3nYd_nXXrKw9MkjnUU7
Try making a new folder and setting it up as a new mod, after you see if it works copy your code over
FIXED!
Coolmanzz2, I set up a new folder and mod as you said, then copied my recipes from my .txt file backup over bit by bit, finding some errors that weren't there before:
GameRegistry.addShapelessRecipe(new ItemStack(Blocks.grass), Items.wheat_seeds, new ItemStack(Blocks.dirt, 1, 0));
Had auto-filled to be a an "addShapedRecipe", without me noticing, which is what was throwing the first error: (Parameters for a shapeless recipe aren't compatible with a shaped recipe)
Error: "java.lang.ClassCastException: net.minecraft.item.ItemSeeds cannot be cast to java.lang.Character"
I also had to retype one of my shaped recipes, as it was then throwing string errors:
GameRegistry.addRecipe(new ItemStack(Items.name_tag),
"A ",
"BCD",
'A', Items.string, 'B', Items.iron_ingot, 'C', Items.paper, 'D', new ItemStack(Items.dye, 1, 0));
Now it loads properly! I can only guess that in copying from eclipse to notepad and back again lost some important formatting that retyping fixed.
Thanks Coolmanzz2 for prompting me to make a new folder and move my mod over bit by bit.
Thanks Jabelar for getting me started and showing me how to play mods within Eclipse.
Check out my Youtube channel, where I build a theme park in vanilla Minecraft!
https://www.youtube.com/playlist?list=PLeCiIIOoWhe-mq3nYd_nXXrKw9MkjnUU7