diff options
author | Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> | 2024-06-08 20:53:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-08 20:53:23 +0200 |
commit | d5667f8915e2a48b11f165a48a5c0b1acace92ff (patch) | |
tree | 7a72e331b0e115f86e024fe676f36ea4187c55a4 /src/main | |
parent | 5c65321bfcee1f55e7e1207b9a551bb73dc3e375 (diff) | |
download | skyhanni-d5667f8915e2a48b11f165a48a5c0b1acace92ff.tar.gz skyhanni-d5667f8915e2a48b11f165a48a5c0b1acace92ff.tar.bz2 skyhanni-d5667f8915e2a48b11f165a48a5c0b1acace92ff.zip |
Fix: FF cake time (#2034)
Diffstat (limited to 'src/main')
4 files changed, 11 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/storage/ProfileSpecificStorage.java b/src/main/java/at/hannibal2/skyhanni/config/storage/ProfileSpecificStorage.java index 00ce6c39c..bc25da446 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/storage/ProfileSpecificStorage.java +++ b/src/main/java/at/hannibal2/skyhanni/config/storage/ProfileSpecificStorage.java @@ -37,6 +37,7 @@ import at.hannibal2.skyhanni.features.skillprogress.SkillType; import at.hannibal2.skyhanni.features.slayer.SlayerProfitTracker; import at.hannibal2.skyhanni.utils.LorenzVec; import at.hannibal2.skyhanni.utils.NEUInternalName; +import at.hannibal2.skyhanni.utils.SimpleTimeMark; import com.google.gson.annotations.Expose; import net.minecraft.item.ItemStack; import org.jetbrains.annotations.Nullable; @@ -377,7 +378,7 @@ public class ProfileSpecificStorage { public int plotsUnlocked = -1; @Expose - public long cakeExpiring = -1L; + public SimpleTimeMark cakeExpiring = null; @Expose public Map<CropType, Boolean> carrolyn = new HashMap<>(); diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt index fbb22e322..80f77f850 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt @@ -24,6 +24,7 @@ import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimal import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNecessary import at.hannibal2.skyhanni.utils.RegexUtils.matchFirst import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher +import at.hannibal2.skyhanni.utils.SimpleTimeMark.Companion.fromNow import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getEnchantments import at.hannibal2.skyhanni.utils.StringUtils.removeColor import at.hannibal2.skyhanni.utils.TabListData @@ -337,7 +338,7 @@ object CaptureFarmingGear { return } cakePattern.matchMatcher(msg) { - storage.cakeExpiring = System.currentTimeMillis() + 2.days.inWholeMilliseconds + FFStats.cakeExpireTime = 2.days.fromNow() return } CarrolynTable.entries.forEach { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFStats.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFStats.kt index 772177c82..a8b79ad70 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFStats.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFStats.kt @@ -23,7 +23,11 @@ object FFStats { private val farmingBoots = arrayListOf("RANCHERS_BOOTS", "FARMER_BOOTS") - var cakeExpireTime = SimpleTimeMark.farPast() + var cakeExpireTime + get() = GardenAPI.storage?.fortune?.cakeExpiring ?: SimpleTimeMark.farPast() + set(value) { + GardenAPI.storage?.fortune?.cakeExpiring = value + } var equipmentTotalFF = mapOf<FFTypes, Double>() @@ -37,9 +41,6 @@ object FFStats { var totalBaseFF = mapOf<FFTypes, Double>() fun loadFFData() { - cakeExpireTime = SimpleTimeMark(GardenAPI.storage?.fortune?.cakeExpiring ?: -1L) - - FarmingItems.resetFFData() equipmentTotalFF = FarmingItems.equip.getFFData() @@ -149,7 +150,7 @@ object FFStats { this[FFTypes.COMMUNITY_SHOP] = (ProfileStorageData.playerSpecific?.gardenCommunityUpgrade ?: -1).toDouble() * 4 this[FFTypes.PLOTS] = storage.plotsUnlocked.toDouble() * 3 this[FFTypes.ANITA] = storage.anitaUpgrade.toDouble() * 4 - if (cakeExpireTime.isInPast() || cakeExpireTime.isFarPast()) { + if (cakeExpireTime.isInFuture() || cakeExpireTime.isFarPast()) { this[FFTypes.CAKE] = 5.0 } else { this[FFTypes.CAKE] = 0.0 diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/OverviewPage.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/OverviewPage.kt index 577020cfb..6eead6399 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/OverviewPage.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/OverviewPage.kt @@ -26,7 +26,7 @@ class OverviewPage(sizeX: Int, sizeY: Int, paddingX: Int = 15, paddingY: Int = 7 fun getPage(): Pair<List<List<Renderable>>, List<Renderable>> { val content = mutableListOf<MutableList<Renderable>>() val footer = mutableListOf<Renderable>() - val timeUntilCakes = FFStats.cakeExpireTime.passedSince().format(TimeUnit.HOUR, false, false, -1) + val timeUntilCakes = FFStats.cakeExpireTime.timeUntil().format(TimeUnit.HOUR, maxUnits = 1) content.addTable( 0, |