aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorLorenz <lo.scherf@gmail.com>2022-09-07 14:20:05 +0200
committerLorenz <lo.scherf@gmail.com>2022-09-07 14:20:05 +0200
commit5fd3bcd10cd41f016acb4658bc441fb21bf14e85 (patch)
tree29e2b5c092a5b4d4db569522779088e20b7235bc /src/main
parent12899c2863ae42ef7bd912c8639ce5c1ed3e95c1 (diff)
downloadskyhanni-5fd3bcd10cd41f016acb4658bc441fb21bf14e85.tar.gz
skyhanni-5fd3bcd10cd41f016acb4658bc441fb21bf14e85.tar.bz2
skyhanni-5fd3bcd10cd41f016acb4658bc441fb21bf14e85.zip
Changed the ashfang gravity orb highlight from square to cylinder
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Ashfang.java2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/FireVeilWandParticles.kt32
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt15
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt71
4 files changed, 80 insertions, 40 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Ashfang.java b/src/main/java/at/hannibal2/skyhanni/config/features/Ashfang.java
index 909649633..4ddae7a05 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/Ashfang.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/Ashfang.java
@@ -40,7 +40,7 @@ public class Ashfang {
desc = "Color of the Ashfang Gravity Orbs"
)
@ConfigEditorColour
- public String gravityOrbsColor = "0:245:255:85:85";
+ public String gravityOrbsColor = "0:120:255:85:85";
@Expose
@ConfigOption(name = "Ashfang Blazing Souls", desc = "Showing the Blazing Souls more clearly")
diff --git a/src/main/java/at/hannibal2/skyhanni/features/FireVeilWandParticles.kt b/src/main/java/at/hannibal2/skyhanni/features/FireVeilWandParticles.kt
index ff4c80d69..d7af6d6c3 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/FireVeilWandParticles.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/FireVeilWandParticles.kt
@@ -8,12 +8,10 @@ import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.RenderUtils
import at.hannibal2.skyhanni.utils.SpecialColour
import net.minecraft.client.Minecraft
-import net.minecraft.client.renderer.GlStateManager
import net.minecraft.network.play.server.S2APacketParticles
import net.minecraft.util.EnumParticleTypes
import net.minecraftforge.client.event.RenderWorldLastEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
-import org.lwjgl.opengl.GL11
import java.awt.Color
class FireVeilWandParticles {
@@ -58,33 +56,9 @@ class FireVeilWandParticles {
if (SkyHanniMod.feature.abilities.fireVeilWandDisplay != 1) return
if (System.currentTimeMillis() > lastClick + 5_500) return
- val color = Color(SpecialColour.specialToChromaRGB(SkyHanniMod.feature.abilities.fireVeilWandDisplayColor), true)
+ val color =
+ Color(SpecialColour.specialToChromaRGB(SkyHanniMod.feature.abilities.fireVeilWandDisplayColor), true)
- GlStateManager.pushMatrix()
- GL11.glNormal3f(0.0f, 1.0f, 0.0f)
-
- GlStateManager.enableDepth()
- GlStateManager.enableBlend()
- GlStateManager.depthFunc(GL11.GL_LEQUAL)
- GlStateManager.disableCull()
- GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0)
- GlStateManager.enableAlpha()
- GlStateManager.disableTexture2D()
-
- GlStateManager.disableDepth()
- RenderUtils.drawCircle(
- Minecraft.getMinecraft().thePlayer,
- event.partialTicks,
- 3.5,
- color
- )
- GlStateManager.enableDepth()
-
- GlStateManager.enableCull()
- GlStateManager.enableTexture2D()
- GlStateManager.enableDepth()
- GlStateManager.disableBlend()
- GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f)
- GlStateManager.popMatrix()
+ RenderUtils.drawCircle(Minecraft.getMinecraft().thePlayer, event.partialTicks, 3.5, color)
}
} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt
index f9ca75f59..c0dbe3108 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt
@@ -3,13 +3,9 @@ package at.hannibal2.skyhanni.features.nether.ashfang
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.features.damageindicator.BossType
import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager
-import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled
+import at.hannibal2.skyhanni.utils.*
import at.hannibal2.skyhanni.utils.ItemUtils.getSkullTexture
-import at.hannibal2.skyhanni.utils.LocationUtils
-import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.RenderUtils.drawString
-import at.hannibal2.skyhanni.utils.SpecialColour
-import at.hannibal2.skyhanni.utils.getLorenzVec
import net.minecraft.client.Minecraft
import net.minecraft.entity.item.EntityArmorStand
import net.minecraftforge.client.event.RenderWorldLastEvent
@@ -39,15 +35,14 @@ class AshfangGravityOrbs {
fun onRenderWorld(event: RenderWorldLastEvent) {
if (!isEnabled()) return
- val special = SkyHanniMod.feature.ashfang.gravityOrbsColor
-
- val color = Color(SpecialColour.specialToChromaRGB(special), true)
-
+ val color = Color(SpecialColour.specialToChromaRGB(SkyHanniMod.feature.ashfang.gravityOrbsColor), true)
val playerLocation = LocationUtils.playerLocation()
for (orb in orbs) {
if (orb.isDead) continue
val orbLocation = orb.getLorenzVec()
- event.drawWaypointFilled(orbLocation.add(-0.5, 1.25, -0.5), color, extraSize = 1.0)
+ val center = orbLocation.add(-0.5, -2.0, -0.5)
+ RenderUtils.drawCylinderInWorld(color, center.x, center.y, center.z, 3.5f, 4.5f, event.partialTicks)
+
if (orbLocation.distance(playerLocation) < 15) {
//TODO find way to dynamically change color
event.drawString(orbLocation.add(0.0, 2.5, 0.0), "§cGravity Orb")
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt
index 0be20057f..58de5dcff 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt
@@ -447,6 +447,19 @@ object RenderUtils {
// totally not modified Autumn Client's TargetStrafe
fun drawCircle(entity: Entity, partialTicks: Float, rad: Double, color: Color) {
+ GlStateManager.pushMatrix()
+ GL11.glNormal3f(0.0f, 1.0f, 0.0f)
+
+ GlStateManager.enableDepth()
+ GlStateManager.enableBlend()
+ GlStateManager.depthFunc(GL11.GL_LEQUAL)
+ GlStateManager.disableCull()
+ GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0)
+ GlStateManager.enableAlpha()
+ GlStateManager.disableTexture2D()
+
+ GlStateManager.disableDepth()
+
var il = 0.0
val tessellator = Tessellator.getInstance()
val worldRenderer = tessellator.worldRenderer
@@ -472,6 +485,64 @@ object RenderUtils {
GlStateManager.popMatrix()
il += 0.0006
}
+
+ GlStateManager.enableDepth()
+
+ GlStateManager.enableCull()
+ GlStateManager.enableTexture2D()
+ GlStateManager.enableDepth()
+ GlStateManager.disableBlend()
+ GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f)
+ GlStateManager.popMatrix()
+ }
+ fun drawCylinderInWorld(color: Color,x: Double, y: Double, z: Double, radius: Float, height: Float, partialTicks: Float) {
+ GlStateManager.pushMatrix()
+ GL11.glNormal3f(0.0f, 1.0f, 0.0f)
+
+ GlStateManager.enableDepth()
+ GlStateManager.enableBlend()
+ GlStateManager.depthFunc(GL11.GL_LEQUAL)
+ GlStateManager.disableCull()
+ GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0)
+ GlStateManager.enableAlpha()
+ GlStateManager.disableTexture2D()
+ color.bindColor()
+
+ var x1 = x
+ var y1 = y
+ var z1 = z
+ val renderViewEntity = Minecraft.getMinecraft().renderViewEntity
+ val viewX =
+ renderViewEntity.prevPosX + (renderViewEntity.posX - renderViewEntity.prevPosX) * partialTicks.toDouble()
+ val viewY =
+ renderViewEntity.prevPosY + (renderViewEntity.posY - renderViewEntity.prevPosY) * partialTicks.toDouble()
+ val viewZ =
+ renderViewEntity.prevPosZ + (renderViewEntity.posZ - renderViewEntity.prevPosZ) * partialTicks.toDouble()
+ x1 -= viewX
+ y1 -= viewY
+ z1 -= viewZ
+ val tessellator = Tessellator.getInstance()
+ val worldrenderer = tessellator.worldRenderer
+ worldrenderer.begin(GL11.GL_QUAD_STRIP, DefaultVertexFormats.POSITION)
+ var currentAngle = 0f
+ val angleStep = 0.1f
+ while (currentAngle < 2 * Math.PI) {
+ val xOffset = radius * cos(currentAngle.toDouble()).toFloat()
+ val zOffset = radius * sin(currentAngle.toDouble()).toFloat()
+ worldrenderer.pos(x1 + xOffset, y1 + height, z1 + zOffset).endVertex()
+ worldrenderer.pos(x1 + xOffset, y1 + 0, z1 + zOffset).endVertex()
+ currentAngle += angleStep
+ }
+ worldrenderer.pos(x1 + radius, y1 + height, z1).endVertex()
+ worldrenderer.pos(x1 + radius, y1 + 0.0, z1).endVertex()
+ tessellator.draw()
+
+ GlStateManager.enableCull()
+ GlStateManager.enableTexture2D()
+ GlStateManager.enableDepth()
+ GlStateManager.disableBlend()
+ GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f)
+ GlStateManager.popMatrix()
}
private fun Color.bindColor() = GlStateManager.color(this.red / 255f, this.green / 255f, this.blue / 255f, this.alpha / 255f)