aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
authorLorenz <lo.scherf@gmail.com>2022-09-07 13:46:31 +0200
committerLorenz <lo.scherf@gmail.com>2022-09-07 13:46:31 +0200
commita356555e2cf6c9a88e9039340e8a294a3ed5677a (patch)
tree77fbd26409a3f4f2339e1af1d0c9ed79a8f4c295 /src/main/java/at/hannibal2/skyhanni/utils
parent0dcd85d1103e5b8072aa97e186e986febbe6a60b (diff)
downloadskyhanni-a356555e2cf6c9a88e9039340e8a294a3ed5677a.tar.gz
skyhanni-a356555e2cf6c9a88e9039340e8a294a3ed5677a.tar.bz2
skyhanni-a356555e2cf6c9a88e9039340e8a294a3ed5677a.zip
fixed bazaar api checking too often
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt
index 5ce94c031..0be20057f 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt
@@ -8,6 +8,7 @@ import net.minecraft.client.gui.ScaledResolution
import net.minecraft.client.renderer.GlStateManager
import net.minecraft.client.renderer.Tessellator
import net.minecraft.client.renderer.vertex.DefaultVertexFormats
+import net.minecraft.entity.Entity
import net.minecraft.inventory.Slot
import net.minecraft.util.AxisAlignedBB
import net.minecraft.util.MathHelper
@@ -443,4 +444,35 @@ object RenderUtils {
offsetY += 14
}
}
+
+ // totally not modified Autumn Client's TargetStrafe
+ fun drawCircle(entity: Entity, partialTicks: Float, rad: Double, color: Color) {
+ var il = 0.0
+ val tessellator = Tessellator.getInstance()
+ val worldRenderer = tessellator.worldRenderer
+ while (il < 0.05) {
+ GlStateManager.pushMatrix()
+ GlStateManager.disableTexture2D()
+ GL11.glLineWidth(2F)
+ worldRenderer.begin(1, DefaultVertexFormats.POSITION)
+ val renderManager = Minecraft.getMinecraft().renderManager
+ val x: Double =
+ entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * partialTicks - renderManager.viewerPosX
+ val y: Double =
+ entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * partialTicks - renderManager.viewerPosY
+ val z: Double =
+ entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * partialTicks - renderManager.viewerPosZ
+ val pix2 = Math.PI * 2.0
+ for (i in 0..90) {
+ color.bindColor()
+ worldRenderer.pos(x + rad * cos(i * pix2 / 45.0), y + il, z + rad * sin(i * pix2 / 45.0)).endVertex()
+ }
+ tessellator.draw()
+ GlStateManager.enableTexture2D()
+ GlStateManager.popMatrix()
+ il += 0.0006
+ }
+ }
+
+ private fun Color.bindColor() = GlStateManager.color(this.red / 255f, this.green / 255f, this.blue / 255f, this.alpha / 255f)
} \ No newline at end of file