matthewperiut / Chisel-Reborn

Chisel brought to modern versions of Minecraft 1.21+
3 stars 8 forks source link

Right clicking with "Chisel" instrument causes game to crash. #24

Closed Jexperto closed 4 months ago

Jexperto commented 1 year ago

Using chisel-1.4.8+1.19.3+continuity-inside causes game to crash whenever I click RMB while holding a chisel.

Here's an important part of crash report: Description: Rendering screen java.lang.IncompatibleClassChangeError: Expecting non-static method 'void net.minecraft.class_332.method_25302(net.minecraft.class_4587, int, int, int, int, int, int)' at com.matthewperiut.chisel.gui.ChiselScreen.method_2389(ChiselScreen.java:33) at net.minecraft.class_465.method_25394(class_465.java:98) at com.matthewperiut.chisel.gui.ChiselScreen.method_25394(ChiselScreen.java:39) at net.minecraft.class_437.method_47413(class_437.java:121) at net.minecraft.class_757.method_3192(class_757.java:937) at net.minecraft.class_310.method_1523(class_310.java:1218) at net.minecraft.class_310.method_1514(class_310.java:801) at net.minecraft.client.main.Main.main(Main.java:237) at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:462) at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) at java.base/java.lang.reflect.Method.invoke(Method.java:577) at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:224) at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:259) at org.multimc.EntryPoint.listen(EntryPoint.java:143) at org.multimc.EntryPoint.main(EntryPoint.java:34)

Now, I'm by no means a mc java dev but it seems that the error stems from ChiselScreen.java drawBackground method. According to the crash report java tries to call drawTexture, but the method is not static. But DrawableHelper class in which drawTexture is nested in is overloaded and also has static implementations of the method but with different number of parameters. As a local hotfix I changed the drawTexture call from: drawTexture(matrices, x, y, 0, 0, backgroundWidth, backgroundHeight); to drawTexture(matrices, x, y, 0, 0, backgroundWidth, backgroundHeight, 256, 256); as 256 is a default window size and it seems to work correctly without crashing and window warping.

All tests were conducted on Java 17,18 and minecraft 1.19.3 and 1.19.4. All versions seem to work fine after my homebrew fix.

Also found no crashes after compiling without continuity and launching with separate continuity-3.0.0-beta.2+1.19.3. Worked both on 1.19.3 and 1.19.4 Hope any of this helps

crash-2023-03-29_02.27.00-client.txt Successful gui load: image_2023-03-29_031503611

matthewperiut commented 4 months ago

fixed? perhaps? reopen if its an issue, this is pretty outdated. sorry for not looking sooner.