From d936dd962a7532ab2e075391a5aadf655437282a Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 24 Dec 2023 15:32:10 +0100 Subject: Make Unique Gift Counter and Unique Gifting Opportunities highlight only active during december. --- .../skyhanni/features/event/UniqueGiftingOpportunitiesFeatures.kt | 8 ++++++-- .../hannibal2/skyhanni/features/event/winter/UniqueGiftCounter.kt | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/event') 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 d3b75780c..a873854b5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/UniqueGiftingOpportunitiesFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/UniqueGiftingOpportunitiesFeatures.kt @@ -3,6 +3,7 @@ package at.hannibal2.skyhanni.features.event import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.HypixelData import at.hannibal2.skyhanni.data.ProfileStorageData +import at.hannibal2.skyhanni.data.WinterAPI import at.hannibal2.skyhanni.events.EntityCustomNameUpdateEvent import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.RenderMobColoredEvent @@ -36,7 +37,7 @@ object UniqueGiftingOpportunitiesFeatures { private val config get() = SkyHanniMod.feature.event.winter.giftingOpportunities - private fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled && + private fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled && WinterAPI.isDecember() && (InventoryUtils.itemInHandId.endsWith("_GIFT") || !config.highlighWithGiftOnly) @@ -70,8 +71,11 @@ object UniqueGiftingOpportunitiesFeatures { if (!isEnabled()) return val entity = event.entity if (entity is EntityPlayerSP) return - if (entity is EntityPlayer && !entity.isNPC() && !isIronman(entity) && !isBingo(entity) && !hasGiftedPlayer(entity)) + if (entity is EntityPlayer && !entity.isNPC() && !isIronman(entity) && !isBingo(entity) && + !hasGiftedPlayer(entity) + ) { event.color = LorenzColor.DARK_GREEN.toColor().withAlpha(127) + } } private fun isBingo(entity: EntityLivingBase) = diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/winter/UniqueGiftCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/event/winter/UniqueGiftCounter.kt index 10b52745a..a039bd339 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/winter/UniqueGiftCounter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/winter/UniqueGiftCounter.kt @@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.features.event.winter import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.ProfileStorageData +import at.hannibal2.skyhanni.data.WinterAPI import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.events.IslandChangeEvent @@ -70,5 +71,6 @@ object UniqueGiftCounter { ) } - private fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled && InventoryUtils.itemInHandId.endsWith("_GIFT") + private fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled && WinterAPI.isDecember() && + InventoryUtils.itemInHandId.endsWith("_GIFT") } -- cgit