SliderElement throws NullPointerException when setting value when uninitialized
JamiesWhiteShirt opened this issue ยท 3 comments
SliderElement delegates its state to an InputElement which is created during init
. Because of this, the value cannot be set before init
is called and throws a NullPointerException. This exception is unavoidable when using numerical values for ConfigGUI because this situation occurs.
java.lang.NullPointerException: Rendering screen
at net.ilexiconn.llibrary.client.gui.element.SliderElement.withValue(SliderElement.java:112)
at net.ilexiconn.llibrary.client.gui.config.ConfigGUI.createPropertyElement(ConfigGUI.java:162)
at net.ilexiconn.llibrary.client.gui.config.ConfigGUI.drawScreen(ConfigGUI.java:124)
at net.ilexiconn.llibrary.client.gui.ElementGUI.drawScreen(ElementGUI.java:49)
at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:374)
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1147)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1139)
at net.minecraft.client.Minecraft.run(Minecraft.java:406)
Not very easy to call init
when ConfigGui doesn't.