diff options
| author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-05 16:09:43 +0100 |
|---|---|---|
| committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-05 16:09:43 +0100 |
| commit | d4b684fb35fb97fdf7a7548555dc8eb0a9dda2a9 (patch) | |
| tree | dedbeb3c0ddc551a03da869208d7ffc47952d91e | |
| parent | 940095657152c8a0323f1c261c1454b8035bea61 (diff) | |
| download | skyhanni-d4b684fb35fb97fdf7a7548555dc8eb0a9dda2a9.tar.gz skyhanni-d4b684fb35fb97fdf7a7548555dc8eb0a9dda2a9.tar.bz2 skyhanni-d4b684fb35fb97fdf7a7548555dc8eb0a9dda2a9.zip | |
no more hidden stuff: renamed "config" and "hidden" to "storage" when working with stuff from ProfileStorageData
28 files changed, 127 insertions, 127 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt index 4a7e6cdcb..cadd9fedc 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt @@ -378,10 +378,10 @@ object Commands { } private fun clearFarmingItems() { - val config = GardenAPI.config?.fortune ?: return + val storage = GardenAPI.storage?.fortune ?: return LorenzUtils.chat("§e[SkyHanni] clearing farming items") - config.farmingItems.clear() - config.outdatedItems.clear() + storage.farmingItems.clear() + storage.outdatedItems.clear() } private fun registerCommand(name: String, description: String, function: (Array<String>) -> Unit) { diff --git a/src/main/java/at/hannibal2/skyhanni/data/CropAccessoryData.kt b/src/main/java/at/hannibal2/skyhanni/data/CropAccessoryData.kt index 021e59b91..79202ffa2 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/CropAccessoryData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/CropAccessoryData.kt @@ -104,9 +104,9 @@ class CropAccessoryData { val pagesLoaded get() = accessoryPage.size var cropAccessory: CropAccessory? - get() = GardenAPI.config?.savedCropAccessory + get() = GardenAPI.storage?.savedCropAccessory private set(accessory) { - GardenAPI.config?.savedCropAccessory = accessory + GardenAPI.storage?.savedCropAccessory = accessory } // Derived partially from NotEnoughUpdates/NotEnoughUpdates, ProfileViewer.Profile#getInventoryInfo diff --git a/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt b/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt index ecbaee591..154c34e5d 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt @@ -44,7 +44,7 @@ object GardenCropMilestones { private var cropMilestoneData: Map<CropType, List<Int>> = emptyMap() - val cropCounter: MutableMap<CropType, Long>? get() = GardenAPI.config?.cropCounter + val cropCounter: MutableMap<CropType, Long>? get() = GardenAPI.storage?.cropCounter // TODO make nullable fun CropType.getCounter() = cropCounter?.get(this) ?: 0 diff --git a/src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt b/src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt index 15a18ca26..1ea0871ee 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt @@ -39,7 +39,7 @@ class GardenCropUpgrades { } companion object { - private val cropUpgrades: MutableMap<CropType, Int>? get() = GardenAPI.config?.cropUpgrades + private val cropUpgrades: MutableMap<CropType, Int>? get() = GardenAPI.storage?.cropUpgrades fun CropType.getUpgradeLevel() = cropUpgrades?.get(this) diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt index 959a303e8..656ac7b9d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt @@ -61,7 +61,7 @@ import kotlin.math.roundToLong object GhostCounter { val config get() = SkyHanniMod.feature.combat.ghostCounter - val hidden get() = ProfileStorageData.profileSpecific?.ghostCounter + val storage get() = ProfileStorageData.profileSpecific?.ghostCounter private var display = emptyList<List<Any>>() var ghostCounterV3File = File("." + File.separator + "config" + File.separator + "ChatTriggers" + File.separator + "modules" + File.separator + "GhostCounterV3" + File.separator + ".persistantData.json") @@ -127,7 +127,7 @@ object GhostCounter { } val avgMagicFind = when (Option.TOTALDROPS.get()) { 0.0 -> "0" - else -> "${((((hidden?.totalMF!! / Option.TOTALDROPS.get()) + Math.ulp(1.0)) * 100) / 100).roundToPrecision(2)}" + else -> "${((((storage?.totalMF!! / Option.TOTALDROPS.get()) + Math.ulp(1.0)) * 100) / 100).roundToPrecision(2)}" } val xpHourFormatting = textFormatting.xpHourFormatting @@ -151,9 +151,9 @@ object GhostCounter { } val bestiaryFormatting = textFormatting.bestiaryFormatting - val currentKill = hidden?.bestiaryCurrentKill?.toInt() ?: 0 - val killNeeded = hidden?.bestiaryKillNeeded?.toInt() ?: 0 - val nextLevel = hidden?.bestiaryNextLevel?.toInt() ?: -1 + val currentKill = storage?.bestiaryCurrentKill?.toInt() ?: 0 + val killNeeded = storage?.bestiaryKillNeeded?.toInt() ?: 0 + val nextLevel = storage?.bestiaryNextLevel?.toInt() ?: -1 val bestiary = if (config.showMax) { when (nextLevel) { 26 -> bestiaryFormatting.maxed.replace("%currentKill%", currentKill.addSeparators()) @@ -283,7 +283,7 @@ object GhostCounter { Option.KILLCOMBO.add(num) Option.SKILLXPGAINED.add(gained * num.roundToLong()) Option.SKILLXPGAINED.add(gained * num.roundToLong(), true) - hidden?.bestiaryCurrentKill = hidden?.bestiaryCurrentKill?.plus(num) ?: num + storage?.bestiaryCurrentKill = storage?.bestiaryCurrentKill?.plus(num) ?: num } lastXp = res } @@ -385,7 +385,7 @@ object GhostCounter { Option.SORROWCOUNT, Option.VOLTACOUNT, Option.PLASMACOUNT, Option.GHOSTLYBOOTS -> { opt.add(1.0) opt.add(1.0, true) - hidden?.totalMF = hidden?.totalMF?.plus(group("mf").substring(4).toDouble()) + storage?.totalMF = storage?.totalMF?.plus(group("mf").substring(4).toDouble()) ?: group("mf").substring(4).toDouble() Option.TOTALDROPS.add(1.0) if (opt == Option.SORROWCOUNT) @@ -424,16 +424,16 @@ object GhostCounter { val currentLevel = group("nextLevel").toInt() when (val nextLevel = if (currentLevel >= 25) 26 else currentLevel + 1) { 26 -> { - hidden?.bestiaryNextLevel = 26.0 - hidden?.bestiaryCurrentKill = 250_000.0 - hidden?.bestiaryKillNeeded = 0.0 + storage?.bestiaryNextLevel = 26.0 + storage?.bestiaryCurrentKill = 250_000.0 + storage?.bestiaryKillNeeded = 0.0 } else -> { val killNeeded: Int = bestiaryData[nextLevel] ?: -1 - hidden?.bestiaryNextLevel = nextLevel.toDouble() - hidden?.bestiaryCurrentKill = 0.0 - hidden?.bestiaryKillNeeded = killNeeded.toDouble() + storage?.bestiaryNextLevel = nextLevel.toDouble() + storage?.bestiaryCurrentKill = 0.0 + storage?.bestiaryKillNeeded = killNeeded.toDouble() } } update() @@ -459,7 +459,7 @@ object GhostCounter { val bestiaryNextLevel = if ("§\\wGhost".toRegex().matches(ghostStack.displayName)) 1 else ghostStack.displayName.substring(8) .romanToDecimal() + 1 - hidden?.bestiaryNextLevel = bestiaryNextLevel.toDouble() + storage?.bestiaryNextLevel = bestiaryNextLevel.toDouble() var kills = 0.0 for (line in ghostStack.getLore()) { val l = line.removeColor().trim() @@ -467,8 +467,8 @@ object GhostCounter { kills = "Kills: (.*)".toRegex().find(l)?.groupValues?.get(1)?.formatNumber()?.toDouble() ?: 0.0 } ghostXPPattern.matchMatcher(line.removeColor().trim()) { - hidden?.bestiaryCurrentKill = if (kills > 0) kills else group("current").formatNumber().toDouble() - hidden?.bestiaryKillNeeded = group("total").formatNumber().toDouble() + storage?.bestiaryCurrentKill = if (kills > 0) kills else group("current").formatNumber().toDouble() + storage?.bestiaryKillNeeded = group("total").formatNumber().toDouble() } } update() @@ -476,10 +476,10 @@ object GhostCounter { @SubscribeEvent fun onConfigLoad(event: ConfigLoadEvent) { - if (hidden?.configUpdateVersion == 0) { + if (storage?.configUpdateVersion == 0) { config.textFormatting.bestiaryFormatting.base = " &6Bestiary %display%: &b%value%" chat("§e[SkyHanni] Your GhostCounter config has been automatically adjusted.") - hidden?.configUpdateVersion = CONFIG_VALUE_VERSION + storage?.configUpdateVersion = CONFIG_VALUE_VERSION } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostData.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostData.kt index 70832980c..69094b991 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostData.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostData.kt @@ -63,28 +63,28 @@ object GhostData { if (s) session[this] = session[this]?.plus(i) ?: i else - GhostCounter.hidden?.data?.set(this, GhostCounter.hidden?.data?.get(this)?.plus(i) ?: i) + GhostCounter.storage?.data?.set(this, GhostCounter.storage?.data?.get(this)?.plus(i) ?: i) } fun set(i: Double, s: Boolean = false) { if (s) session[this] = i else - GhostCounter.hidden?.data?.set(this, i) + GhostCounter.storage?.data?.set(this, i) } fun getInt(s: Boolean = false): Int { return if (s) session[this]?.roundToInt() ?: 0 else - GhostCounter.hidden?.data?.get(this)?.roundToInt() ?: 0 + GhostCounter.storage?.data?.get(this)?.roundToInt() ?: 0 } fun get(s: Boolean = false): Double { return if (s) session[this] ?: 0.0 else - GhostCounter.hidden?.data?.get(this) ?: 0.0 + GhostCounter.storage?.data?.get(this) ?: 0.0 } } -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostUtil.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostUtil.kt index 6dffc62fc..b5b833423 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostUtil.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostUtil.kt @@ -17,7 +17,7 @@ object GhostUtil { opt.set(0.0) opt.set(0.0, true) } - GhostCounter.hidden?.totalMF = 0.0 + GhostCounter.storage?.totalMF = 0.0 GhostCounter.update() } @@ -79,7 +79,7 @@ object GhostUtil { GhostData.Option.VOLTACOUNT.add(json["VoltaCount"].asDouble) GhostData.Option.GHOSTLYBOOTS.add(json["GhostlyBootsCount"].asDouble) GhostData.Option.KILLS.add(json["ghostsKilled"].asDouble) - GhostCounter.hidden?.totalMF = GhostCounter.hidden?.totalMF?.plus(json["TotalMF"].asDouble) + GhostCounter.storage?.totalMF = GhostCounter.storage?.totalMF?.plus(json["TotalMF"].asDouble) ?: json["TotalMF"].asDouble GhostData.Option.TOTALDROPS.add(json["TotalDrops"].asDouble) c.ctDataImported = true @@ -120,7 +120,7 @@ object GhostUtil { ) fun String.formatBestiary(currentKill: Int, killNeeded: Int): String { - val bestiaryNextLevel = GhostCounter.hidden?.bestiaryNextLevel + val bestiaryNextLevel = GhostCounter.storage?.bestiaryNextLevel val currentLevel = bestiaryNextLevel?.let { if (it.toInt() < 0) "25" else "${it.toInt() - 1}" } ?: "§cNo Bestiary Level Data!" val nextLevel = bestiaryNextLevel?.let { if (GhostCounter.config.showMax) "25" else "${it.toInt()}" } @@ -141,4 +141,4 @@ object GhostUtil { private fun percent(number: Double) = 100.0.coerceAtMost(((number / 250_000) * 100).roundToPrecision(4)).toString() -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt index 6cdf64ca6..952786e32 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt @@ -142,7 +142,7 @@ class FarmingFortuneDisplay { companion object { private val config get() = SkyHanniMod.feature.garden.farmingFortunes - private val latestFF: MutableMap<CropType, Double>? get() = GardenAPI.config?.latestTrueFarmingFortune + private val latestFF: MutableMap<CropType, Double>? get() = GardenAPI.storage?.latestTrueFarmingFortune private val currentCrop get() = GardenAPI.getCurrentlyFarmedCrop() @@ -275,12 +275,12 @@ class FarmingFortuneDisplay { var otherFortune = 0.0 if (currentCrop == CropType.CARROT) { - GardenAPI.config?.fortune?.let { + GardenAPI.storage?.fortune?.let { if (it.carrotFortune) otherFortune = 12.0 } } if (currentCrop == CropType.PUMPKIN) { - GardenAPI.config?.fortune?.let { + GardenAPI.storage?.fortune?.let { if (it.pumpkinFortune) otherFortune = 12.0 } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt index 49eae1427..22f897a4c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt @@ -49,12 +49,12 @@ object GardenAPI { var mushroomCowPet = false private var inBarn = false val onBarnPlot get() = inBarn && inGarden() - val config get() = ProfileStorageData.profileSpecific?.garden + val storage get() = ProfileStorageData.profileSpecific?.garden var gardenExp: Long? - get() = config?.experience + get() = storage?.experience set(value) { value?.let { - config?.experience = it + storage?.experience = it } } @@ -164,7 +164,7 @@ object GardenAPI { SkyMartCopperPrice.inInventory || FarmingContestAPI.inInventory || VisitorAPI.inInventory || FFGuideGUI.isInGui() fun clearCropSpeed() { - config?.cropsPerSecond?.clear() + storage?.cropsPerSecond?.clear() GardenBestCropTime.reset() updateGardenTool() LorenzUtils.chat("§e[SkyHanni] Manually reset all crop speed data!") diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterAPI.kt index 3a22e5d39..299e02f40 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterAPI.kt @@ -9,7 +9,7 @@ import kotlin.time.Duration.Companion.minutes object ComposterAPI { var tabListData = mapOf<ComposterDisplay.DataType, String>() - val composterUpgrades: MutableMap<ComposterUpgrade, Int>? get() = GardenAPI.config?.composterUpgrades + val composterUpgrades: MutableMap<ComposterUpgrade, Int>? get() = GardenAPI.storage?.composterUpgrades fun ComposterUpgrade.getLevel(addOne: ComposterUpgrade?) = (composterUpgrades?.get(this) ?: 0) + if (addOne == this) 1 else 0 @@ -41,4 +41,4 @@ object ComposterAPI { val costFactor = 1.0 - costReduction.toDouble() / 100 return 2_000.0 * costFactor } -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterDisplay.kt index 5139d8a95..439b51b0c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterDisplay.kt @@ -20,7 +20,7 @@ import kotlin.time.DurationUnit class ComposterDisplay { private val config get() = SkyHanniMod.feature.garden.composters - private val hidden get() = GardenAPI.config + private val storage get() = GardenAPI.storage private var display = emptyList<List<Any>>() private var composterEmptyTime: Duration? = null @@ -100,7 +100,7 @@ class ComposterDisplay { private fun addComposterEmptyTime(emptyTime: Duration?): List<Any> { return if (emptyTime != null) { val millis = emptyTime.toDouble(DurationUnit.MILLISECONDS).toLong() - GardenAPI.config?.composterEmptyTime = System.currentTimeMillis() + millis + GardenAPI.storage?.composterEmptyTime = System.currentTimeMillis() + millis val format = TimeUtils.formatDuration(millis, maxUnits = 2) listOf(NEUItems.getItemStack("BUCKET"), "§b$format") } else { @@ -139,24 +139,24 @@ class ComposterDisplay { private fun sendNotify() { if (!config.notifyLow.enabled) return - val hidden = hidden ?: return + val storage = storage ?: return - if (ComposterAPI.getOrganicMatter() <= config.notifyLow.organicMatter && System.currentTimeMillis() >= hidden.informedAboutLowMatter) { + if (ComposterAPI.getOrganicMatter() <= config.notifyLow.organicMatter && System.currentTimeMillis() >= storage.informedAboutLowMatter) { if (config.notifyLow.title) { LorenzUtils.sendTitle("§cYour Organic Matter is low", 4.seconds) } LorenzUtils.chat("§e[SkyHanni] §cYour Organic Matter is low!") - hidden.informedAboutLowMatter = System.currentTimeMillis() + 60_000 * 5 + storage.informedAboutLowMatter = System.currentTimeMillis() + 60_000 * 5 } if (ComposterAPI.getFuel() <= config.notifyLow.fuel && - System.currentTimeMillis() >= hidden.informedAboutLowFuel + System.currentTimeMillis() >= storage.informedAboutLowFuel ) { if (config.notifyLow.title) { LorenzUtils.sendTitle("§cYour Fuel is low", 4.seconds) } LorenzUtils.chat("§e[SkyHanni] §cYour Fuel is low!") - hidden.informedAboutLowFuel = System.currentTimeMillis() + 60_000 * 5 + storage.informedAboutLowFuel = System.currentTimeMillis() + 60_000 * 5 } } @@ -172,7 +172,7 @@ class ComposterDisplay { } private fun checkWarningsAndOutsideGarden() { - val storage = GardenAPI.config ?: return + val storage = GardenAPI.storage ?: return val format = if (storage.composterEmptyTime != 0L) { val duration = storage.composterEmptyTime - System.currentTimeMillis() @@ -195,7 +195,7 @@ class ComposterDisplay { private fun warn(warningMessage: String) { if (!config.warnAlmostClose) return - val storage = GardenAPI.config ?: return + val storage = GardenAPI.storage ?: return if (LorenzUtils.inDungeons) return if (LorenzUtils.inKuudraFight) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt index 72845cc63..557fec6d0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt @@ -74,15 +74,15 @@ object ComposterOverlay { private var testOffset = 0 var currentOrganicMatterItem: String? - get() = GardenAPI.config?.composterCurrentOrganicMatterItem + get() = GardenAPI.storage?.composterCurrentOrganicMatterItem private set(value) { - GardenAPI.config?.composterCurrentOrganicMatterItem = value + GardenAPI.storage?.composterCurrentOrganicMatterItem = value } var currentFuelItem: String? - get() = GardenAPI.config?.composterCurrentFuelItem + get() = GardenAPI.storage?.composterCurrentFuelItem private set(value) { - GardenAPI.config?.composterCurrentFuelItem = value + GardenAPI.storage?.composterCurrentFuelItem = value } fun onCommand(args: Array<String>) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt index ff65011c6..0cc07f7e7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt @@ -54,7 +54,7 @@ object CropMoneyDisplay { private var loaded = false private var ready = false private val cropNames = mutableMapOf<NEUInternalName, CropType>() - private val toolHasBountiful get() = GardenAPI.config?.toolWithBountiful + private val toolHasBountiful get() = GardenAPI.storage?.toolWithBountiful @SubscribeEvent fun onPreProfileSwitch(event: PreProfileSwitchEvent) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/DicerRngDropCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/DicerRngDropCounter.kt index 040ab1710..d72540720 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/DicerRngDropCounter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/DicerRngDropCounter.kt @@ -117,7 +117,7 @@ class DicerRngDropCounter { class ItemDrop(val crop: CropType, val rarity: DropRarity, val pattern: Regex) private fun saveConfig() { - val map = GardenAPI.config?.dicerRngDrops ?: return + val map = GardenAPI.storage?.dicerRngDrops ?: return map.clear() for (drop in drops) { val crop = drop.key @@ -129,7 +129,7 @@ class DicerRngDropCounter { @SubscribeEvent fun onConfigLoad(event: ConfigLoadEvent) { - val map = GardenAPI.config?.dicerRngDrops ?: return + val map = GardenAPI.storage?.dicerRngDrops ?: return for ((internalName, amount) in map) { val split = internalName.split(".") val crop = CropType.getByName(split[0]) @@ -147,4 +147,4 @@ class DicerRngDropCounter { event.move(3, "garden.dicerCounterHideChat", "garden.dicerCounters.hideChat") event.move(3, "garden.dicerCounterPos", "garden.dicerCounters.pos") } -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingArmorDrops.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingArmorDrops.kt index 8092ff476..2617ad329 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingArmorDrops.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingArmorDrops.kt @@ -23,7 +23,7 @@ import kotlin.time.Duration.Companion.seconds class FarmingArmorDrops { private var display = emptyList<String>() - private val storage get() = GardenAPI.config + private val storage get() = GardenAPI.storage private var hasArmor = false private val armorPattern = "(FERMENTO|CROPIE|SQUASH|MELON)_(LEGGINGS|CHESTPLATE|BOOTS|HELMET)".toPattern() diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropSpeed.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropSpeed.kt index a9a2066bd..0f10ed883 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropSpeed.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropSpeed.kt @@ -22,8 +22,8 @@ import kotlin.concurrent.fixedRateTimer object GardenCropSpeed { private val config get() = SkyHanniMod.feature.garden - private val cropsPerSecond: MutableMap<CropType, Int>? get() = GardenAPI.config?.cropsPerSecond - private val latestBlocksPerSecond: MutableMap<CropType, Double>? get() = GardenAPI.config?.latestBlocksPerSecond + private val cropsPerSecond: MutableMap<CropType, Int>? get() = GardenAPI.storage?.cropsPerSecond + private val latestBlocksPerSecond: MutableMap<CropType, Double>? get() = GardenAPI.storage?.latestBlocksPerSecond var lastBrokenCrop: CropType? = null var lastBrokenTime = 0L diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenStartLocation.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenStartLocation.kt index 6ad3ce910..9452dc82f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenStartLocation.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenStartLocation.kt @@ -26,7 +26,7 @@ object GardenStartLocation { return } - val startLocations = GardenAPI.config?.cropStartLocations + val startLocations = GardenAPI.storage?.cropStartLocations if (startLocations == null) { LorenzUtils.chat("§c[SkyHanni] The config is not yet loaded, retry in a second.") return @@ -45,7 +45,7 @@ object GardenStartLocation { @SubscribeEvent fun onBlockClick(event: CropClickEvent) { if (!isEnabled()) return - val startLocations = GardenAPI.config?.cropStartLocations ?: return + val startLocations = GardenAPI.storage?.cropStartLocations ?: return val crop = GardenAPI.getCurrentlyFarmedCrop() ?: return if (crop != GardenCropSpeed.lastBrokenCrop) return @@ -58,7 +58,7 @@ object GardenStartLocation { @SubscribeEvent fun onRenderWorld(event: LorenzRenderWorldEvent) { if (!isEnabled()) return - val startLocations = GardenAPI.config?.cropStartLocations ?: return + val startLocations = GardenAPI.storage?.cropStartLocations ?: return val crop = GardenAPI.cropInHand ?: return val location = startLocations[crop]?.add(-0.5, 0.5, -0.5) ?: return 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 38f17dbf3..c4f311941 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 @@ -23,8 +23,8 @@ import kotlin.math.round import kotlin.time.Duration.Companion.days |
