diff options
3 files changed, 69 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt index c16efdb36..7e2408424 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt @@ -63,6 +63,7 @@ import at.hannibal2.skyhanni.features.nether.reputationhelper.CrimsonIsleReputat import at.hannibal2.skyhanni.features.rift.RiftTimer import at.hannibal2.skyhanni.features.rift.ShowMotesNpcSellPrice import at.hannibal2.skyhanni.features.rift.area.RiftLarva +import at.hannibal2.skyhanni.features.rift.area.colosseum.BlobbercystsHighlight import at.hannibal2.skyhanni.features.rift.area.dreadfarm.RiftAgaricusCap import at.hannibal2.skyhanni.features.rift.area.dreadfarm.VoltHighlighter import at.hannibal2.skyhanni.features.rift.area.livingcave.LivingMetalSuitProgress @@ -339,6 +340,7 @@ class SkyHanniMod { loadModule(HighlightMiningCommissionMobs()) loadModule(ShowMotesNpcSellPrice()) loadModule(LivingMetalSuitProgress()) + loadModule(BlobbercystsHighlight()) init() diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java index 702791dc0..175a60c02 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java @@ -469,14 +469,18 @@ public class RiftConfig { } } -// @Expose -// @ConfigOption(name = "Colosseum", desc = "") -// @Accordion -// public ColosseumConfig colosseumConfig = new ColosseumConfig(); -// -// public static class ColosseumConfig { -// -// } + @Expose + @ConfigOption(name = "Colosseum", desc = "") + @Accordion + public ColosseumConfig colosseumConfig = new ColosseumConfig(); + + public static class ColosseumConfig { + + @Expose + @ConfigOption(name = "Highlight Blobbercysts", desc = "Highlight Blobbercysts in Bacte fight.") + @ConfigEditorBoolean + public boolean highlightBlobbercysts = true; + } // @Expose // @ConfigOption(name = "Stillgore Chateau", desc = "") 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 |