Posted October 13, 20177 yr Hello, I seem to be having problems when ever i override all recipes in a tab. When i do this and i open the recipe book i get a null pointer exception. It seems to be be caused by the removal of the Lists of RecipeLists in RecipeBookClient.class. My question is is there a way i can fix this mayself or should i request a change some where? If i should request a change where would i do that.
October 13, 20177 yr Author This is the error. java.util.concurrent.ExecutionException: java.lang.NullPointerException at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_121] at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_121] at net.minecraft.util.Util.runTask(Util.java:54) [Util.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1161) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:436) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:26) [start/:?] Caused by: java.lang.NullPointerException at net.minecraft.client.gui.recipebook.GuiButtonRecipeTab.func_193919_e(GuiButtonRecipeTab.java:146) ~[GuiButtonRecipeTab.class:?] at net.minecraft.client.gui.recipebook.GuiRecipeBook.func_193949_f(GuiRecipeBook.java:210) ~[GuiRecipeBook.class:?] at net.minecraft.client.gui.recipebook.GuiRecipeBook.func_193014_a(GuiRecipeBook.java:97) ~[GuiRecipeBook.class:?] at net.minecraft.client.gui.recipebook.GuiRecipeBook.func_194303_a(GuiRecipeBook.java:73) ~[GuiRecipeBook.class:?] at net.minecraft.client.gui.inventory.GuiCrafting.initGui(GuiCrafting.java:47) ~[GuiCrafting.class:?] at net.minecraft.client.gui.GuiScreen.setWorldAndResolution(GuiScreen.java:543) ~[GuiScreen.class:?] at net.minecraft.client.Minecraft.displayGuiScreen(Minecraft.java:1081) ~[Minecraft.class:?] at net.minecraft.client.entity.EntityPlayerSP.displayGui(EntityPlayerSP.java:856) ~[EntityPlayerSP.class:?] at net.minecraft.client.network.NetHandlerPlayClient.handleOpenWindow(NetHandlerPlayClient.java:1214) ~[NetHandlerPlayClient.class:?] at net.minecraft.network.play.server.SPacketOpenWindow.processPacket(SPacketOpenWindow.java:47) ~[SPacketOpenWindow.class:?] at net.minecraft.network.play.server.SPacketOpenWindow.processPacket(SPacketOpenWindow.java:11) ~[SPacketOpenWindow.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:21) ~[PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_121] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_121] at net.minecraft.util.Util.runTask(Util.java:53) ~[Util.class:?] ... 15 more
October 14, 20177 yr Author 18 hours ago, diesieben07 said: The recipe book will crash like that if it tries to display a tab with no recipes on it. You will need to manually remove the tab from the recipe book GUI. Subscribe to InitGuiEvent.Pre and check if the GuiScreen is a GuiInventory or a GuiCrafting. Grab the recipeBookGui field from the GuiScreen, you will need reflection since the field is private. Also keep in mind the SRG names. Now you have an instance of GuiRecipeBook. That class has a field recipeTabs (again, you need reflection), which contains all tabs visible on that GUI (a List<GuiButtonRecipeTab>). You will need to remove any tab from that list that you removed all recipes from. You know which tab is which using the GuiButtonRecipeTab::getCategory method. Ok i have gotten access to the list of tabs but now what? I know i have to remove the ones that have no recipes but is there a way to check if it has recipes? or do i just have to manually remove the ones that are not being used?
October 14, 20177 yr Author 1 minute ago, diesieben07 said: You have to remove the ones that you removed all recipes from. You know which recipes you remove, right? Yes i do. I remove all vanilla recipes. I was just hoping that if i add one of my items and its in a tab i wont have to change the code to account for that.
October 14, 20177 yr Author Just now, diesieben07 said: I have no idea what you are trying to say. Yeah i didnt explain that well. I remove all vanilla recipes so i know what tabs i have to remove. My question is can i test if a tab has recipes and if it doesnt remove it.
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.