aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/rift
diff options
context:
space:
mode:
authorHiZe_ <superhize@hotmail.com>2023-07-11 00:44:26 +0200
committerGitHub <noreply@github.com>2023-07-11 00:44:26 +0200
commit3ef7fc57adcfb0a4692034f4d7075110f5719ce0 (patch)
treed9d6d161203686babe0d310f77462acb697677e8 /src/main/java/at/hannibal2/skyhanni/features/rift
parentdf6054cc8923ea93105dc94c683b8b95318a98f4 (diff)
downloadskyhanni-3ef7fc57adcfb0a4692034f4d7075110f5719ce0.tar.gz
skyhanni-3ef7fc57adcfb0a4692034f4d7075110f5719ce0.tar.bz2
skyhanni-3ef7fc57adcfb0a4692034f4d7075110f5719ce0.zip
Merge pull request #304
* blobbercysts highlight * moved to Colosseum area config * fixed import * fixes * added cansee before enabling depth * removed depth
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/rift')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/colosseum/BlobbercystsHighlight.kt55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/colosseum/BlobbercystsHighlight.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/colosseum/BlobbercystsHighlight.kt
new file mode 100644
index 000000000..8c8debba1
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/colosseum/BlobbercystsHighlight.kt
@@ -0,0 +1,55 @@
+package at.hannibal2.skyhanni.features.rift.area.colosseum
+
+import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.events.LorenzTickEvent
+import at.hannibal2.skyhanni.events.withAlpha
+import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI
+import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper
+import at.hannibal2.skyhanni.utils.LocationUtils
+import at.hannibal2.skyhanni.utils.LocationUtils.canSee
+import at.hannibal2.skyhanni.utils.LorenzUtils
+import at.hannibal2.skyhanni.utils.getLorenzVec
+import net.minecraft.client.Minecraft
+import net.minecraft.client.entity.EntityOtherPlayerMP
+import net.minecraft.client.renderer.GlStateManager
+import net.minecraftforge.client.event.RenderLivingEvent
+import net.minecraftforge.event.entity.living.LivingDeathEvent
+import net.minecraftforge.event.world.WorldEvent
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+import java.awt.Color
+
+class BlobbercystsHighlight {
+
+ private val config get() = SkyHanniMod.feature.rift.area.colosseumConfig
+ private val entityList = mutableListOf<EntityOtherPlayerMP>()
+ private val blobberName = "Blobbercyst "
+
+ @SubscribeEvent
+ fun onTick(event: LorenzTickEvent) {
+ if (!isEnabled()) return
+ if (!event.isMod(5)) return
+ Minecraft.getMinecraft().theWorld.loadedEntityList.filterIsInstance<EntityOtherPlayerMP>().forEach {
+ if (it.name == blobberName) {
+ RenderLivingEntityHelper.setEntityColor(it, Color.RED.withAlpha(80)) { isEnabled() }
+ RenderLivingEntityHelper.setNoHurtTime(it) { isEnabled() }
+ entityList.add(it)
+ }
+ }
+ }
+
+ @SubscribeEvent
+ fun onWorldChange(event: WorldEvent.Load) {
+ if (!isEnabled()) return
+ entityList.clear()
+ }
+
+ @SubscribeEvent
+ fun onLivingDeath(event: LivingDeathEvent) {
+ if (!isEnabled()) return
+ if (entityList.contains(event.entity)) {
+ entityList.remove(event.entity)
+ }
+ }
+
+ fun isEnabled() = RiftAPI.inRift() && config.highlightBlobbercysts && LorenzUtils.skyBlockArea == "Colosseum"
+} \ No newline at end of file