diff options
author | bowser0000 <bowser0000@gmail.com> | 2021-03-04 22:00:19 -0500 |
---|---|---|
committer | bowser0000 <bowser0000@gmail.com> | 2021-03-04 22:00:19 -0500 |
commit | e7237307e71c649b4b7c880259ff1781fcc7c435 (patch) | |
tree | 91c1d6e9a86e1083d1d8eb4d5cfc4ff2ea940765 /src/main/java/me/Danker/utils/Utils.java | |
parent | 4f478737d5777c4e6780ab1a8aa7162368b21cb0 (diff) | |
download | SkyblockMod-e7237307e71c649b4b7c880259ff1781fcc7c435.tar.gz SkyblockMod-e7237307e71c649b4b7c880259ff1781fcc7c435.tar.bz2 SkyblockMod-e7237307e71c649b4b7c880259ff1781fcc7c435.zip |
Add boulder puzzle solver
Diffstat (limited to 'src/main/java/me/Danker/utils/Utils.java')
-rw-r--r-- | src/main/java/me/Danker/utils/Utils.java | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index 911704f..1a24c69 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -305,7 +305,7 @@ public class Utils { }); } - public static void draw3DLine(Vec3 pos1, Vec3 pos2, int colourInt, float partialTicks) { + public static void draw3DLine(Vec3 pos1, Vec3 pos2, int colourInt, int lineWidth, boolean depth, float partialTicks) { Entity render = Minecraft.getMinecraft().getRenderViewEntity(); WorldRenderer worldRenderer = Tessellator.getInstance().getWorldRenderer(); Color colour = new Color(colourInt); @@ -320,7 +320,11 @@ public class Utils { GlStateManager.enableBlend(); GlStateManager.disableAlpha(); GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); - GL11.glLineWidth(2); + GL11.glLineWidth(lineWidth); + if (!depth) { + GL11.glDisable(GL11.GL_DEPTH_TEST); + GlStateManager.depthMask(false); + } GlStateManager.color(colour.getRed() / 255f, colour.getGreen() / 255f, colour.getBlue() / 255f, colour.getAlpha() / 255f); worldRenderer.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION); @@ -329,6 +333,10 @@ public class Utils { Tessellator.getInstance().draw(); GlStateManager.translate(realX, realY, realZ); + if (!depth) { + GL11.glEnable(GL11.GL_DEPTH_TEST); + GlStateManager.depthMask(true); + } GlStateManager.disableBlend(); GlStateManager.enableAlpha(); GlStateManager.enableTexture2D(); @@ -386,7 +394,7 @@ public class Utils { GlStateManager.popMatrix(); } - public static void drawFilled3DBox(AxisAlignedBB aabb, int colourInt, boolean translucent, float partialTicks) { + public static void drawFilled3DBox(AxisAlignedBB aabb, int colourInt, boolean translucent, boolean depth, float partialTicks) { Entity render = Minecraft.getMinecraft().getRenderViewEntity(); WorldRenderer worldRenderer = Tessellator.getInstance().getWorldRenderer(); Color colour = new Color(colourInt); @@ -401,8 +409,12 @@ public class Utils { GlStateManager.disableTexture2D(); GlStateManager.enableAlpha(); GlStateManager.enableBlend(); - GlStateManager.tryBlendFuncSeparate(770, translucent ? 1 : 771, 1, 0); GlStateManager.disableCull(); + GlStateManager.tryBlendFuncSeparate(770, translucent ? 1 : 771, 1, 0); + if (!depth) { + GL11.glDisable(GL11.GL_DEPTH_TEST); + GlStateManager.depthMask(false); + } GlStateManager.color(colour.getRed() / 255f, colour.getGreen() / 255f, colour.getBlue() / 255f, colour.getAlpha() / 255f); worldRenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION); // Bottom @@ -438,6 +450,10 @@ public class Utils { Tessellator.getInstance().draw(); GlStateManager.translate(realX, realY, realZ); + if (!depth) { + GL11.glEnable(GL11.GL_DEPTH_TEST); + GlStateManager.depthMask(true); + } GlStateManager.enableCull(); GlStateManager.disableAlpha(); GlStateManager.disableBlend(); |