From 1e26ae61a34f34e1226acfb70603c6b4f4100ba2 Mon Sep 17 00:00:00 2001 From: fayer3 Date: Mon, 16 Sep 2024 00:05:44 +0200 Subject: [PATCH] fix stupid crash, because rubidium/embeddium don't ship regular joml --- .../java/org/vivecraft/mod_compat_vr/iris/IrisHelper.java | 7 +++---- .../mod_compat_vr/iris/mixin/IrisDHCompatVRMixin.java | 2 +- .../iris/mixin/IrisLodRenderProgramVRMixin.java | 2 +- gradle.properties | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/common/src/main/java/org/vivecraft/mod_compat_vr/iris/IrisHelper.java b/common/src/main/java/org/vivecraft/mod_compat_vr/iris/IrisHelper.java index 598e0fd8b..f30a1b25d 100644 --- a/common/src/main/java/org/vivecraft/mod_compat_vr/iris/IrisHelper.java +++ b/common/src/main/java/org/vivecraft/mod_compat_vr/iris/IrisHelper.java @@ -2,7 +2,6 @@ import net.irisshaders.iris.api.v0.IrisApi; import org.joml.Matrix4f; -import org.joml.Matrix4fc; import org.vivecraft.client.Xplat; import org.vivecraft.client_vr.settings.VRSettings; import org.vivecraft.client_xr.render_pass.RenderPassManager; @@ -101,12 +100,12 @@ public static void unregisterDHIfThere(Object pipeline) { /** * needed, because some Iris versions return a Matrix4f and others a Matrix4fc, which causes a runtime exception * @param source CapturedRenderingState INSTANCE to call this on - * @return Matrix4fc current projection matrix + * @return Matrix4fc as Object, current projection matrix */ - public static Matrix4fc getGbufferProjection(Object source) { + public static Object getGbufferProjection(Object source) { if (init() && dhPresent) { try { - return (Matrix4fc) CapturedRenderingState_getGbufferProjection.invoke(source); + return CapturedRenderingState_getGbufferProjection.invoke(source); } catch (IllegalAccessException | InvocationTargetException e) { VRSettings.logger.error("Vivecraft: couldn't get iris gbuffer projection matrix: {}", e.getMessage()); } diff --git a/common/src/main/java/org/vivecraft/mod_compat_vr/iris/mixin/IrisDHCompatVRMixin.java b/common/src/main/java/org/vivecraft/mod_compat_vr/iris/mixin/IrisDHCompatVRMixin.java index 23657f404..651f14ffb 100644 --- a/common/src/main/java/org/vivecraft/mod_compat_vr/iris/mixin/IrisDHCompatVRMixin.java +++ b/common/src/main/java/org/vivecraft/mod_compat_vr/iris/mixin/IrisDHCompatVRMixin.java @@ -23,7 +23,7 @@ public class IrisDHCompatVRMixin { ClientDataHolderVR.getInstance().currentPass == RenderPass.RIGHT) { // VR projections are not centered - Matrix4fc vrProjection = IrisHelper.getGbufferProjection(CapturedRenderingState.INSTANCE); + Matrix4fc vrProjection = (Matrix4fc) IrisHelper.getGbufferProjection(CapturedRenderingState.INSTANCE); Matrix4f dhProjection = cir.getReturnValue(); dhProjection.m00(vrProjection.m00()); diff --git a/common/src/main/java/org/vivecraft/mod_compat_vr/iris/mixin/IrisLodRenderProgramVRMixin.java b/common/src/main/java/org/vivecraft/mod_compat_vr/iris/mixin/IrisLodRenderProgramVRMixin.java index e81cbb071..adf23d4d8 100644 --- a/common/src/main/java/org/vivecraft/mod_compat_vr/iris/mixin/IrisLodRenderProgramVRMixin.java +++ b/common/src/main/java/org/vivecraft/mod_compat_vr/iris/mixin/IrisLodRenderProgramVRMixin.java @@ -47,7 +47,7 @@ public class IrisLodRenderProgramVRMixin { ClientDataHolderVR.getInstance().currentPass == RenderPass.RIGHT) { // VR projections are not centered - Matrix4fc vrProjection = IrisHelper.getGbufferProjection(CapturedRenderingState.INSTANCE); + Matrix4fc vrProjection = (Matrix4fc) IrisHelper.getGbufferProjection(CapturedRenderingState.INSTANCE); Matrix4f dhProjectionMutable = new Matrix4f(dhProjection); diff --git a/gradle.properties b/gradle.properties index ea80b4bdf..9c5f0b270 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ minecraft_version=1.19.2 enabled_platforms=fabric,forge archives_base_name=vivecraft -mod_version=1.1.12 +mod_version=1.1.13 maven_group=org.vivecraft architectury_version=6.5.90