Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
17183248569 committed Nov 7, 2024
1 parent 73f4857 commit 49a4afd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 6 additions & 5 deletions src/main/java/carpet/script/utils/ShapesRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<ResourceKey<Level>, Long2ObjectOpenHashMap<RenderedShape<? extends ShapeDispatcher.ExpiringShape>>> shapes;
private final Map<ResourceKey<Level>, Long2ObjectOpenHashMap<RenderedShape<? extends ShapeDispatcher.ExpiringShape>>> labels;
private final Minecraft client;
Expand Down Expand Up @@ -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);
Expand All @@ -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();

}
Expand All @@ -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)
{
Expand All @@ -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();
}
Expand Down

0 comments on commit 49a4afd

Please sign in to comment.