aboutsummaryrefslogtreecommitdiff
path: root/util/renderUtil.js
diff options
context:
space:
mode:
authorNinjune x <enderknight537@gmail.com>2023-01-08 02:12:14 -0600
committerNinjune x <enderknight537@gmail.com>2023-01-08 02:12:14 -0600
commit688e13930681bca7881d19468745f7067e9bc5c2 (patch)
tree9e95e59359dd2ae6e2e7761666b99a191bb62a1f /util/renderUtil.js
parent1891ada92ab1911cfaaa7ad0e72c85573f4fcbb6 (diff)
downloadcoleweight-688e13930681bca7881d19468745f7067e9bc5c2.tar.gz
coleweight-688e13930681bca7881d19468745f7067e9bc5c2.tar.bz2
coleweight-688e13930681bca7881d19468745f7067e9bc5c2.zip
v1.8.6future
Diffstat (limited to 'util/renderUtil.js')
-rw-r--r--util/renderUtil.js101
1 files changed, 101 insertions, 0 deletions
diff --git a/util/renderUtil.js b/util/renderUtil.js
new file mode 100644
index 0000000..1290938
--- /dev/null
+++ b/util/renderUtil.js
@@ -0,0 +1,101 @@
+export function trace(x, y, z, red, green, blue, alpha)
+{
+ GL11.glLineWidth(2.0)
+ GlStateManager.func_179090_x() // disableTexture2D
+
+ Tessellator.begin(1).colorize(red, green, blue, alpha)
+ if(Player.isSneaking())
+ Tessellator.pos(Player.getRenderX(), Player.getRenderY()+1.54, Player.getRenderZ()).tex(0, 0)
+ else
+ Tessellator.pos(Player.getRenderX(), Player.getRenderY()+1.6203, Player.getRenderZ()).tex(0, 0)
+ Tessellator.pos(x, y, z).tex(0, 0)
+ Tessellator.draw()
+
+ GlStateManager.func_179098_w() // enableTexture2D
+}
+
+
+export function drawEspBox (x, y, z, red, green, blue, alpha, phase = true) // thanks to renderlib, don't need the whole module so I'm not adding it.
+{
+ Tessellator.pushMatrix()
+ GL11.glLineWidth(2.0)
+ GlStateManager.func_179129_p() // disableCullFace
+ GlStateManager.func_179147_l() // enableBlend
+ GlStateManager.func_179112_b(770, 771) // blendFunc
+ GlStateManager.func_179132_a(false) // depthMask
+ GlStateManager.func_179090_x() // disableTexture2D
+
+ if(phase)
+ GlStateManager.func_179097_i() // disableDepth
+
+ const locations = [
+ // x, y, z x, y, z
+ [
+ [0, 0, 0],
+ [1, 0, 0],
+ ],
+ [
+ [0, 0, 0],
+ [0, 0, 1],
+ ],
+ [
+ [1, 0, 1],
+ [1, 0, 0],
+ ],
+ [
+ [1, 0, 1],
+ [0, 0, 1],
+ ],
+
+ [
+ [0, 1, 0],
+ [1, 1, 0],
+ ],
+ [
+ [0, 1, 0],
+ [0, 1, 1],
+ ],
+ [
+ [1, 1, 1],
+ [1, 1, 0],
+ ],
+ [
+ [1, 1, 1],
+ [0, 1, 1],
+ ],
+
+ [
+ [0, 0, 0],
+ [0, 1, 0],
+ ],
+ [
+ [1, 0, 0],
+ [1, 1, 0],
+ ],
+ [
+ [0, 0, 1],
+ [0, 1, 1],
+ ],
+ [
+ [1, 0, 1],
+ [1, 1, 1],
+ ],
+ ]
+
+ locations.forEach((loc) => {
+ Tessellator.begin(3).colorize(red, green, blue, alpha);
+ Tessellator.pos(x + loc[0][0] - 1 / 2, y + loc[0][1], z + loc[0][2] - 1 / 2).tex(0, 0)
+ Tessellator.pos(x + loc[1][0] - 1 / 2, y + loc[1][1], z + loc[1][2] - 1 / 2).tex(0, 0)
+ Tessellator.draw()
+ })
+
+ GlStateManager.func_179089_o() // enableCull
+ GlStateManager.func_179084_k() // disableBlend
+ GlStateManager.func_179132_a(true) // depthMask
+ GlStateManager.func_179098_w() // enableTexture2D
+
+ if(phase)
+ GlStateManager.func_179126_j() // enableDepth
+
+ Tessellator.popMatrix()
+} \ No newline at end of file