diff options
Diffstat (limited to 'utils')
-rw-r--r-- | utils/renderUtils.js | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/utils/renderUtils.js b/utils/renderUtils.js index 51e54b1..321e821 100644 --- a/utils/renderUtils.js +++ b/utils/renderUtils.js @@ -214,6 +214,50 @@ let ret = { GL11.glDepthMask(true); GL11.glDisable(GL11.GL_BLEND); }, + drawBoxAtBlock2: function (x, y, z, colorR, colorG, colorB, w = 1, h = 1, a = 1) { + + GL11.glBlendFunc(770, 771); + GL11.glEnable(GL11.GL_BLEND); + GL11.glLineWidth(3); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDepthMask(false); + GlStateManager[m.pushMatrix]() + + + Tessellator.begin(GL11.GL_LINE_STRIP).colorize(colorR, colorG, colorB, a); + + x -= w / 2 + z -= w / 2 + + Tessellator.pos(x + w, y + h, z + w); + Tessellator.pos(x + w, y + h, z); + Tessellator.pos(x, y + h, z); + Tessellator.pos(x, y + h, z + w); + Tessellator.pos(x + w, y + h, z + w); + Tessellator.pos(x + w, y, z + w); + Tessellator.pos(x + w, y, z); + Tessellator.pos(x, y, z); + Tessellator.pos(x, y, z + w); + Tessellator.pos(x, y, z); + Tessellator.pos(x, y + h, z); + Tessellator.pos(x, y, z); + Tessellator.pos(x + w, y, z); + Tessellator.pos(x + w, y + h, z); + Tessellator.pos(x + w, y, z); + Tessellator.pos(x + w, y, z + w); + Tessellator.pos(x, y, z + w); + Tessellator.pos(x, y + h, z + w); + Tessellator.pos(x + w, y + h, z + w); + + Tessellator.draw(); + + GlStateManager[m.popMatrix]() + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDepthMask(true); + GL11.glDisable(GL11.GL_BLEND); + }, drawBoxAtEntity: function (entity, colorR, colorG, colorB, width, height, partialTicks, lineWidth = 2, phase = false) { let x = entity.getX() + ((entity.getX() - entity.getLastX()) * partialTicks) let y = entity.getY() + ((entity.getY() - entity.getLastY()) * partialTicks) |