diff options
32 files changed, 200 insertions, 255 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/markedplayer/MarkedPlayerConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/markedplayer/MarkedPlayerConfig.java index 4b665d6a7..f5469a2be 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/markedplayer/MarkedPlayerConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/markedplayer/MarkedPlayerConfig.java @@ -32,6 +32,6 @@ public class MarkedPlayerConfig { @ConfigOption(name = "Marked Entity Color", desc = "The color of the marked player in the world. §cDoes not yet support chroma.") @Expose @ConfigEditorDropdown - public LorenzColor entityColor = LorenzColor.YELLOW; + public Property<LorenzColor> entityColor = Property.of(LorenzColor.YELLOW); } diff --git a/src/main/java/at/hannibal2/skyhanni/events/RenderMobColoredEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/RenderMobColoredEvent.kt deleted file mode 100644 index cfcdfb37b..000000000 --- a/src/main/java/at/hannibal2/skyhanni/events/RenderMobColoredEvent.kt +++ /dev/null @@ -1,6 +0,0 @@ -package at.hannibal2.skyhanni.events - -import net.minecraft.entity.EntityLivingBase - -// TODO remove -class RenderMobColoredEvent(val entity: EntityLivingBase, var color: Int) : LorenzEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/ResetEntityHurtEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/ResetEntityHurtEvent.kt deleted file mode 100644 index 7768e6586..000000000 --- a/src/main/java/at/hannibal2/skyhanni/events/ResetEntityHurtEvent.kt +++ /dev/null @@ -1,9 +0,0 @@ -package at.hannibal2.skyhanni.events - -import net.minecraft.entity.EntityLivingBase -import java.awt.Color - -// TODO remove -class ResetEntityHurtEvent(val entity: EntityLivingBase, var shouldReset: Boolean) : LorenzEvent() - -fun Color.withAlpha(alpha: Int): Int = (alpha.coerceIn(0, 255) shl 24) or (this.rgb and 0x00ffffff) diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/AreaMiniBossFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/AreaMiniBossFeatures.kt index 977b38259..06802413a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/AreaMiniBossFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/AreaMiniBossFeatures.kt @@ -5,8 +5,8 @@ import at.hannibal2.skyhanni.data.SlayerAPI import at.hannibal2.skyhanni.events.EntityMaxHealthUpdateEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent -import at.hannibal2.skyhanni.events.withAlpha import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper +import at.hannibal2.skyhanni.utils.ColorUtils.withAlpha import at.hannibal2.skyhanni.utils.EntityUtils.hasMaxHealth import at.hannibal2.skyhanni.utils.LocationUtils import at.hannibal2.skyhanni.utils.LorenzColor @@ -52,9 +52,8 @@ class AreaMiniBossFeatures { if (config.areaBossHighlight) { val color = bossType.color.toColor().withAlpha(bossType.colorOpacity) - RenderLivingEntityHelper.setEntityColor(entity, color) + RenderLivingEntityHelper.setEntityColorWithNoHurtTime(entity, color) { config.areaBossHighlight && SlayerAPI.isInAnyArea } - RenderLivingEntityHelper.setNoHurtTime(entity) { config.areaBossHighlight && SlayerAPI.isInAnyArea } } // TODO add sound diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/MobHighlight.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/MobHighlight.kt index d7ecc8f52..f10d4ef2c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/MobHighlight.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/MobHighlight.kt @@ -3,8 +3,8 @@ package at.hannibal2.skyhanni.features.combat.mobs import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.EntityHealthUpdateEvent import at.hannibal2.skyhanni.events.EntityMaxHealthUpdateEvent -import at.hannibal2.skyhanni.events.withAlpha import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper +import at.hannibal2.skyhanni.utils.ColorUtils.withAlpha import at.hannibal2.skyhanni.utils.EntityUtils.hasNameTagWith import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzUtils @@ -28,9 +28,11 @@ class MobHighlight { val entity = event.entity val baseMaxHealth = entity.baseMaxHealth if (config.corruptedMobHighlight && event.health == baseMaxHealth * 3) { - RenderLivingEntityHelper.setEntityColor(entity, LorenzColor.DARK_PURPLE.toColor().withAlpha(127)) + RenderLivingEntityHelper.setEntityColorWithNoHurtTime( + entity, + LorenzColor.DARK_PURPLE.toColor().withAlpha(127) + ) { config.corruptedMobHighlight } - RenderLivingEntityHelper.setNoHurtTime(entity) { config.corruptedMobHighlight } } } @@ -41,15 +43,19 @@ class MobHighlight { val entity = event.entity val maxHealth = event.maxHealth if (config.arachneKeeperHighlight && (maxHealth == 3_000 || maxHealth == 12_000) && entity is EntityCaveSpider) { - RenderLivingEntityHelper.setEntityColor(entity, LorenzColor.DARK_BLUE.toColor().withAlpha(127)) + RenderLivingEntityHelper.setEntityColorWithNoHurtTime( + entity, + LorenzColor.DARK_BLUE.toColor().withAlpha(127) + ) { config.arachneKeeperHighlight } - RenderLivingEntityHelper.setNoHurtTime(entity) { config.arachneKeeperHighlight } } if (config.corleoneHighlighter && maxHealth == 1_000_000 && entity is EntityOtherPlayerMP && entity.name == "Team Treasurite") { - RenderLivingEntityHelper.setEntityColor(entity, LorenzColor.DARK_PURPLE.toColor().withAlpha(127)) + RenderLivingEntityHelper.setEntityColorWithNoHurtTime( + entity, + LorenzColor.DARK_PURPLE.toColor().withAlpha(127) + ) { config.corleoneHighlighter } - RenderLivingEntityHelper.setNoHurtTime(entity) { config.corleoneHighlighter } } if (entity is EntityEnderman) { @@ -57,17 +63,21 @@ class MobHighlight { val isZealot = maxHealth == 13_000 || maxHealth == 13_000 * 4 // runic val isBruiser = maxHealth == 65_000 || maxHealth == 65_000 * 4 // runic if (isZealot || isBruiser) { - RenderLivingEntityHelper.setEntityColor(entity, LorenzColor.DARK_AQUA.toColor().withAlpha(127)) + RenderLivingEntityHelper.setEntityColorWithNoHurtTime( + entity, + LorenzColor.DARK_AQUA.toColor().withAlpha(127) + ) { config.zealotBruiserHighlighter } - RenderLivingEntityHelper.setNoHurtTime(entity) { config.zealotBruiserHighlighter } } } // Special Zealots are not impacted by derpy if (config.specialZealotHighlighter && maxHealth.ignoreDerpy() == 2_000) { - RenderLivingEntityHelper.setEntityColor(entity, LorenzColor.DARK_RED.toColor().withAlpha(50)) + RenderLivingEntityHelper.setEntityColorWithNoHurtTime( + entity, + LorenzColor.DARK_RED.toColor().withAlpha(50) + ) { config.specialZealotHighlighter } - RenderLivingEntityHelper.setNoHurtTime(entity) { config.specialZealotHighlighter } } } @@ -91,14 +101,12 @@ class MobHighlight { } private fun markArachneMinis(entity: EntityLivingBase) { - RenderLivingEntityHelper.setEntityColor(entity, LorenzColor.GOLD.toColor().withAlpha(50)) + RenderLivingEntityHelper.setEntityColorWithNoHurtTime(entity, LorenzColor.GOLD.toColor().withAlpha(50)) { config.arachneBossHighlighter } - RenderLivingEntityHelper.setNoHurtTime(entity) { config.arachneBossHighlighter } } private fun markArachne(entity: EntityLivingBase) { - RenderLivingEntityHelper.setEntityColor(entity, LorenzColor.RED.toColor().withAlpha(50)) + RenderLivingEntityHelper.setEntityColorWithNoHurtTime(entity, LorenzColor.RED.toColor().withAlpha(50)) { config.arachneBossHighlighter } - RenderLivingEntityHelper.setNoHurtTime(entity) { config.arachneBossHighlighter } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt index e654fc4a9..d845edbbf 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt @@ -7,14 +7,14 @@ import at.hannibal2.skyhanni.events.CheckRenderEntityEvent import at.hannibal2.skyhanni.events.EntityMoveEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.events.ReceiveParticleEvent -import at.hannibal2.skyhanni.events.RenderMobColoredEvent -import at.hannibal2.skyhanni.events.ResetEntityHurtEvent -import at.hannibal2.skyhanni.events.withAlpha +import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper +import at.hannibal2.skyhanni.utils.ColorUtils.withAlpha import at.hannibal2.skyhanni.utils.ItemUtils.cleanName import at.hannibal2.skyhanni.utils.ItemUtils.getSkullTexture import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.getLorenzVec +import net.minecraft.entity.Entity import net.minecraft.entity.item.EntityArmorStand import net.minecraft.entity.item.EntityItem import net.minecraft.util.EnumParticleTypes @@ -193,34 +193,15 @@ class DungeonHideItems { if (isSkeletonSkull(entity)) { movingSkeletonSkulls[entity] = System.currentTimeMillis() - } - } - - @SubscribeEvent - fun onRenderMobColored(event: RenderMobColoredEvent) { - if (!LorenzUtils.inDungeons) return - if (!SkyHanniMod.feature.dungeon.highlightSkeletonSkull) return - val entity = event.entity - if (entity is EntityArmorStand && isSkeletonSkull(entity)) { - val lastMove = movingSkeletonSkulls.getOrDefault(entity, 0) - if (lastMove + 200 > System.currentTimeMillis()) { - event.color = LorenzColor.GOLD.toColor().withAlpha(60) + RenderLivingEntityHelper.setEntityColorWithNoHurtTime(entity, LorenzColor.GOLD.toColor().withAlpha(60)) + { + shouldColorMovingSkull(entity) } } } - @SubscribeEvent - fun onResetEntityHurtTime(event: ResetEntityHurtEvent) { - if (!LorenzUtils.inDungeons) return - if (!SkyHanniMod.feature.dungeon.highlightSkeletonSkull) return - val entity = event.entity - if (entity is EntityArmorStand && isSkeletonSkull(entity)) { - val lastMove = movingSkeletonSkulls.getOrDefault(entity, 0) - if (lastMove + 200 > System.currentTimeMillis()) { - event.shouldReset = true - } - } - } + private fun shouldColorMovingSkull(entity: Entity) = + SkyHanniMod.feature.dungeon.highlightSkeletonSkull && movingSkeletonSkulls[entity]?.let { it + 200 > System.currentTimeMillis() } ?: false @SubscribeEvent fun onWorldChange(event: LorenzWorldChangeEvent) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLividFinder.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLividFinder.kt index 291b7775b..7d2f9410f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLividFinder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLividFinder.kt @@ -5,10 +5,10 @@ import at.hannibal2.skyhanni.events.CheckRenderEntityEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent -import at.hannibal2.skyhanni.events.withAlpha import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled import at.hannibal2.skyhanni.utils.BlockUtils.getBlockStateAt +import at.hannibal2.skyhanni.utils.ColorUtils.withAlpha import at.hannibal2.skyhanni.utils.EntityUtils import at.hannibal2.skyhanni.utils.LocationUtils.distanceSqToPlayer import at.hannibal2.skyhanni.utils.LorenzColor @@ -77,8 +77,10 @@ object DungeonLividFinder { if (!newLivid.name.contains("Livid")) return lividEntity = newLivid - RenderLivingEntityHelper.setEntityColor(newLivid, color.toColor().withAlpha(30)) { shouldHighlight() } - RenderLivingEntityHelper.setNoHurtTime(newLivid) { shouldHighlight() } + RenderLivingEntityHelper.setEntityColorWithNoHurtTime( + newLivid, + color.toColor().withAlpha(30) + ) { shouldHighlight() } } private fun shouldHighlight() = getLividAlive() != null && config.enabled diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/HighlightDungeonDeathmite.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/HighlightDungeonDeathmite.kt index c7d8293af..73ac51d21 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/HighlightDungeonDeathmite.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/HighlightDungeonDeathmite.kt @@ -2,8 +2,8 @@ package at.hannibal2.skyhanni.features.dungeon import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.EntityMaxHealthUpdateEvent -import at.hannibal2.skyhanni.events.withAlpha import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper +import at.hannibal2.skyhanni.utils.ColorUtils.withAlpha import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzUtils import net.minecraft.entity.monster.EntitySilverfish @@ -20,9 +20,8 @@ class HighlightDungeonDeathmite { val maxHealth = event.maxHealth if (entity is EntitySilverfish && maxHealth == 1_000_000_000) { - RenderLivingEntityHelper.setEntityColor(entity, LorenzColor.DARK_RED.toColor().withAlpha(20)) + RenderLivingEntityHelper.setEntityColorWithNoHurtTime(entity, LorenzColor.DARK_RED.toColor().withAlpha(20)) { SkyHanniMod.feature.dungeon.highlightDeathmites } - RenderLivingEntityHelper.setNoHurtTime(entity) { SkyHanniMod.feature.dungeon.highlightDeathmites } } } -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/UniqueGiftingOpportunitiesFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/event/UniqueGiftingOpportunitiesFeatures.kt index 2442027e2..904391bab 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/UniqueGiftingOpportunitiesFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/UniqueGiftingOpportunitiesFeatures.kt @@ -7,9 +7,9 @@ import at.hannibal2.skyhanni.events.EntityCustomNameUpdateEvent import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent -import at.hannibal2.skyhanni.events.RenderMobColoredEvent -import at.hannibal2.skyhanni.events.withAlpha import at.hannibal2.skyhanni.features.event.winter.UniqueGiftCounter +import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper +import at.hannibal2.skyhanni.utils.ColorUtils.withAlpha import at.hannibal2.skyhanni.utils.EntityUtils import at.hannibal2.skyhanni.utils.EntityUtils.isNPC import at.hannibal2.skyhanni.utils.InventoryUtils @@ -19,7 +19,7 @@ import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.matches import at.hannibal2.skyhanni.utils.getLorenzVec import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern -import net.minecraft.client.entity.EntityPlayerSP +import net.minecraft.client.entity.EntityOtherPlayerMP import net.minecraft.entity.EntityLivingBase import net.minecraft.entity.item.EntityArmorStand import net.minecraft.entity.player.EntityPlayer @@ -73,19 +73,20 @@ object UniqueGiftingOpportunitiesFeatures { @SubscribeEvent fun onEntityJoinWorldEvent(event: EntityJoinWorldEvent) { + playerColor(event) val entity = event.entity as? EntityArmorStand ?: return analyzeArmorStand(entity) } - @SubscribeEvent - fun onRenderMobColored(event: RenderMobColoredEvent) { - if (!isEnabled()) return - val entity = event.entity - if (entity is EntityPlayerSP) return - if (entity is EntityPlayer && !entity.isNPC() && !isIronman(entity) && !isBingo(entity) && - !hasGiftedPlayer(entity) - ) { - event.color = LorenzColor.DARK_GREEN.toColor().withAlpha(127) + private fun playerColor(event: EntityJoinWorldEvent) { + if (event.entity is EntityOtherPlayerMP) { + val entity = event.entity as EntityOtherPlayerMP + if (entity.isNPC() || isIronman(entity) || isBingo(entity)) return + + RenderLivingEntityHelper.setEntityColor( + entity, + LorenzColor.DARK_GREEN.toColor().withAlpha(127) + ) { isEnabled() && !hasGiftedPlayer(entity) } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/HighlightInquisitors.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/HighlightInquisitors.kt index 2b7e33e66..8ee9a1756 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/HighlightInquisitors.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/HighlightInquisitors.kt @@ -1,8 +1,8 @@ package at.hannibal2.skyhanni.features.event.diana import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.withAlpha import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper +import at.hannibal2.skyhanni.utils.ColorUtils.withAlpha import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzUtils import net.minecraft.entity.player.EntityPlayer @@ -22,8 +22,7 @@ class HighlightInquisitors { if (entity is EntityPlayer && entity.name == "Minos Inquisitor") { val color = LorenzColor.AQUA.toColor().withAlpha(127) - RenderLivingEntityHelper.setEntityColor(entity, color) { config.highlightInquisitors } - RenderLivingEntityHelper.setNoHurtTime(entity) { config.highlightInquisitors } + RenderLivingEntityHelper.setEntityColorWithNoHurtTime(entity, color) { config.highlightInquisitors } } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/jerry/HighlightJerries.kt b/src/main/java/at/hannibal2/skyhanni/features/event/jerry/HighlightJerries.kt index 4bc5225b9..bcf3ac58a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/jerry/HighlightJerries.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/jerry/HighlightJerries.kt @@ -2,8 +2,8 @@ package at.hannibal2.skyhanni.features.event.jerry import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.EntityMaxHealthUpdateEvent -import at.hannibal2.skyhanni.events.withAlpha import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper +import at.hannibal2.skyhanni.utils.ColorUtils.withAlpha import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzUtils import net.minecraft.entity.passive.EntityVillager @@ -35,7 +35,7 @@ class HighlightJerries { if (entity is EntityVillager && maxHealth in 3..6) { val color = listOfLorenzColors[maxHealth].toColor().withAlpha(20) - RenderLivingEntityHelper.setEntityColor(entity, color) { config.highlightJerries } + RenderLivingEntityHelper.setEntityColorWithNoHurtTime(entity, color) { config.highlightJerries } } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureFeatures.kt index 325411045..381ca097a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureFeatures.kt @@ -6,10 +6,10 @@ import at.hannibal2.skyhanni.events.EntityMaxHealthUpdateEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.events.RenderEntityOutlineEvent import at.hannibal2.skyhanni.events.SeaCreatureFishEvent -import at.hannibal2.skyhanni.events.withAlpha import at.hannibal2.skyhanni.features.combat.damageindicator.DamageIndicatorManager import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper import at.hannibal2.skyhanni.utils.CollectionUtils.editCopy +import at.hannibal2.skyhanni.utils.ColorUtils.withAlpha import at.hannibal2.skyhanni.utils.EntityUtils.hasMaxHealth import at.hannibal2.skyhanni.utils.EntityUtils.hasNameTagWith import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayer @@ -50,9 +50,8 @@ class SeaCreatureFeatures { if (!entity.hasNameTagWith(3, creatureType.nametag)) continue rareSeaCreatures = rareSeaCreatures.editCopy { add(entity) } - RenderLivingEntityHelper.setEntityColor(entity, LorenzColor.RED.toColor().withAlpha(50)) + RenderLivingEntityHelper.setEntityColorWithNoHurtTime(entity, LorenzColor.RED.toColor().withAlpha(50)) { config.highlight } - RenderLivingEntityHelper.setNoHurtTime(entity) { config.highlight } // Water hydra splitting in two if (creatureType == RareSeaCreatureType.WATER_HYDRA && entity.health == (entity.baseMaxHealth.toFloat() / 2)) continue diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/HighlightVisitorsOutsideOfGarden.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/HighlightVisitorsOutsideOfGarden.kt index f381723cf..582f0b359 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/HighlightVisitorsOutsideOfGarden.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/HighlightVisitorsOutsideOfGarden.kt @@ -5,10 +5,10 @@ import at.hannibal2.skyhanni.data.jsonobjects.repo.GardenJson import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.PacketEvent import at.hannibal2.skyhanni.events.RepositoryReloadEvent -import at.hannibal2.skyhanni.events.withAlpha import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper import at.hannibal2.skyhanni.utils.ChatUtils +import at.hannibal2.skyhanni.utils.ColorUtils.withAlpha import at.hannibal2.skyhanni.utils.EntityUtils import at.hannibal2.skyhanni.utils.EntityUtils.getSkinTexture import at.hannibal2.skyhanni.utils.LorenzColor diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorAPI.kt index 3dddd3585..cedbe8839 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorAPI.kt @@ -4,11 +4,11 @@ import at.hannibal2.skyhanni.events.garden.visitor.VisitorAcceptedEvent import at.hannibal2.skyhanni.events.garden.visitor.VisitorArrivalEvent import at.hannibal2.skyhanni.events.garden.visitor.VisitorLeftEvent import at.hannibal2.skyhanni.events.garden.visitor.VisitorRefusedEvent -import at.hannibal2.skyhanni.events.withAlpha import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.CollectionUtils.editCopy +import at.hannibal2.skyhanni.utils.ColorUtils.withAlpha import at.hannibal2.skyhanni.utils.EntityUtils import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzLogger diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt index 3317cbff3..c5c73949d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt @@ -6,8 +6,8 @@ import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.EntityMaxHealthUpdateEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.TabListUpdateEvent -import at.hannibal2.skyhanni.events.withAlpha import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper +import at.hannibal2.skyhanni.utils.ColorUtils.withAlpha import at.hannibal2.skyhanni.utils.EntityUtils import at.hannibal2.skyhanni.utils.EntityUtils.hasMaxHealth import at.hannibal2.skyhanni.utils.LorenzColor @@ -54,7 +54,10 @@ class HighlightMiningCommissionMobs { val entities = EntityUtils.getEntities<EntityLivingBase>() for ((type, entity) in active.flatMap { type -> entities.map { type to it } }) { if (type.isMob(entity)) { - RenderLivingEntityHelper.setEntityColor(entity, LorenzColor.YELLOW.toColor().withAlpha(127)) + RenderLivingEntityHelper.setEntityColorWithNoHurtTime( + entity, + LorenzColor.YELLOW.toColor().withAlpha(127) + ) { isEnabled() && type in active } } } @@ -82,7 +85,10 @@ class HighlightMiningCommissionMobs { val entity = event.entity for (type in active) { if (type.isMob(entity)) { - RenderLivingEntityHelper.setEntityColor(entity, LorenzColor.YELLOW.toColor().withAlpha(127)) |
