diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-24 15:32:10 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-24 15:32:10 +0100 |
commit | d936dd962a7532ab2e075391a5aadf655437282a (patch) | |
tree | a441e557b4ded8de27216f44cdccc7a192df399d /src/main/java/at/hannibal2/skyhanni/features | |
parent | 95f2bf658557498058c5bfec56a17f8942ac318d (diff) | |
download | skyhanni-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')
3 files changed, 11 insertions, 6 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") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/TimeFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/TimeFeatures.kt index 021dd0ef6..797ae5c93 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/TimeFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/TimeFeatures.kt @@ -3,18 +3,17 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.IslandType +import at.hannibal2.skyhanni.data.WinterAPI import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland import at.hannibal2.skyhanni.utils.RecalculatingValue import at.hannibal2.skyhanni.utils.RenderUtils.renderString import at.hannibal2.skyhanni.utils.SimpleTimeMark.Companion.asTimeMark -import at.hannibal2.skyhanni.utils.TimeUtils import at.hannibal2.skyhanni.utils.TimeUtils.format import io.github.moulberry.notenoughupdates.util.SkyBlockTime import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.text.SimpleDateFormat -import java.time.Month import kotlin.time.Duration.Companion.days import kotlin.time.Duration.Companion.seconds @@ -40,7 +39,7 @@ class TimeFeatures { } if (winterConfig.islandCloseTime && IslandType.WINTER.isInIsland()) { - if (TimeUtils.getCurrentLocalDate().month == Month.DECEMBER) return + if (WinterAPI.isDecember()) return val timeTillNextYear = startOfNextYear.getValue().timeUntil() val alreadyInNextYear = timeTillNextYear > 5.days val text = if (alreadyInNextYear) { |