Scannable icon indicating copy to clipboard operation
Scannable copied to clipboard

[1.16.5 - Compatibility Issue] Vivecraft Crash when using scanner

Open Colin-J-Wood opened this issue 3 years ago • 11 comments

https://pastebin.com/0BjVRk4Y

game has trouble getting glstate from RenderSystem.multMatrix

Colin-J-Wood avatar Feb 21 '22 19:02 Colin-J-Wood

Does this also happen without optifine?

fnuecke avatar Apr 16 '22 10:04 fnuecke

It is impossible to run the mod without Optifine installed, as Vivecraft is specifically built to ship, auto install, and ultimately bakes in Optifine into itself. (due to a deal the devs made with sp618x several years ago)

Note that using this mod with Optifine on desktop by itself (no vivecraft, just optifine) does not crash in this manner. This crash only occurs with vivecraft's version of optifine (slightly modified to support vivecraft's shader edits)

Note again that Vivecraft has its own shader system which you will need to look at if you wish to fix support

Kaleidio avatar Apr 18 '22 01:04 Kaleidio

Might I suggest reaching out to the Vivecraft devs on their official discord to gather immediate help from them? they will provide information on their pipeline edits but they don't tend to directly contribute/assist

Kaleidio avatar Apr 18 '22 02:04 Kaleidio

This issue has been silent for a while so I guess I can clarify my answer.

No, it does not happen without optifine, but it also doesn't happen with it. it only happens with vivecraft.

Kaleidio avatar Jun 26 '22 11:06 Kaleidio

Hey, sorry, forgot to reply. Took me a little too long for the "vive" part to click -- I'm afraid that's not something I have the time to dig into, how to make this work for both regular rendering and VR rendering. If someone else wants to make a PR to add support for that/fix it, I'd be happy to review/merge it.

fnuecke avatar Jun 27 '22 11:06 fnuecke

Techjar, one of the lead vivecraft devs, has reached out to me with what you will need to do to ScanManager in order to fix it, and I copy paste quote below

"it's expecting RenderWorldLastEvent to fire before RenderGameOverlayEvent which is 100% not the case with vivecraft because we have to render the gui first so we can put it in the world so projectionMatrix never gets set and it NPEs on the first frame that a world is loaded "

Kaleidio avatar Jun 27 '22 13:06 Kaleidio

furthermore, and more of a functional issue, is the idea being that you cannot render everything in the gui layer. you'd have to build glowing mesh as world mesh instead. even if this was working, everything would appear in the quad at the player's hand instead of in the world as the effect intended

so for now it might be best option to NOP it out if vivecraft is present, until a solution is devised to build the mesh in world instead of in gui.

Kaleidio avatar Jun 27 '22 13:06 Kaleidio

Can unfortunately confirm that what looks like the same error happens with Fabric 1.19.2, so it has nothing to do with Optifine.

[09/04/2023 20:15:41 pm] java.lang.NullPointerException: Cannot invoke "net.minecraft.class_1159.method_22673()" because "$$0" is null
[09/04/2023 20:15:41 pm] 	at com.mojang.blaze3d.systems.RenderSystem.setProjectionMatrix(RenderSystem.java:1246)
[09/04/2023 20:15:41 pm] 	at li.cil.scannable.client.ScanManager.renderGui(ScanManager.java:257)
[09/04/2023 20:15:41 pm] 	at li.cil.scannable.client.fabric.ClientSetupFabric.lambda$onInitializeClient$2(ClientSetupFabric.java:20)
[09/04/2023 20:15:41 pm] 	at net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback.lambda$static$0(HudRenderCallback.java:27)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_329.handler$dke001$fabric-rendering-v1$render(class_329.java:5996)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_329.method_1753(class_329.java:393)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_757.redirect$hdj000$vivecraft$noGUIwithViewOnly(class_757.java:11477)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_757.method_3192(class_757.java:862)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_310.newRunTick(class_310.java:31028)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_310.handler$hcf000$vivecraft$replaceTick(class_310.java:30828)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_310.method_1523(class_310.java)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_310.method_1514(class_310.java:768)
[09/04/2023 20:15:41 pm] 	at net.minecraft.client.main.Main.method_44604(Main.java:244)
[09/04/2023 20:15:41 pm] 	at net.minecraft.client.main.Main.main(Main.java:51)
[09/04/2023 20:15:41 pm] 	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:462)
[09/04/2023 20:15:41 pm] 	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
[09/04/2023 20:15:41 pm] 	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)

pikaro avatar Apr 09 '23 18:04 pikaro

Can unfortunately confirm that what looks like the same error happens with Fabric 1.19.2, so it has nothing to do with Optifine.

[09/04/2023 20:15:41 pm] java.lang.NullPointerException: Cannot invoke "net.minecraft.class_1159.method_22673()" because "$$0" is null
[09/04/2023 20:15:41 pm] 	at com.mojang.blaze3d.systems.RenderSystem.setProjectionMatrix(RenderSystem.java:1246)
[09/04/2023 20:15:41 pm] 	at li.cil.scannable.client.ScanManager.renderGui(ScanManager.java:257)
[09/04/2023 20:15:41 pm] 	at li.cil.scannable.client.fabric.ClientSetupFabric.lambda$onInitializeClient$2(ClientSetupFabric.java:20)
[09/04/2023 20:15:41 pm] 	at net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback.lambda$static$0(HudRenderCallback.java:27)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_329.handler$dke001$fabric-rendering-v1$render(class_329.java:5996)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_329.method_1753(class_329.java:393)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_757.redirect$hdj000$vivecraft$noGUIwithViewOnly(class_757.java:11477)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_757.method_3192(class_757.java:862)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_310.newRunTick(class_310.java:31028)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_310.handler$hcf000$vivecraft$replaceTick(class_310.java:30828)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_310.method_1523(class_310.java)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_310.method_1514(class_310.java:768)
[09/04/2023 20:15:41 pm] 	at net.minecraft.client.main.Main.method_44604(Main.java:244)
[09/04/2023 20:15:41 pm] 	at net.minecraft.client.main.Main.main(Main.java:51)
[09/04/2023 20:15:41 pm] 	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:462)
[09/04/2023 20:15:41 pm] 	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
[09/04/2023 20:15:41 pm] 	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)

this is not the same crash, no. mine happens during gameplay. yours was during client loading. as noted by this line:

[09/04/2023 20:15:41 pm] at li.cil.scannable.client.fabric.ClientSetupFabric.lambda$onInitializeClient$2(ClientSetupFabric.java:20)

note how it says ClientSetup, and has nothing to do with MultiMatrixes.

I recommend opening a new issue for your own crash.

Kaleidio avatar Apr 09 '23 18:04 Kaleidio

No, that occurs in the exact moment I press the scan button. But yes, looks like I misinterpreted the Vivecraft devs' comments - but that also doesn't appear to match what you're describing now? "It NPEs on the first frame that a world is loaded" - wouldn't that happen on world load, not during gameplay?

pikaro avatar Apr 09 '23 19:04 pikaro

it seems that scannable fabric has renamed the method they use to ClientSetupFabric, and instead of being a setup system like I expected, it is called the first time the tool is used, rather than when the client world first loads. the name of this class changed since the 1.16.5 forge version this bug was originally reported on.

in 1.16.5, the method was called onPreRenderGameOverlay.. here in 1.19.2 fabric it seems to be a lambda called onInitializeClient

Kaleidio avatar Apr 09 '23 20:04 Kaleidio