summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/event
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-24 15:32:10 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-24 15:32:10 +0100
commitd936dd962a7532ab2e075391a5aadf655437282a (patch)
treea441e557b4ded8de27216f44cdccc7a192df399d /src/main/java/at/hannibal2/skyhanni/features/event
parent95f2bf658557498058c5bfec56a17f8942ac318d (diff)
downloadskyhanni-d936dd962a7532ab2e075391a5aadf655437282a.tar.gz
skyhanni-d936dd962a7532ab2e075391a5aadf655437282a.tar.bz2
skyhanni-d936dd962a7532ab2e075391a5aadf655437282a.zip
Make Unique Gift Counter and Unique Gifting Opportunities highlight only active during december.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/event')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/UniqueGiftingOpportunitiesFeatures.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/winter/UniqueGiftCounter.kt4
2 files changed, 9 insertions, 3 deletions
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")
}