aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Abilities.java21
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/FireVeilWandParticles.kt50
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/EndermanSlayerBeacon.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt32
4 files changed, 96 insertions, 10 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Abilities.java b/src/main/java/at/hannibal2/skyhanni/config/features/Abilities.java
index 4e93679d4..4ba58da70 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/Abilities.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/Abilities.java
@@ -52,7 +52,22 @@ public class Abilities {
public boolean summoningMobColored = false;
@Expose
- @ConfigOption(name = "Fire Veil Particles", desc = "Hiding the flame particles when using the Fire Veil Wand ability.")
- @ConfigEditorBoolean
- public boolean fireVeilWandHider = false;
+ @ConfigOption(name = "Fire Veil", desc = "")
+ @ConfigEditorAccordion(id = 1)
+ public boolean fireVeilWand = false;
+
+ @Expose
+ @ConfigOption(name = "Fire Veil Design", desc = "Changes the flame particles of the Fire Veil Wand ability")
+ @ConfigEditorDropdown(values = {"Particles", "Line", "Off"})
+ @ConfigAccordionId(id = 1)
+ public int fireVeilWandDisplay = 0;
+
+ @Expose
+ @ConfigOption(
+ name = "Line Color",
+ desc = "Changes the color of the Fire Veil Wand line"
+ )
+ @ConfigEditorColour
+ @ConfigAccordionId(id = 1)
+ public String fireVeilWandDisplayColor = "0:245:255:85:85";
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/FireVeilWandParticles.kt b/src/main/java/at/hannibal2/skyhanni/features/FireVeilWandParticles.kt
index 1205c202b..ff4c80d69 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/FireVeilWandParticles.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/FireVeilWandParticles.kt
@@ -5,9 +5,16 @@ import at.hannibal2.skyhanni.events.ItemClickInHandEvent
import at.hannibal2.skyhanni.events.PacketEvent
import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName
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 {
@@ -15,12 +22,13 @@ class FireVeilWandParticles {
@SubscribeEvent
fun onChatPacket(event: PacketEvent.ReceiveEvent) {
- if (!isEnabled()) return
+ if (!LorenzUtils.inSkyblock) return
+ if (SkyHanniMod.feature.abilities.fireVeilWandDisplay == 0) return
+ if (System.currentTimeMillis() > lastClick + 5_500) return
val packet = event.packet
if (packet !is S2APacketParticles) return
- if (System.currentTimeMillis() > lastClick + 5_500) return
if (packet.particleType == EnumParticleTypes.FLAME && packet.particleCount == 1 && packet.particleSpeed == 0f &&
packet.xOffset == 0f &&
@@ -33,7 +41,7 @@ class FireVeilWandParticles {
@SubscribeEvent
fun onItemClick(event: ItemClickInHandEvent) {
- if (!isEnabled()) return
+ if (!LorenzUtils.inSkyblock) return
if (event.clickType != ItemClickInHandEvent.ClickType.RIGHT_CLICK) return
val itemInHand = event.itemInHand ?: return
@@ -44,7 +52,39 @@ class FireVeilWandParticles {
}
}
- private fun isEnabled(): Boolean {
- return LorenzUtils.inSkyblock && SkyHanniMod.feature.abilities.fireVeilWandHider
+ @SubscribeEvent
+ fun onRenderWorld(event: RenderWorldLastEvent) {
+ if (!LorenzUtils.inSkyblock) return
+ if (SkyHanniMod.feature.abilities.fireVeilWandDisplay != 1) return
+ if (System.currentTimeMillis() > lastClick + 5_500) return
+
+ 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()
}
} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/EndermanSlayerBeacon.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/EndermanSlayerBeacon.kt
index f2cf90190..15b497936 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/slayer/EndermanSlayerBeacon.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/EndermanSlayerBeacon.kt
@@ -7,7 +7,6 @@ import at.hannibal2.skyhanni.events.RenderMobColoredEvent
import at.hannibal2.skyhanni.events.withAlpha
import at.hannibal2.skyhanni.features.damageindicator.BossType
import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager
-import at.hannibal2.skyhanni.test.LorenzTest
import at.hannibal2.skyhanni.utils.*
import at.hannibal2.skyhanni.utils.ItemUtils.name
import at.hannibal2.skyhanni.utils.RenderUtils.drawColor
@@ -76,7 +75,7 @@ class EndermanSlayerBeacon {
if (!isEnabled()) return
if (event.entity in armorStands) {
- event.color = LorenzColor.DARK_RED.toColor().withAlpha(LorenzTest.a.toInt())
+ event.color = LorenzColor.DARK_RED.toColor().withAlpha(1)
}
}
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