Integrated Terminals

Integrated Terminals

20M Downloads

Pressing Enter to confirm a Crafting Plan causes the game to crash.

sctjkc01 opened this issue ยท 4 comments

commented

Issue type:

  • ๐Ÿ› Bug

Short description:

Pressing enter to confirm the crafting plan causes the game to crash due to a type casting failure here.

Steps to reproduce the problem:

  1. Setup:
    a. Place a chest and a crafting table.
    b. Attach a crafting interface to the crafting table, an item interface to the chest, cable between, and a storage terminal onto the cable.
    c. Put Oak Wood into the chest.
    d. Generate a Recipe card for [1 Oak Wood] -> [4 Oak Planks] and insert it into the crafting interface facing the crafting table.
  2. From the storage terminal, request the crafting of Oak Planks.
    a. Left click on the "Craft 4 Oak Planks" pseudo-item in the terminal.
    b. Press Enter to confirm crafting one batch of Oak Planks.
    c. Press Enter to agree to the proposed Crafting Plan.

Expected behaviour:

The requested crafting begins.


Versions:

  • This mod: Integrated Terminals version 1.18.2-1.3.1
  • Minecraft: 1.18.2
  • Forge: 40.1.74

Additionally:

  • Common Capabilities version 1.18.2-2.8.2
  • Cyclops Core version 1.18.2-1.16.0
  • Integrated Crafting version 1.18.2-1.0.25
  • Integrated Dynamics version 1.18.2-1.11.12
  • Integrated Tunnels version 1.18.2-1.8.15

Log file:

The full log

The callstack:

java.lang.ClassCastException: class org.cyclops.integratedterminals.client.gui.container.component.GuiCraftingPlan cannot be cast to class net.minecraft.client.gui.components.Button (org.cyclops.integratedterminals.client.gui.container.component.GuiCraftingPlan is in module [email protected] of loader 'TRANSFORMER' @2538bc06; net.minecraft.client.gui.components.Button is in module [email protected] of loader 'TRANSFORMER' @2538bc06)
	at org.cyclops.integratedterminals.client.gui.container.ContainerScreenTerminalStorageCraftingPlan.m_7933_(ContainerScreenTerminalStorageCraftingPlan.java:79) ~[IntegratedTerminals-1.18.2-1.3.1.jar%2357!/:1.3.1] {re:classloading}
	at net.minecraft.client.KeyboardHandler.lambda$keyPress$4(KeyboardHandler.java:363) ~[client-1.18.2-20220404.173914-srg.jar%2359!/:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.screens.Screen.m_96579_(Screen.java:528) ~[client-1.18.2-20220404.173914-srg.jar%2359!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.KeyboardHandler.m_90893_(KeyboardHandler.java:353) ~[client-1.18.2-20220404.173914-srg.jar%2359!/:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.KeyboardHandler.m_167831_(KeyboardHandler.java:452) ~[client-1.18.2-20220404.173914-srg.jar%2359!/:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.util.thread.BlockableEventLoop.execute(BlockableEventLoop.java:103) ~[client-1.18.2-20220404.173914-srg.jar%2359!/:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.client.KeyboardHandler.m_90938_(KeyboardHandler.java:451) ~[client-1.18.2-20220404.173914-srg.jar%2359!/:?] {re:classloading,pl:runtimedistcleaner:A}
	at org.lwjgl.glfw.GLFWKeyCallbackI.callback(GLFWKeyCallbackI.java:37) ~[lwjgl-glfw-3.2.2.jar%2348!/:build 10] {}
	at org.lwjgl.system.JNI.invokeV(Native Method) ~[lwjgl-3.2.2.jar%2344!/:build 10] {}
	at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3101) ~[lwjgl-glfw-3.2.2.jar%2348!/:build 10] {}
	at com.mojang.blaze3d.systems.RenderSystem.m_69495_(RenderSystem.java:197) ~[client-1.18.2-20220404.173914-srg.jar%2359!/:?] {re:classloading}
	at com.mojang.blaze3d.platform.Window.m_85435_(Window.java:333) ~[client-1.18.2-20220404.173914-srg.jar%2359!/:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.m_91383_(Minecraft.java:1068) ~[client-1.18.2-20220404.173914-srg.jar%2359!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.m_91374_(Minecraft.java:665) ~[client-1.18.2-20220404.173914-srg.jar%2359!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.main.Main.main(Main.java:205) ~[client-1.18.2-20220404.173914-srg.jar%2359!/:?] {re:classloading,pl:runtimedistcleaner:A}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {}
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}
	at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {}
	at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$launchService$0(CommonClientLaunchHandler.java:31) ~[fmlloader-1.18.2-40.1.74.jar%2317!/:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-9.1.3.jar%235!/:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-9.1.3.jar%235!/:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-9.1.3.jar%235!/:?] {}
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) [modlauncher-9.1.3.jar%235!/:?] {}
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-9.1.3.jar%235!/:?] {}
	at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-9.1.3.jar%235!/:?] {}
	at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-9.1.3.jar%235!/:?] {}
	at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:149) [bootstraplauncher-1.0.0.jar:?] {}
commented

Thanks for reporting!

commented

Forgive me if I'm overstepping my bounds. Looking at the relevant code, it seems as though the issue would be readily resolved if the line indicated was changed from ((Button) this.children().get(0)).onPress(); to ((Button) this.children().get(1)).onPress();.

From what I can tell as a novice to this codebase, the interface has two children: the crafting plan itself, and the button to confirm, in that order. Which means this.children().get(0) would get the crafting plan rather than the intended button.

commented

Looks like that could indeed be the problem! You're welcome to submit a PR if that fixes the problem.

commented

Unfortunately, I am not set up to do any Minecraft modding, and I am not so confident in the fix that I would submit even a one-character PR without being able to test that it is correct. I can, however, be patient as I await a fix from someone more capable to perform confirmation that the above fix is indeed enough.