From 4d754cfd4f9ab32f9f8205b072cc4bd0a7592b5d Mon Sep 17 00:00:00 2001 From: fayer3 Date: Mon, 13 Jan 2025 03:23:26 +0100 Subject: [PATCH 1/2] fix player arms with entity model features on forge below 1.20.5 --- .../mod_compat_vr/emf/mixin/EMFModelPartWithStateVRMixin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/org/vivecraft/mod_compat_vr/emf/mixin/EMFModelPartWithStateVRMixin.java b/common/src/main/java/org/vivecraft/mod_compat_vr/emf/mixin/EMFModelPartWithStateVRMixin.java index 8122de5c3..6d92719dc 100644 --- a/common/src/main/java/org/vivecraft/mod_compat_vr/emf/mixin/EMFModelPartWithStateVRMixin.java +++ b/common/src/main/java/org/vivecraft/mod_compat_vr/emf/mixin/EMFModelPartWithStateVRMixin.java @@ -14,12 +14,12 @@ "traben.entity_model_features.models.EMFModelPartWithState" }, remap = false) public class EMFModelPartWithStateVRMixin { - @WrapWithCondition(method = {"render", "method_22699", "m_104301_"}, at = @At(value = "INVOKE", target = "Ljava/lang/Runnable;run()V")) + @WrapWithCondition(method = {"render", "method_22699", "m_104306_"}, at = @At(value = "INVOKE", target = "Ljava/lang/Runnable;run()V")) private boolean vivecraft$noRenderEventForFirstPerson(Runnable instance) { return !VRState.VR_RUNNING || !ClientDataHolderVR.IS_FP_HAND; } - @WrapWithCondition(method = {"render", "method_22699", "m_104301_"}, at = @At(value = "INVOKE", target = "Ltraben/entity_model_features/models/parts/EMFModelPart$Animator;run()V")) + @WrapWithCondition(method = {"render", "method_22699", "m_104306_"}, at = @At(value = "INVOKE", target = "Ltraben/entity_model_features/models/parts/EMFModelPart$Animator;run()V")) private boolean vivecraft$noAnimationForFirstPerson(EMFModelPart.Animator original) { return !VRState.VR_RUNNING || !ClientDataHolderVR.IS_FP_HAND; } From 40f437b7bdc83dd20c0619e090bb1aa42a8c1688 Mon Sep 17 00:00:00 2001 From: fayer3 Date: Mon, 13 Jan 2025 03:29:31 +0100 Subject: [PATCH 2/2] fix potential null crash because of race conditions --- .../mixin/client_vr/renderer/GameRendererVRMixin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/org/vivecraft/mixin/client_vr/renderer/GameRendererVRMixin.java b/common/src/main/java/org/vivecraft/mixin/client_vr/renderer/GameRendererVRMixin.java index 1267668d6..fb252e90f 100644 --- a/common/src/main/java/org/vivecraft/mixin/client_vr/renderer/GameRendererVRMixin.java +++ b/common/src/main/java/org/vivecraft/mixin/client_vr/renderer/GameRendererVRMixin.java @@ -198,7 +198,7 @@ public abstract class GameRendererVRMixin private Matrix4f vivecraft$customProjectionMatrix( Matrix4f instance, float fovy, float aspect, float zNear, float zFar, Operation original) { - if (VRState.VR_RUNNING) { + if (!RenderPassType.isVanilla()) { zNear = vivecraft$MIN_CLIP_DISTANCE; if (MethodHolder.isInMenuRoom()) { // use 16 Chunks as minimum, to have no issues with clipping in the menuworld @@ -273,7 +273,7 @@ public abstract class GameRendererVRMixin GameRenderer instance, DeltaTracker deltaTracker, Operation original) { original.call(instance, deltaTracker); - if (VRState.VR_RUNNING && vivecraft$DATA_HOLDER.currentPass != RenderPass.THIRD && + if (!RenderPassType.isVanilla() && vivecraft$DATA_HOLDER.currentPass != RenderPass.THIRD && vivecraft$DATA_HOLDER.currentPass != RenderPass.CAMERA) { VREffectsHelper.renderFaceOverlay(deltaTracker.getGameTimeDeltaPartialTick(false));