biggles2206 Posted July 28, 2013 Posted July 28, 2013 My game crashed when i add in my config. All the code is on my github: https://github.com/biggles2206/rocketSwordMod_source/tree/master/common/com/biggles2206/rocketSwordMod and my crash report ---- Minecraft Crash Report ---- // Quite honestly, I wouldn't worry myself about that. Time: 28/07/13 21:01 Description: There was a severe problem during mod loading that has caused the game to fail cpw.mods.fml.common.LoaderException: java.lang.Error: Unresolved compilation problem: file cannot be resolved to a variable at cpw.mods.fml.common.LoadController.transition(LoadController.java:148) at cpw.mods.fml.common.Loader.loadMods(Loader.java:522) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:172) at net.minecraft.client.Minecraft.startGame(Minecraft.java:470) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:796) at net.minecraft.client.main.Main.main(Main.java:93) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at net.minecraft.launchwrapper.Launch.launch(Launch.java:57) at net.minecraft.launchwrapper.Launch.main(Launch.java:18) Caused by: java.lang.Error: Unresolved compilation problem: file cannot be resolved to a variable at com.biggles2206.rocketSwordMod.RSM.preInit(RSM.java:33) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:540) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:193) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:173) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:104) at cpw.mods.fml.common.Loader.loadMods(Loader.java:521) ... 10 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.6.2 Operating System: Windows 8 (amd64) version 6.2 Java Version: 1.6.0_45, Sun Microsystems Inc. Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Sun Microsystems Inc. Memory: 994721056 bytes (948 MB) / 1065025536 bytes (1015 MB) up to 1065025536 bytes (1015 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Suspicious classes: FML and Forge are installed IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v8.04 FML v6.2.19.789 Minecraft Forge 9.10.0.789 4 mods loaded, 4 mods active mcp{8.04} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized FML{6.2.19.789} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized Forge{9.10.0.789} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized RSM{0.0.1 Alpha} [Rocket Sword Mod] (bin) Unloaded->Constructed->Errored Any help would be appreciated - Thomas Quote Lets make forge modding the best it can be!
GotoLink Posted July 28, 2013 Posted July 28, 2013 At line 33 of RSM.class: config_Main.init(file); But file is not initialized anywhere... Quote
biggles2206 Posted July 28, 2013 Author Posted July 28, 2013 At line 33 of RSM.class: Code: [select] config_Main.init(file); But file is not initialized anywhere... But the config class... Quote Lets make forge modding the best it can be!
biggles2206 Posted July 29, 2013 Author Posted July 29, 2013 At line 33 of RSM.class: config_Main.init(file); But file is not initialized anywhere... Modified some of the code. Still crashes. Quote Lets make forge modding the best it can be!
GotoLink Posted July 29, 2013 Posted July 29, 2013 If the crash is the same, you didn't fix anything, obviously. ProHint: "file" (all lower case) is a variable you can set as a field in your class, to initialize yourself (need some knowledge of File class) NoobHint: PreInit event can provide an already set config file Quote
biggles2206 Posted July 29, 2013 Author Posted July 29, 2013 If the crash is the same, you didn't fix anything, obviously. ProHint: "file" (all lower case) is a variable you can set as a field in your class, to initialize yourself (need some knowledge of File class) NoobHint: PreInit event can provide an already set config file Im gunna re - -write the config class, to see if that fixes it Quote Lets make forge modding the best it can be!
biggles2206 Posted July 29, 2013 Author Posted July 29, 2013 If the crash is the same, you didn't fix anything, obviously. ProHint: "file" (all lower case) is a variable you can set as a field in your class, to initialize yourself (need some knowledge of File class) NoobHint: PreInit event can provide an already set config file Im gunna re - -write the config class, to see if that fixes it Re - Written config. Still crashes. ---- Minecraft Crash Report ---- // Hey, that tickles! Hehehe! Time: 29/07/13 18:11 Description: Initializing game java.lang.NullPointerException at net.minecraftforge.common.Configuration.<init>(Configuration.java:91) at com.biggles2206.rocketSwordMod.config.ConfigHandler.init(ConfigHandler.java:12) at com.biggles2206.rocketSwordMod.RSM.preInit(RSM.java:33) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:540) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:193) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:173) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:104) at cpw.mods.fml.common.Loader.loadMods(Loader.java:521) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:172) at net.minecraft.client.Minecraft.startGame(Minecraft.java:470) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:796) at net.minecraft.client.main.Main.main(Main.java:93) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at net.minecraft.launchwrapper.Launch.launch(Launch.java:57) at net.minecraft.launchwrapper.Launch.main(Launch.java:18) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at net.minecraftforge.common.Configuration.<init>(Configuration.java:91) at com.biggles2206.rocketSwordMod.config.ConfigHandler.init(ConfigHandler.java:12) at com.biggles2206.rocketSwordMod.RSM.preInit(RSM.java:33) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:540) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:193) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:173) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:104) at cpw.mods.fml.common.Loader.loadMods(Loader.java:521) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:172) at net.minecraft.client.Minecraft.startGame(Minecraft.java:470) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:796) at net.minecraft.client.main.Main.main(Main.java:93) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at net.minecraft.launchwrapper.Launch.launch(Launch.java:57) at net.minecraft.launchwrapper.Launch.main(Launch.java:18) -- System Details -- Details: Minecraft Version: 1.6.2 Operating System: Windows 8 (amd64) version 6.2 Java Version: 1.6.0_45, Sun Microsystems Inc. Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Sun Microsystems Inc. Memory: 994612376 bytes (948 MB) / 1065025536 bytes (1015 MB) up to 1065025536 bytes (1015 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Suspicious classes: FML and Forge are installed IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v8.04 FML v6.2.19.789 Minecraft Forge 9.10.0.789 4 mods loaded, 4 mods active mcp{8.04} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized FML{6.2.19.789} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized Forge{9.10.0.789} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized RSM{0.0.1 Alpha} [Rocket Sword Mod] (bin) Unloaded->Constructed->Errored Launched Version: 1.6 LWJGL: 2.9.0 OpenGL: AMD Radeon HD 7450 GL version 4.2.12002 Compatibility Profile Context 9.12.2.3000, ATI Technologies Inc. Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Pack: Default Current Language: English (US) Profiler Position: N/A (disabled) Vec3 Pool Size: ~~ERROR~~ NullPointerException: null I updated the code on my github. Quote Lets make forge modding the best it can be!
hydroflame Posted July 29, 2013 Posted July 29, 2013 java.lang.NullPointerException at net.minecraftforge.common.Configuration.<init>(Configuration.java:91) at com.biggles2206.rocketSwordMod.config.ConfigHandler.init(ConfigHandler.java:12) at com.biggles2206.rocketSwordMod.RSM.preInit(RSM.java:33) line 33 of RSM: ConfigHandler.init(null); so yes its normal thsi fails you need to create a new file File file = new File("wtfman:P.cfg"); ConfigHandler.init(file); jsut a comparison, mine looks like this, its using forge build in system: // Configuration private Configuration config; @EventHandler public void preInit(FMLPreInitializationEvent event) { EquipmentStatsBase.setupMap(); // the advantage of usign config files is that if theres a conflict // between 2 items or 2 block, the config file will generate a new id // for the block that wont go in conflict with any other id, preventing // crashes. config = new Configuration(event.getSuggestedConfigurationFile()); blockIds = new int[] { config.getBlock("orichalcumOre", 509).getInt() , config.getBlock("unobtainiumOre", 510).getInt() }; itemIds = new int[] {config.getItem("test", 1000).getInt(), config.getItem("magestaff", 1001).getInt(), config.getItem("heartoftheadmin", 1002).getInt(), config.getItem("mythil", 1003).getInt(), config.getItem("meteorite", 1004).getInt(), config.getItem("adamantium", 1005).getInt(), config.getItem("orichalcum", 1006).getInt(), config.getItem("unobtainium", 1007).getInt(),}; config.save(); Quote how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
biggles2206 Posted July 29, 2013 Author Posted July 29, 2013 java.lang.NullPointerException at net.minecraftforge.common.Configuration.<init>(Configuration.java:91) at com.biggles2206.rocketSwordMod.config.ConfigHandler.init(ConfigHandler.java:12) at com.biggles2206.rocketSwordMod.RSM.preInit(RSM.java:33) line 33 of RSM: ConfigHandler.init(null); so yes its normal thsi fails you need to create a new file File file = new File("wtfman:P.cfg"); ConfigHandler.init(file); jsut a comparison, mine looks like this, its using forge build in system: // Configuration private Configuration config; @EventHandler public void preInit(FMLPreInitializationEvent event) { EquipmentStatsBase.setupMap(); // the advantage of usign config files is that if theres a conflict // between 2 items or 2 block, the config file will generate a new id // for the block that wont go in conflict with any other id, preventing // crashes. config = new Configuration(event.getSuggestedConfigurationFile()); blockIds = new int[] { config.getBlock("orichalcumOre", 509).getInt() , config.getBlock("unobtainiumOre", 510).getInt() }; itemIds = new int[] {config.getItem("test", 1000).getInt(), config.getItem("magestaff", 1001).getInt(), config.getItem("heartoftheadmin", 1002).getInt(), config.getItem("mythil", 1003).getInt(), config.getItem("meteorite", 1004).getInt(), config.getItem("adamantium", 1005).getInt(), config.getItem("orichalcum", 1006).getInt(), config.getItem("unobtainium", 1007).getInt(),}; config.save(); I modified the RSM class to how i understand it from your post (updated github) but i still get a crash. ---- Minecraft Crash Report ---- // You're mean. Time: 29/07/13 20:09 Description: There was a severe problem during mod loading that has caused the game to fail cpw.mods.fml.common.LoaderException: java.lang.Error: Unresolved compilation problem: file cannot be resolved to a variable at cpw.mods.fml.common.LoadController.transition(LoadController.java:148) at cpw.mods.fml.common.Loader.loadMods(Loader.java:522) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:172) at net.minecraft.client.Minecraft.startGame(Minecraft.java:470) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:796) at net.minecraft.client.main.Main.main(Main.java:93) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at net.minecraft.launchwrapper.Launch.launch(Launch.java:57) at net.minecraft.launchwrapper.Launch.main(Launch.java:18) Caused by: java.lang.Error: Unresolved compilation problem: file cannot be resolved to a variable at com.biggles2206.rocketSwordMod.RSM.preInit(RSM.java:33) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:540) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:193) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:173) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:104) at cpw.mods.fml.common.Loader.loadMods(Loader.java:521) ... 10 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.6.2 Operating System: Windows 8 (amd64) version 6.2 Java Version: 1.6.0_45, Sun Microsystems Inc. Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Sun Microsystems Inc. Memory: 993843088 bytes (947 MB) / 1065025536 bytes (1015 MB) up to 1065025536 bytes (1015 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Suspicious classes: FML and Forge are installed IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v8.04 FML v6.2.19.789 Minecraft Forge 9.10.0.789 4 mods loaded, 4 mods active mcp{8.04} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized FML{6.2.19.789} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized Forge{9.10.0.789} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized RSM{0.0.1 Alpha} [Rocket Sword Mod] (bin) Unloaded->Constructed->Errored Quote Lets make forge modding the best it can be!
hydroflame Posted July 29, 2013 Posted July 29, 2013 Caused by: java.lang.Error: Unresolved compilation problem: file cannot be resolved to a variable at com.biggles2206.rocketSwordMod.RSM.preInit(RSM.java:33) ... ah man .... [lmgtfy]file cannot be resolved to a variable[/lmgtfy] File file = new File("myconfigfile.cfg"); ConfigHandler.init(file); learning java is important to make awesome mods EDIT: forge tutorial on config files: http://www.minecraftforge.net/wiki/How_to_make_an_advanced_configuration_file Quote how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
biggles2206 Posted July 29, 2013 Author Posted July 29, 2013 Caused by: java.lang.Error: Unresolved compilation problem: file cannot be resolved to a variable at com.biggles2206.rocketSwordMod.RSM.preInit(RSM.java:33) ... ah man .... [lmgtfy]file cannot be resolved to a variable[/lmgtfy] File file = new File("myconfigfile.cfg"); ConfigHandler.init(file); learning java is important to make awesome mods EDIT: forge tutorial on config files: http://www.minecraftforge.net/wiki/How_to_make_an_advanced_configuration_file I did that, im even more confused! I've updated github. Quote Lets make forge modding the best it can be!
hydroflame Posted July 29, 2013 Posted July 29, 2013 package com.biggles2206.rocketSwordMod; /** * @author biggles2206 */ import com.biggles2206.rocketSwordMod.blocks.ModBlocks; import com.biggles2206.rocketSwordMod.config.ConfigHandler; import com.biggles2206.rocketSwordMod.items.ModItems; import com.biggles2206.rocketSwordMod.lib.Refence; import com.biggles2206.rocketSwordMod.proxy.CommonProxy; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; 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; import cpw.mods.fml.common.network.NetworkMod; @Mod(name = Refence.NAME, modid = Refence.MODID, version = Refence.VERSION) @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class RSM { @SidedProxy(clientSide = Refence.CLIENT_PROXY_LOC, serverSide = Refence.COMMON_PROXY_LOC) public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event){ ModBlocks.init(); ModItems.init(); ModItems.addNames(); ConfigHandler.init(file1); } @EventHandler public void Init(FMLInitializationEvent event){ } @EventHandler public void postInit(FMLPostInitializationEvent event){ } } this should actually be : package com.biggles2206.rocketSwordMod; /** * @author biggles2206 */ import com.biggles2206.rocketSwordMod.blocks.ModBlocks; import com.biggles2206.rocketSwordMod.config.ConfigHandler; import com.biggles2206.rocketSwordMod.items.ModItems; import com.biggles2206.rocketSwordMod.lib.Refence; import com.biggles2206.rocketSwordMod.proxy.CommonProxy; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; 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; import cpw.mods.fml.common.network.NetworkMod; @Mod(name = Refence.NAME, modid = Refence.MODID, version = Refence.VERSION) @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class RSM { @SidedProxy(clientSide = Refence.CLIENT_PROXY_LOC, serverSide = Refence.COMMON_PROXY_LOC) public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event){ ModBlocks.init(); ModItems.init(); ModItems.addNames(); File file1 = new File("fileName.cfg"); ConfigHandler.init(file1); } @EventHandler public void Init(FMLInitializationEvent event){ } @EventHandler public void postInit(FMLPostInitializationEvent event){ } } in your first version file1 doesnt exists anywhere, the compiler dont know wtf you're talking about in version 2 i create one and this reference is passed to the method BTW THIS BASIC JAVA i suggest you go at least over the basics before going any further, itll help in the long run. because if you think you can do ASM in this state, wake up will be hard good modding Quote how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
biggles2206 Posted July 30, 2013 Author Posted July 30, 2013 package com.biggles2206.rocketSwordMod; /** * @author biggles2206 */ import com.biggles2206.rocketSwordMod.blocks.ModBlocks; import com.biggles2206.rocketSwordMod.config.ConfigHandler; import com.biggles2206.rocketSwordMod.items.ModItems; import com.biggles2206.rocketSwordMod.lib.Refence; import com.biggles2206.rocketSwordMod.proxy.CommonProxy; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; 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; import cpw.mods.fml.common.network.NetworkMod; @Mod(name = Refence.NAME, modid = Refence.MODID, version = Refence.VERSION) @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class RSM { @SidedProxy(clientSide = Refence.CLIENT_PROXY_LOC, serverSide = Refence.COMMON_PROXY_LOC) public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event){ ModBlocks.init(); ModItems.init(); ModItems.addNames(); ConfigHandler.init(file1); } @EventHandler public void Init(FMLInitializationEvent event){ } @EventHandler public void postInit(FMLPostInitializationEvent event){ } } this should actually be : package com.biggles2206.rocketSwordMod; /** * @author biggles2206 */ import com.biggles2206.rocketSwordMod.blocks.ModBlocks; import com.biggles2206.rocketSwordMod.config.ConfigHandler; import com.biggles2206.rocketSwordMod.items.ModItems; import com.biggles2206.rocketSwordMod.lib.Refence; import com.biggles2206.rocketSwordMod.proxy.CommonProxy; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; 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; import cpw.mods.fml.common.network.NetworkMod; @Mod(name = Refence.NAME, modid = Refence.MODID, version = Refence.VERSION) @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class RSM { @SidedProxy(clientSide = Refence.CLIENT_PROXY_LOC, serverSide = Refence.COMMON_PROXY_LOC) public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event){ ModBlocks.init(); ModItems.init(); ModItems.addNames(); File file1 = new File("fileName.cfg"); ConfigHandler.init(file1); } @EventHandler public void Init(FMLInitializationEvent event){ } @EventHandler public void postInit(FMLPostInitializationEvent event){ } } in your first version file1 doesnt exists anywhere, the compiler dont know wtf you're talking about in version 2 i create one and this reference is passed to the method BTW THIS BASIC JAVA i suggest you go at least over the basics before going any further, itll help in the long run. because if you think you can do ASM in this state, wake up will be hard good modding All fixed. Thank you very much! I am not going to learn java from VSWE's java course Thank you again, - Thomas Quote Lets make forge modding the best it can be!
Recommended Posts
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.