aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/utils
diff options
context:
space:
mode:
authorsyeyoung <42869671+cyoung06@users.noreply.github.com>2020-11-28 15:37:36 +0900
committersyeyoung <42869671+cyoung06@users.noreply.github.com>2020-11-28 15:37:36 +0900
commitbb507052d573c2754289a0de58de88fc72eade3a (patch)
treedaa20283c1bbcdcff70c4caa0c42ea3b9bfc80b0 /src/main/java/kr/syeyoung/dungeonsguide/utils
parent832eb22f6320540c8f9c2c12dec5e8466bbe87f1 (diff)
downloadSkyblock-Dungeons-Guide-bb507052d573c2754289a0de58de88fc72eade3a.tar.gz
Skyblock-Dungeons-Guide-bb507052d573c2754289a0de58de88fc72eade3a.tar.bz2
Skyblock-Dungeons-Guide-bb507052d573c2754289a0de58de88fc72eade3a.zip
puzzle solvers and bug fixes
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/utils')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java b/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java
index c985cf42..158793b3 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java
@@ -93,6 +93,45 @@ public class RenderUtils {
}
+ public static void drawLine(BlockPos pos1, BlockPos pos2, Color c, float partialTicks) {
+
+ Entity viewing_from = Minecraft.getMinecraft().getRenderViewEntity();
+
+ double x_fix = viewing_from.lastTickPosX + ((viewing_from.posX - viewing_from.lastTickPosX) * partialTicks);
+ double y_fix = viewing_from.lastTickPosY + ((viewing_from.posY - viewing_from.lastTickPosY) * partialTicks);
+ double z_fix = viewing_from.lastTickPosZ + ((viewing_from.posZ - viewing_from.lastTickPosZ) * partialTicks);
+
+ GlStateManager.pushMatrix();
+ GlStateManager.pushAttrib();
+ GlStateManager.translate(-x_fix, -y_fix, -z_fix);
+
+ GlStateManager.disableLighting();
+ GlStateManager.enableBlend();
+ GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GlStateManager.disableTexture2D();
+
+ GL11.glDisable(GL11.GL_DEPTH_TEST);
+ GL11.glDepthMask(false);
+ GL11.glColor4ub((byte)c.getRed(), (byte)c.getGreen(), (byte)c.getBlue(), (byte)c.getAlpha());
+
+ GL11.glBegin(GL11.GL_LINES);
+
+ GL11.glVertex3f(pos1.getX(), pos1.getY(), pos1.getZ());
+ GL11.glVertex3f(pos1.getX(),pos1.getY(),pos1.getZ());
+
+
+ GL11.glEnd();
+
+
+ GL11.glEnable(GL11.GL_DEPTH_TEST);
+ GL11.glDepthMask(true);
+ GlStateManager.enableTexture2D();
+ GlStateManager.disableBlend();
+ GlStateManager.enableLighting();
+ GlStateManager.popMatrix();
+ GlStateManager.popAttrib();
+ }
+
public static void highlightBlock(BlockPos blockpos, Color c, float partialTicks) {
Entity viewing_from = Minecraft.getMinecraft().getRenderViewEntity();