From 49a4afd8c513c3f59d9d63dacf9029dbbc43715c Mon Sep 17 00:00:00 2001 From: ch-yx Date: Fri, 8 Nov 2024 04:05:03 +0800 Subject: [PATCH] update --- gradle.properties | 4 ++-- src/main/java/carpet/script/utils/ShapesRenderer.java | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/gradle.properties b/gradle.properties index cf6947e1f..28a7305ea 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,8 +3,8 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check https://fabricmc.net/develop/ - minecraft_version=24w44a - loader_version=0.16.7 + minecraft_version=24w45a + loader_version=0.16.9 jsr305_version=3.0.2 fabric_version=0.106.0+1.21.2 diff --git a/src/main/java/carpet/script/utils/ShapesRenderer.java b/src/main/java/carpet/script/utils/ShapesRenderer.java index 0343d58fd..7604542e1 100644 --- a/src/main/java/carpet/script/utils/ShapesRenderer.java +++ b/src/main/java/carpet/script/utils/ShapesRenderer.java @@ -4,6 +4,7 @@ import carpet.script.external.Carpet; import carpet.script.utils.shapes.ShapeDirection; +import com.mojang.blaze3d.ProjectionType; import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.BufferBuilder; import com.mojang.blaze3d.vertex.BufferUploader; @@ -55,7 +56,7 @@ public class ShapesRenderer { - private static final Matrix4f ORTHOMAT = new Matrix4f().m22(-1); + private static final Matrix4f ORTHOMAT = new Matrix4f().m22(-1);//need to check if it should be that or a simple identity matrix. private final Map, Long2ObjectOpenHashMap>> shapes; private final Map, Long2ObjectOpenHashMap>> labels; private final Minecraft client; @@ -182,7 +183,7 @@ public void render(int passid, Camera camera, float partialTick) //RenderSystem.applyModelViewMatrix(); var ori=RenderSystem.getProjectionMatrix(); - RenderSystem.setProjectionMatrix(ORTHOMAT,VertexSorting.ORTHOGRAPHIC_Z); + RenderSystem.setProjectionMatrix(ORTHOMAT, ProjectionType.ORTHOGRAPHIC); // lines RenderSystem.lineWidth(0.5F); @@ -201,7 +202,7 @@ public void render(int passid, Camera camera, float partialTick) } }); RenderSystem.lineWidth(1.0F); - RenderSystem.setProjectionMatrix(ori,VertexSorting.DISTANCE_TO_ORIGIN); + RenderSystem.setProjectionMatrix(ori,ProjectionType.PERSPECTIVE); matrixStack.popMatrix(); } @@ -226,7 +227,7 @@ public void render(int passid, Camera camera, float partialTick) matrices.setIdentity(); //RenderSystem.applyModelViewMatrix(); var ori=RenderSystem.getProjectionMatrix(); - RenderSystem.setProjectionMatrix(ORTHOMAT,VertexSorting.ORTHOGRAPHIC_Z); + RenderSystem.setProjectionMatrix(ORTHOMAT,ProjectionType.ORTHOGRAPHIC); labels.get(dimensionType).values().forEach(s -> { if ((!s.shape.debug || entityBoxes) && s.shouldRender(dimensionType)&& s.shape.hud) { @@ -235,7 +236,7 @@ public void render(int passid, Camera camera, float partialTick) }); matrices.popPose(); //RenderSystem.applyModelViewMatrix(); - RenderSystem.setProjectionMatrix(ori,VertexSorting.DISTANCE_TO_ORIGIN); + RenderSystem.setProjectionMatrix(ori,ProjectionType.PERSPECTIVE); matrixStack.popMatrix(); //RenderSystem.applyModelViewMatrix(); }