diff --git a/common/src/main/java/org/vivecraft/common/utils/MathUtils.java b/common/src/main/java/org/vivecraft/common/utils/MathUtils.java index fbe221878..19fd780db 100644 --- a/common/src/main/java/org/vivecraft/common/utils/MathUtils.java +++ b/common/src/main/java/org/vivecraft/common/utils/MathUtils.java @@ -47,7 +47,7 @@ public static Vec3 toMcVec3(Vector3f v) { /** * @return {@code m} as a Minecraft Matrix4f */ - public static com.mojang.math.Matrix4f toMcMat4(Matrix4f m) { + public static com.mojang.math.Matrix4f toMcMat4(Matrix4fc m) { com.mojang.math.Matrix4f mcMat = new com.mojang.math.Matrix4f(); mcMat.m00 = m.m00(); mcMat.m01 = m.m10(); diff --git a/common/src/main/java/org/vivecraft/mod_compat_vr/iris/mixin/coderbot/IrisCommonUniformsMixin.java b/common/src/main/java/org/vivecraft/mod_compat_vr/iris/mixin/coderbot/IrisCommonUniformsMixin.java index 5cf91f523..3eb2aacf3 100644 --- a/common/src/main/java/org/vivecraft/mod_compat_vr/iris/mixin/coderbot/IrisCommonUniformsMixin.java +++ b/common/src/main/java/org/vivecraft/mod_compat_vr/iris/mixin/coderbot/IrisCommonUniformsMixin.java @@ -11,6 +11,7 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.vivecraft.common.utils.MathUtils; import org.vivecraft.mod_compat_vr.shaders.ShadersHelper; import java.util.function.Supplier; @@ -25,9 +26,12 @@ public class IrisCommonUniformsMixin { for (Triple> uniform : ShadersHelper.getUniforms()) { switch (uniform.getMiddle()) { case MATRIX4F -> uniforms.uniformMatrix(UniformUpdateFrequency.PER_FRAME, uniform.getLeft(), - () -> (Matrix4fc) uniform.getRight().get()); + () -> MathUtils.toMcMat4((Matrix4fc) uniform.getRight().get())); case VECTOR3F -> uniforms.uniform3f(UniformUpdateFrequency.PER_FRAME, uniform.getLeft(), - () -> (Vector3f) uniform.getRight().get()); + () -> { + Vector3f v = (Vector3f) uniform.getRight().get(); + return new net.coderbot.iris.vendored.joml.Vector3f(v.x, v.y, v.z); + }); case INTEGER -> uniforms.uniform1i(UniformUpdateFrequency.PER_FRAME, uniform.getLeft(), () -> (int) uniform.getRight().get()); case BOOLEAN -> uniforms.uniform1b(UniformUpdateFrequency.PER_FRAME, uniform.getLeft(), diff --git a/fabric/src/main/java/org/vivecraft/client/fabric/XplatImpl.java b/fabric/src/main/java/org/vivecraft/client/fabric/XplatImpl.java index 9a8d8d669..f2ce9c303 100644 --- a/fabric/src/main/java/org/vivecraft/client/fabric/XplatImpl.java +++ b/fabric/src/main/java/org/vivecraft/client/fabric/XplatImpl.java @@ -5,7 +5,6 @@ import net.fabricmc.api.EnvType; import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; import net.fabricmc.fabric.api.client.render.fluid.v1.FluidRenderHandlerRegistry; -import net.fabricmc.fabric.api.entity.FakePlayer; import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; import net.fabricmc.loader.api.FabricLoader; import net.minecraft.client.ClientBrandRetriever; @@ -153,6 +152,6 @@ public static int getKeyModifierKey(KeyMapping keyMapping) { } public static boolean isFakePlayer(ServerPlayer player) { - return isModLoaded("fabric-events-interaction-v0") && player instanceof FakePlayer; + return false; } } diff --git a/stubs/src/main/java/net/coderbot/iris/gl/uniform/UniformHolder.java b/stubs/src/main/java/net/coderbot/iris/gl/uniform/UniformHolder.java index b08eafdcc..7d62deb25 100644 --- a/stubs/src/main/java/net/coderbot/iris/gl/uniform/UniformHolder.java +++ b/stubs/src/main/java/net/coderbot/iris/gl/uniform/UniformHolder.java @@ -1,7 +1,7 @@ package net.coderbot.iris.gl.uniform; -import org.joml.Matrix4fc; -import org.joml.Vector3f; +import com.mojang.math.Matrix4f; +import net.coderbot.iris.vendored.joml.Vector3f; import java.util.function.BooleanSupplier; import java.util.function.IntSupplier; @@ -15,5 +15,5 @@ public interface UniformHolder { UniformHolder uniform3f(UniformUpdateFrequency updateFrequency, String name, Supplier value); - UniformHolder uniformMatrix(UniformUpdateFrequency updateFrequency, String name, Supplier value); + UniformHolder uniformMatrix(UniformUpdateFrequency updateFrequency, String name, Supplier value); } diff --git a/stubs/src/main/java/net/coderbot/iris/vendored/joml/Vector3f.java b/stubs/src/main/java/net/coderbot/iris/vendored/joml/Vector3f.java new file mode 100644 index 000000000..280d1be11 --- /dev/null +++ b/stubs/src/main/java/net/coderbot/iris/vendored/joml/Vector3f.java @@ -0,0 +1,5 @@ +package net.coderbot.iris.vendored.joml; + +public class Vector3f { + public Vector3f(float x, float y, float z) {} +}