Vampirism - Become a vampire!

Vampirism - Become a vampire!

16M Downloads

MC crash when opening wheel to transform into bat

StefanHirche opened this issue · 3 comments

commented

Versions

  • Minecraft: 1.12.2
  • Forge: 14.23.4.2739
  • Vampirism: 1.12.2-1.4.3

In Vampire Level 4 when trying to morph into a bat, the server crashes. Only with the hosting player. All client players can transform.
Basically the crash already occurs when opening the action wheel.

Level up to level 4, achieve bat transformation action and open action wheel. Server shuts down and writes crashreport

Time: 8/6/18 9:41 PM
Description: Ticking screen

java.lang.IndexOutOfBoundsException
at java.nio.Buffer.checkIndex(Buffer.java:540)
at java.nio.DirectByteBuffer.get(DirectByteBuffer.java:253)
at org.lwjgl.input.Keyboard.isKeyDown(Keyboard.java:407)
at de.teamlapen.lib.lib.client.gui.GuiPieMenu.isKeyDown(GuiPieMenu.java:349)
at de.teamlapen.lib.lib.client.gui.GuiPieMenu.func_73876_c(GuiPieMenu.java:171)
at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1777)
at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1096)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:397)
at net.minecraft.client.main.Main.main(SourceFile:123)
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:498)
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 --
Thread: Client thread
Stacktrace:
at java.nio.Buffer.checkIndex(Buffer.java:540)
at java.nio.DirectByteBuffer.get(DirectByteBuffer.java:253)
at org.lwjgl.input.Keyboard.isKeyDown(Keyboard.java:407)
at de.teamlapen.lib.lib.client.gui.GuiPieMenu.isKeyDown(GuiPieMenu.java:349)
at de.teamlapen.lib.lib.client.gui.GuiPieMenu.func_73876_c(GuiPieMenu.java:171)

commented

Just to chime in here this type of crash is usually due to mishandling of mouse button binds, as minecraft maps them in negative values. Here is an example of a more correct way to handle control bindings that cover this scenario I believe: micdoodle8/Galacticraft@c4f732a

commented

Thank you very much for posting this here. It is definitively best to use the MC methods. I was probably missing the !=0 < 256 check.
Also noticed that KeyBinding has a #getDisplayName method, which makes it a lot easier to refer to keys in the guide book

commented

Sorry for not responding quicker, completely missed this one.

Which key did you configure to open the action menu? It appears to be a strange one.

I will definitively have to implement some kind of range check