From 70b99f04a6c01290873644837e834c46f167c415 Mon Sep 17 00:00:00 2001 From: Astoria Date: Sat, 1 Apr 2023 18:34:31 -0500 Subject: [PATCH] Better looking lines! --- .../brokenmoon/afloydwiremod/mixin/MixinBlockRenderer.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/brokenmoon/afloydwiremod/mixin/MixinBlockRenderer.java b/src/main/java/net/brokenmoon/afloydwiremod/mixin/MixinBlockRenderer.java index 97adec9..f54513c 100644 --- a/src/main/java/net/brokenmoon/afloydwiremod/mixin/MixinBlockRenderer.java +++ b/src/main/java/net/brokenmoon/afloydwiremod/mixin/MixinBlockRenderer.java @@ -35,12 +35,14 @@ public class MixinBlockRenderer { public void renderLineBetweenTwoPoints(long x1, long y1, long z1, long x2, long y2, long z2, float red, float green, float blue, float alpha, float width){ GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glColor4f(red, green, blue, alpha); GL11.glLineWidth(width); - GL11.glBegin(GL11.GL_LINES); + GL11.glBegin(GL11.GL_LINE_STRIP); GL11.glVertex3f(Math.floorMod(x1, 16l), Math.floorMod(y1, 16l), Math.floorMod(z1, 16l)); GL11.glVertex3f(Math.floorMod(x1, 16l) - (x1 - x2), Math.floorMod(y1, 16l) - (y1 - y2), Math.floorMod(z1, 16l) - (z1 - z2)); GL11.glEnd(); + GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glPopMatrix(); } public void renderLineBetweenTwoPoints(long x1, long y1, long z1, long x2, long y2, long z2, float red, float green, float blue, float alpha){ @@ -51,6 +53,6 @@ public class MixinBlockRenderer { renderLineBetweenTwoPoints(x1, y1, z1, x2, y2, z2, red, green, blue, 255, 1); } public void renderLineBetweenTwoPoints(long x1, long y1, long z1, long x2, long y2, long z2){ - renderLineBetweenTwoPoints(x1, y1, z1, x2, y2, z2, 255, 0, 0, 255, 5); + renderLineBetweenTwoPoints(x1, y1, z1, x2, y2, z2, 255, 0, 0, 255 / 2, 1); } }