micdoodle8 / Galacticraft

An advanced Space Dimension Mod for Minecraft
Other
617 stars 333 forks source link

IndexOutOfBoundsException GCCoreTickHandlerClient.java:382 #469

Closed seanmcox closed 10 years ago

seanmcox commented 10 years ago

Received the following error. Not sure as to what special circumstances may have caused the problem. The kids were out of town for a few days and returned to find this issue with the mod. Nobody has been playing during that time. (I did make changes to our firewall to allow our Minecraft server to function, but I don't really see how that would connect to the issue.)

Minecraft 1.7.10 was released recently, but of course, Galacticraft is running on 1.6.4-Forge9.11.1.965 as the report below indicates.

---- Minecraft Crash Report ---- // I'm sorry, Dave.

Time: 6/27/14 6:05 PM Description: Unexpected error

java.lang.IndexOutOfBoundsException at java.nio.Buffer.checkIndex(Unknown Source) at java.nio.DirectByteBuffer.get(Unknown Source) at org.lwjgl.input.Keyboard.isKeyDown(Keyboard.java:407) at micdoodle8.mods.galacticraft.core.tick.GCCoreTickHandlerClient.tickEnd(GCCoreTickHandlerClient.java:382) at cpw.mods.fml.common.SingleIntervalHandler.tickEnd(SingleIntervalHandler.java:34) at cpw.mods.fml.common.FMLCommonHandler.tickEnd(FMLCommonHandler.java:141) at cpw.mods.fml.common.FMLCommonHandler.onPostClientTick(FMLCommonHandler.java:367) at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1970) at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:910) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:838) at net.minecraft.client.main.Main.main(SourceFile:101) 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:131) at net.minecraft.launchwrapper.Launch.main(Launch.java:27)

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

-- System Details -- Details: Minecraft Version: 1.6.4 Operating System: Windows 8 (x86) version 6.2 Java Version: 1.7.0_45, Oracle Corporation Java VM Version: Java HotSpot(TM) Client VM (mixed mode, sharing), Oracle Corporation Memory: 67481240 bytes (64 MB) / 204238848 bytes (194 MB) up to 518979584 bytes (494 MB) JVM Flags: 2 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx512M 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.11 FML v6.4.49.965 Minecraft Forge 9.11.1.965 6 mods loaded, 6 mods active mcp{8.09} Minecraft Coder Pack Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available FML{6.4.49.965} Forge Mod Loader Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available Forge{9.11.1.965} Minecraft Forge Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available Micdoodlecore{} Micdoodle8 Core Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available GalacticraftCore{2.0.13} Galacticraft Core Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available GalacticraftMars{2.0.13} Galacticraft Mars Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available Launched Version: 1.6.4-Forge9.11.1.965 LWJGL: 2.9.0 OpenGL: AMD Radeon HD 6410D GL version 4.2.12422 Compatibility Profile Context 13.152.1.1000, ATI Technologies Inc. Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Pack: Default Current Language: Gaeilge (Éire) Profiler Position: N/A (disabled) Vec3 Pool Size: ERROR NullPointerException: null

radfast commented 10 years ago

It is not a Galacticraft bug - Galacticraft is doing nothing unusual at that line of code, just making a standard call to see if the vanilla Inventory key (normally 'E') is pressed. It seems that your Minecraft has registered an invalid keyboard code for the Inventory key. Take a look in your .minecraft folder for the file "options.txt" and search for this line:

key_key.inventory:18

If you have a strange code there, try changing it to 18 or 19 which should correspond to the 'E' key (and I have no idea why on mine it is 18 so one number less than standard: http://ps-2.kev009.com/tl/techlib/manuals/adoclib/aixkybd/kybdtech/figures/kybdt1.jpg ).

If that doesn't fix it, maybe it's a hardware issue - like did you change keyboards or something, or did the cat sit on the keyboard while the kids were away?

seanmcox commented 10 years ago

That was helpful. Based on further follow-up it would appear that one of my kids probably started messing around with the control update options. The control for this key was set to -100, which appears to normally be the key associated with attack. (That or it is some kind of undefined designation....?)

All the same, I fail to see how that fails to qualify as a bug. From your description I could think of two decent approaches.

1) Catch the error and rethrow it with better detail (GalacticraftException: Error processing configured keys in .minecraft/galacticraft/options.txt ... caused by IndexOutOfBoundsException ...) or just check the input sanity yourself and throw a similar error.

2) Update to handle the full range of legal key configurations. (Maybe the Minecraft Forge API makes this hard?)

Probably both should be done.

Anyhow, my issue is resolved, and this is your code, not mine, so take this however you like. It's not the only bug report you have to worry about.

My boys really enjoy the work you've done thus far.

radfast commented 10 years ago

Oho - it seems, a negative number for the keyID means a mouse button, not a key, so that would error there and does need to be sanity checked. Thank you, good spot. This will be fixed in GC3.