diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-26 08:55:48 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-26 08:55:48 +0100 |
commit | 3d0e46e98fbb7750908d7a504b5874d520d3147f (patch) | |
tree | b40993a0f2aa19783126fe283462bee3989aa4ee /src/main | |
parent | 67b05d2bc69cfed5b84c125d51af2bc31d85f1f9 (diff) | |
download | skyhanni-3d0e46e98fbb7750908d7a504b5874d520d3147f.tar.gz skyhanni-3d0e46e98fbb7750908d7a504b5874d520d3147f.tar.bz2 skyhanni-3d0e46e98fbb7750908d7a504b5874d520d3147f.zip |
Replaced SkyHanniMod.feature.garden with GardenAPI.config
Diffstat (limited to 'src/main')
44 files changed, 82 insertions, 108 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestonesCommunityFix.kt b/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestonesCommunityFix.kt index 028c58000..9a0864050 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestonesCommunityFix.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestonesCommunityFix.kt @@ -5,6 +5,7 @@ import at.hannibal2.skyhanni.config.ConfigManager import at.hannibal2.skyhanni.data.jsonobjects.repo.GardenJson import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.features.garden.CropType +import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils @@ -42,7 +43,7 @@ object GardenCropMilestonesCommunityFix { fun openInventory(inventoryItems: Map<Int, ItemStack>) { if (!showWrongData) return - if (!SkyHanniMod.feature.garden.copyMilestoneData) return + if (!GardenAPI.config.copyMilestoneData) return fixForWrongData(inventoryItems) } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt index 7d5c04d5f..e92fda526 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.garden -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent @@ -24,7 +23,7 @@ import net.minecraft.item.ItemStack import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class AnitaMedalProfit { - private val config get() = SkyHanniMod.feature.garden.anitaShop + private val config get() = GardenAPI.config.anitaShop private var display = emptyList<List<Any>>() companion object { 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 3e57bb199..9fa7d7257 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt @@ -148,7 +148,7 @@ class FarmingFortuneDisplay { private fun isEnabled(): Boolean = GardenAPI.inGarden() && config.display companion object { - private val config get() = SkyHanniMod.feature.garden.farmingFortunes + private val config get() = GardenAPI.config.farmingFortunes private val latestFF: MutableMap<CropType, Double>? get() = GardenAPI.storage?.latestTrueFarmingFortune private var currentCrop: CropType? = null 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 b0a925b66..0ac45f8c1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt @@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.PetAPI import at.hannibal2.skyhanni.data.ProfileStorageData +import at.hannibal2.skyhanni.data.jsonobjects.repo.GardenJson import at.hannibal2.skyhanni.events.BlockClickEvent import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.CropClickEvent @@ -32,7 +33,6 @@ import at.hannibal2.skyhanni.utils.MinecraftDispatcher import at.hannibal2.skyhanni.utils.NEUInternalName import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getCultivatingCounter import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getHoeCounter -import at.hannibal2.skyhanni.data.jsonobjects.repo.GardenJson import kotlinx.coroutines.delay import kotlinx.coroutines.launch import kotlinx.coroutines.withContext @@ -51,6 +51,7 @@ object GardenAPI { private var inBarn = false val onBarnPlot get() = inBarn && inGarden() val storage get() = ProfileStorageData.profileSpecific?.garden + val config get() = SkyHanniMod.feature.garden var totalAmountVisitorsExisting = 0 var gardenExp: Long? get() = storage?.experience diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropTimeCommand.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropTimeCommand.kt index 92a01c7fb..bc1993c96 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropTimeCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropTimeCommand.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.garden -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.features.garden.farming.CropMoneyDisplay import at.hannibal2.skyhanni.features.garden.farming.GardenCropSpeed.getSpeed import at.hannibal2.skyhanni.utils.ItemUtils.getItemName @@ -12,7 +11,7 @@ import at.hannibal2.skyhanni.utils.StringUtils.removeColor import at.hannibal2.skyhanni.utils.TimeUtils object GardenCropTimeCommand { - private val config get() = SkyHanniMod.feature.garden.moneyPerHours + private val config get() = GardenAPI.config.moneyPerHours fun onCommand(args: Array<String>) { if (!config.display) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt index 50cf6b758..62b867719 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.garden -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent @@ -18,7 +17,7 @@ import kotlin.math.roundToLong import kotlin.time.Duration.Companion.milliseconds class GardenLevelDisplay { - private val config get() = SkyHanniMod.feature.garden.gardenLevels + private val config get() = GardenAPI.config.gardenLevels private val expToNextLevelPattern = ".* §e(?<nextLevelExp>.*)§6/.*".toPattern() private val overflowPattern = ".*§r §6(?<overflow>.*) XP".toPattern() private val namePattern = "Garden Level (?<currentLevel>.*)".toPattern() diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt index c058e9fe6..6291b253e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt @@ -494,7 +494,7 @@ object GardenNextJacobContest { null } - private val config get() = SkyHanniMod.feature.garden.nextJacobContests + private val config get() = GardenAPI.config.nextJacobContests private val nextContestCrops = mutableListOf<CropType>() fun isNextCrop(cropName: CropType) = nextContestCrops.contains(cropName) && config.otherGuis diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt index 967368915..201b1bc7e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.garden -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GardenToolChangeEvent import at.hannibal2.skyhanni.events.GuiRenderEvent @@ -19,7 +18,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.time.Duration.Companion.seconds class GardenOptimalSpeed { - private val config get() = SkyHanniMod.feature.garden.optimalSpeeds + private val config get() = GardenAPI.config.optimalSpeeds private val configCustomSpeed get() = config.customSpeed private var currentSpeed = 100 private var optimalSpeed = -1 diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotBorders.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotBorders.kt index d5d00d509..0be3874b5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotBorders.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotBorders.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.garden -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.LorenzKeyPressEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.utils.LorenzColor @@ -16,7 +15,7 @@ import kotlin.time.Duration.Companion.milliseconds class GardenPlotBorders { - private val config get() = SkyHanniMod.feature.garden.plotBorders + private val config get() = GardenAPI.config.plotBorders private var timeLastSaved = SimpleTimeMark.farPast() private var showBorders = false private val LINE_COLOR = LorenzColor.YELLOW.toColor() diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenYawAndPitch.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenYawAndPitch.kt index 2a09754cd..d053a4ede 100755 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenYawAndPitch.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenYawAndPitch.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.garden -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.GardenToolChangeEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.utils.LorenzUtils @@ -12,7 +11,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.time.Duration.Companion.seconds class GardenYawAndPitch { - private val config get() = SkyHanniMod.feature.garden.yawPitchDisplay + private val config get() = GardenAPI.config.yawPitchDisplay private var lastChange = SimpleTimeMark.farPast() private var lastYaw = 0f private var lastPitch = 0f @@ -57,4 +56,4 @@ class GardenYawAndPitch { fun onGardenToolChange(event: GardenToolChangeEvent) { lastChange = SimpleTimeMark.farPast() } -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/ToolTooltipTweaks.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/ToolTooltipTweaks.kt index 58371a771..bebeb71f8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/ToolTooltipTweaks.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/ToolTooltipTweaks.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.garden -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.LorenzToolTipEvent import at.hannibal2.skyhanni.features.garden.FarmingFortuneDisplay.Companion.getAbilityFortune @@ -19,7 +18,7 @@ import java.text.DecimalFormat import kotlin.math.roundToInt class ToolTooltipTweaks { - private val config get() = SkyHanniMod.feature.garden.tooltipTweak + private val config get() = GardenAPI.config.tooltipTweak private val tooltipFortunePattern = "^§5§o§7Farming Fortune: §a\\+([\\d.]+)(?: §2\\(\\+\\d\\))?(?: §9\\(\\+(\\d+)\\))?$".toRegex() private val counterStartLine = setOf("§5§o§6Logarithmic Counter", "§5§o§6Collection Analysis") @@ -160,4 +159,4 @@ class ToolTooltipTweaks { event.move(3, "garden.fortuneTooltipKeybind", "garden.tooltipTweak.fortuneTooltipKeybind") event.move(3, "garden.cropTooltipFortune", "garden.tooltipTweak.cropTooltipFortune") } -}
\ 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 2e089364c..cf06da7f6 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 @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.garden.composter -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.TabListUpdateEvent @@ -19,7 +18,7 @@ import kotlin.time.Duration.Companion.seconds import kotlin.time.DurationUnit class ComposterDisplay { - private val config get() = SkyHanniMod.feature.garden.composters + private val config get() = GardenAPI.config.composters private val storage get() = GardenAPI.storage private var display = emptyList<List<Any>>() private var composterEmptyTime: Duration? = null diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterInventoryNumbers.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterInventoryNumbers.kt index e344699c7..2bbfc27a6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterInventoryNumbers.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterInventoryNumbers.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.garden.composter -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.RenderInventoryItemTipEvent import at.hannibal2.skyhanni.features.garden.GardenAPI @@ -18,7 +17,7 @@ class ComposterInventoryNumbers { @SubscribeEvent fun onRenderItemTip(event: RenderInventoryItemTipEvent) { if (!GardenAPI.inGarden()) return - if (!SkyHanniMod.feature.garden.composters.inventoryNumbers) return + if (!GardenAPI.config.composters.inventoryNumbers) return if (event.inventoryName != "Composter") return @@ -72,4 +71,4 @@ class ComposterInventoryNumbers { fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "garden.composterInventoryNumbers", "garden.composters.inventoryNumbers") } -}
\ No newline at end of file +} 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 daabaec80..b65c51a01 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 @@ -1,9 +1,9 @@ package at.hannibal2.skyhanni.features.garden.composter -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.SackAPI import at.hannibal2.skyhanni.data.SackStatus +import at.hannibal2.skyhanni.data.jsonobjects.repo.GardenJson import at.hannibal2.skyhanni.data.model.ComposterUpgrade import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent @@ -34,7 +34,6 @@ import at.hannibal2.skyhanni.utils.SoundUtils import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.removeColor import at.hannibal2.skyhanni.utils.TimeUtils -import at.hannibal2.skyhanni.data.jsonobjects.repo.GardenJson import at.hannibal2.skyhanni.utils.renderables.Renderable import io.github.moulberry.notenoughupdates.NotEnoughUpdates import net.minecraftforge.event.entity.player.ItemTooltipEvent @@ -52,7 +51,7 @@ object ComposterOverlay { private var fuelFactors: Map<String, Double> = emptyMap() private var organicMatter: Map<String, Double> = emptyMap() - private val config get() = SkyHanniMod.feature.garden.composters + private val config get() = GardenAPI.config.composters private var organicMatterDisplay = emptyList<List<Any>>() private var fuelExtraDisplay = emptyList<List<Any>>() diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/GardenComposterInventoryFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/GardenComposterInventoryFeatures.kt index 397231258..3a1f9cf5e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/GardenComposterInventoryFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/GardenComposterInventoryFeatures.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.garden.composter -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.features.garden.GardenAPI @@ -19,7 +18,7 @@ import net.minecraftforge.event.entity.player.ItemTooltipEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class GardenComposterInventoryFeatures { - private val config get() = SkyHanniMod.feature.garden.composters + private val config get() = GardenAPI.config.composters @SubscribeEvent fun onTooltip(event: ItemTooltipEvent) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestFFNeededDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestFFNeededDisplay.kt index 3f03cbe4b..e52a1b343 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestFFNeededDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestFFNeededDisplay.kt @@ -1,11 +1,11 @@ package at.hannibal2.skyhanni.features.garden.contest -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.RenderItemTooltipEvent import at.hannibal2.skyhanni.features.garden.CropType import at.hannibal2.skyhanni.features.garden.FarmingFortuneDisplay.Companion.getLatestTrueFarmingFortune +import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.features.garden.farming.GardenCropSpeed.getLatestBlocksPerSecond import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils.name @@ -19,7 +19,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.math.ceil class JacobContestFFNeededDisplay { - private val config get() = SkyHanniMod.feature.garden + private val config get() = GardenAPI.config private var display = emptyList<List<Any>>() private var lastToolTipTime = 0L private val cache = mutableMapOf<ItemStack, List<List<Any>>>() diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestStatsSummary.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestStatsSummary.kt index faa2ed534..72dc37621 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestStatsSummary.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestStatsSummary.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.garden.contest -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.ClickType import at.hannibal2.skyhanni.events.CropClickEvent import at.hannibal2.skyhanni.events.FarmingContestEvent @@ -12,7 +11,7 @@ import at.hannibal2.skyhanni.utils.TimeUtils import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class JacobContestStatsSummary { - private val config get() = SkyHanniMod.feature.garden + private val config get() = GardenAPI.config private var blocksBroken = 0 private var startTime = 0L diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestTimeNeeded.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestTimeNeeded.kt index 4d9e035cd..3ce6178ad 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestTimeNeeded.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestTimeNeeded.kt @@ -1,10 +1,10 @@ package at.hannibal2.skyhanni.features.garden.contest -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.InventoryUpdatedEvent import at.hannibal2.skyhanni.features.garden.CropType import at.hannibal2.skyhanni.features.garden.FarmingFortuneDisplay.Companion.getLatestTrueFarmingFortune +import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.features.garden.farming.GardenCropSpeed.getLatestBlocksPerSecond import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList @@ -19,7 +19,7 @@ import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class JacobContestTimeNeeded { - private val config get() = SkyHanniMod.feature.garden + private val config get() = GardenAPI.config private var display = emptyList<List<Any>>() private var currentBracket = ContestBracket.GOLD diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/ArmorDropTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/ArmorDropTracker.kt index 908707311..f3fac8d2d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/ArmorDropTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/ArmorDropTracker.kt @@ -1,7 +1,8 @@ package at.hannibal2.skyhanni.features.garden.farming -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator +import at.hannibal2.skyhanni.data.jsonobjects.repo.ArmorDropsJson +import at.hannibal2.skyhanni.data.jsonobjects.repo.ArmorDropsJson.DropInfo import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.LorenzTickEvent @@ -16,8 +17,6 @@ import at.hannibal2.skyhanni.utils.LorenzUtils.addOrPut import at.hannibal2.skyhanni.utils.LorenzUtils.sortedDesc import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.SimpleTimeMark -import at.hannibal2.skyhanni.data.jsonobjects.repo.ArmorDropsJson -import at.hannibal2.skyhanni.data.jsonobjects.repo.ArmorDropsJson.DropInfo import at.hannibal2.skyhanni.utils.tracker.SkyHanniTracker import at.hannibal2.skyhanni.utils.tracker.TrackerData import com.google.gson.JsonObject @@ -29,7 +28,7 @@ object ArmorDropTracker { private var hasArmor = false private val armorPattern = "(FERMENTO|CROPIE|SQUASH|MELON)_(LEGGINGS|CHESTPLATE|BOOTS|HELMET)".toPattern() - private val config get() = SkyHanniMod.feature.garden.farmingArmorDrop + private val config get() = GardenAPI.config.farmingArmorDrop private val tracker = SkyHanniTracker("Armor Drop Tracker", { Data() }, { it.garden.armorDropTracker }) { drawDisplay(it) } 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 b780bbc0e..461b2d698 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 @@ -50,7 +50,7 @@ object CropMoneyDisplay { } private var display = emptyList<List<Any>>() - private val config get() = SkyHanniMod.feature.garden.moneyPerHours + private val config get() = GardenAPI.config.moneyPerHours private var loaded = false private var ready = false private val cropNames = mutableMapOf<NEUInternalName, CropType>() @@ -110,7 +110,7 @@ object CropMoneyDisplay { newDisplay.addAsSingletonList(fullTitle(title)) - if (!SkyHanniMod.feature.garden.cropMilestones.progress) { + if (!GardenAPI.config.cropMilestones.progress) { newDisplay.addAsSingletonList("§cCrop Milestone Progress Display is disabled!") return newDisplay } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropSpeedMeter.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropSpeedMeter.kt index fd337a361..2d1580974 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropSpeedMeter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropSpeedMeter.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.garden.farming -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.GardenCropMilestones.getCounter import at.hannibal2.skyhanni.events.CropClickEvent import at.hannibal2.skyhanni.events.CropMilestoneUpdateEvent @@ -128,7 +127,7 @@ class CropSpeedMeter { fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) { if (!isEnabled()) return - SkyHanniMod.feature.garden.cropSpeedMeterPos.renderStrings(display, posLabel = "Crop Speed Meter") + GardenAPI.config.cropSpeedMeterPos.renderStrings(display, posLabel = "Crop Speed Meter") } fun isEnabled() = enabled && GardenAPI.inGarden() diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/DicerDropTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/DicerDropTracker.kt index 24f55672b..c57447233 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/DicerDropTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/DicerDropTracker.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.garden.farming -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigManager import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GardenToolChangeEvent @@ -20,7 +19,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object DicerDropTracker { private val itemDrops = mutableListOf<ItemDrop>() - private val config get() = SkyHanniMod.feature.garden.dicerCounters + private val config get() = GardenAPI.config.dicerCounters private val tracker = SkyHanniTracker("Dicer Drop Tracker", { Data() }, { it.garden.dicerDropTracker }) { drawDisplay(it) } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt index fb9bdfaac..4b478c28f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt @@ -90,7 +90,7 @@ class FarmingWeightDisplay { } companion object { - private val config get() = SkyHanniMod.feature.garden.eliteFarmingWeights + private val config get() = GardenAPI.config.eliteFarmingWeights private val localCounter = mutableMapOf<CropType, Long>() private var dispatcher = Dispatchers.IO diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenBestCropTime.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenBestCropTime.kt index 0ef03d090..15dd12dc0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenBestCropTime.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenBestCropTime.kt @@ -1,11 +1,11 @@ package at.hannibal2.skyhanni.features.garden.farming -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.GardenCropMilestones import at.hannibal2.skyhanni.data.GardenCropMilestones.getCounter import at.hannibal2.skyhanni.data.GardenCropMilestones.isMaxed import at.hannibal2.skyhanni.features.garden.CropType +import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.features.garden.GardenAPI.addCropIcon import at.hannibal2.skyhanni.features.garden.GardenNextJacobContest import at.hannibal2.skyhanni.features.garden.farming.GardenCropSpeed.getSpeed @@ -19,7 +19,7 @@ class GardenBestCropTime { var display = emptyList<List<Any>>() companion object { - private val config get() = SkyHanniMod.feature.garden.cropMilestones + private val config get() = GardenAPI.config.cropMilestones val timeTillNextCrop = mutableMapOf<CropType, Long>() fun reset() { @@ -136,4 +136,4 @@ class GardenBestCropTime { event.move(3, "garden.cropMilestoneBestCompact", "garden.cropMilestones.next.bestCompact") event.move(3, "garden.cropMilestoneBestHideTitle", "garden.cropMilestones.next.bestHideTitle") } -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenBurrowingSporesNotifier.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenBurrowingSporesNotifier.kt index 93387ac32..33036b52a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenBurrowingSporesNotifier.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenBurrowingSporesNotifier.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.garden.farming -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.utils.LorenzUtils @@ -12,7 +11,7 @@ class GardenBurrowingSporesNotifier { @SubscribeEvent fun onChat(event: LorenzChatEvent) { if (!GardenAPI.inGarden()) return - if (!SkyHanniMod.feature.garden.burrowingSporesNotification) return + if (!GardenAPI.config.burrowingSporesNotification) return if (event.message.endsWith("§6§lVERY RARE CROP! §r§f§r§9Burrowing Spores")) { LorenzUtils.sendTitle("§9Burrowing Spores!", 5.seconds) @@ -20,4 +19,4 @@ class GardenBurrowingSporesNotifier { // ItemBlink.setBlink(NEUItems.getItemStackOrNull("BURROWING_SPORES"), 5_000) } } -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt index 76647517d..b290672af 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.garden.farming -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.GardenCropMilestones import at.hannibal2.skyhanni.data.GardenCropMilestones.getCounter @@ -34,7 +33,7 @@ object GardenCropMilestoneDisplay { private var progressDisplay = emptyList<List<Any>>() private var mushroomCowPerkDisplay = emptyList<List<Any>>() private val cultivatingData = mutableMapOf<CropType, Long>() - private val config get() = SkyHanniMod.feature.garden.cropMilestones + private val config get() = GardenAPI.config.cropMilestones private val bestCropTime = GardenBestCropTime() private var lastPlaySoundTime = 0L 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 6868596d4..a21f57698 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 @@ -1,11 +1,12 @@ package at.hannibal2.skyhanni.features.garden.farming -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.ClickType import at.hannibal2.skyhanni.data.GardenCropMilestones.getCounter import at.hannibal2.skyhanni.data.GardenCropMilestones.setCounter import at.hannibal2.skyhanni.data.MayorElection +import at.hannibal2.skyhanni.data.jsonobjects.repo.DicerDropsJson +import at.hannibal2.skyhanni.data.jsonobjects.repo.DicerDropsJson.DicerType import at.hannibal2.skyhanni.events.CropClickEvent import at.hannibal2.skyhanni.events.GardenToolChangeEvent import at.hannibal2.skyhanni.events.PreProfileSwitchEvent @@ -15,13 +16,11 @@ import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.LorenzUtils.editCopy -import at.hannibal2.skyhanni.data.jsonobjects.repo.DicerDropsJson -import at.hannibal2.skyhanni.data.jsonobjects.repo.DicerDropsJson.DicerType import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.concurrent.fixedRateTimer object GardenCropSpeed { - private val config get() = SkyHanniMod.feature.garden + private val config get() = GardenAPI.config private val cropsPerSecond: MutableMap<CropType, Int>? get() = GardenAPI.storage?.cropsPerSecond private val latestBlocksPerSecond: MutableMap<CropType, Double>? get() = GardenAPI.storage?.latestBlocksPerSecond diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCustomKeybinds.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCustomKeybinds.kt index 6b30cf3af..6bbde660f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCustomKeybinds.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCustomKeybinds.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.garden.farming -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.mixins.transformers.AccessorKeyBinding @@ -14,24 +13,24 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable import java.util.IdentityHashMap object GardenCustomKeybinds { - private val shConfig get() = SkyHanniMod.feature.garden.keyBind + private val config get() = GardenAPI.config.keyBind private val mcSettings get() = Minecraft.getMinecraft().gameSettings private val map: MutableMap<KeyBinding, () -> Int> = IdentityHashMap() private var lastWindowOpenTime = 0L init { - map[mcSettings.keyBindAttack] = { shConfig.attack } - map[mcSettings.keyBindUseItem] = { shConfig.useItem } - map[mcSettings.keyBindLeft] = { shConfig.left } - map[mcSettings.keyBindRight] = { shConfig.right } - map[mcSettings.keyBindForward] = { shConfig.forward } - map[mcSettings.keyBindBack] = { shConfig.back } - map[mcSettings.keyBindJump] = { shConfig.jump } - map[mcSettings.keyBindSneak] = { shConfig.sneak } + map[mcSettings.keyBindAttack] = { config.attack } + map[mcSettings.keyBindUseItem] = { config.useItem } + map[mcSettings.keyBindLeft] = { config.left } + map[mcSettings.keyBindRight] = { config.right } + map[mcSettings.keyBindForward] = { config.forward } + map[mcSettings.keyBindBack] = { config.back } + map[mcSettings.keyBindJump] = { config.jump } + map[mcSettings.keyBindSneak] = { config.sneak } } - private fun isEnabled() = GardenAPI.inGarden() && shConfig.enabled + private fun isEnabled() = GardenAPI.inGarden() && config.enabled private fun isActive(): Boolean { if (!isEnabled()) return false @@ -80,4 +79,4 @@ object GardenCustomKeybinds { event.move(3, "garden.keyBindJump", "garden.keyBind.jump") event.move(3, "garden.keyBindSneak", "garden.keyBind.sneak") } -}
\ No newline at end of file +} 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 3384af51e..f1fdd112a 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 @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.garden.farming -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.CropClickEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.features.garden.GardenAPI @@ -12,13 +11,14 @@ import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object GardenStartLocation { + private val config get() = GardenAPI.config.cropStartLocation fun setLocationCommand() { if (!GardenAPI.inGarden()) { LorenzUtils.userError("This Command only works in the garden!") return } - if (!SkyHanniMod.feature.garden.cropStartLocation.enabled) { + if (!config.enabled) { LorenzUtils.clickableChat( "This feature is disabled. Enable it in the config: §e/sh crop start location", "sh crop start location", @@ -67,5 +67,5 @@ object GardenStartLocation { event.drawDynamicText(location, crop.cropName, 1.5) } - fun isEnabled() = GardenAPI.inGarden() && SkyHanniMod.feature.garden.cropStartLocation.enabled + fun isEnabled() = GardenAPI.inGarden() && config.enabled } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/WildStrawberryDyeNotification.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/WildStrawberryDyeNotification.kt index d923efb6d..dc5f17064 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/WildStrawberryDyeNotification.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/WildStrawberryDyeNotification.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.garden.farming -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.OwnInventoryItemUpdateEvent import at.hannibal2.skyhanni.features.garden.GardenAPI @@ -27,7 +26,7 @@ class WildStrawberryDyeNotification { @SubscribeEvent fun onOwnInventoryItemUpdate(event: OwnInventoryItemUpdateEvent) { if (!GardenAPI.inGarden()) return - if (!SkyHanniMod.feature.garden.wildStrawberryDyeNotification) return + if (!GardenAPI.config.wildStrawberryDyeNotification) return val itemStack = event.itemStack MinecraftExecutor.OnThread.execute { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/WrongFungiCutterWarning.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/WrongFungiCutterWarning.kt index e7bdce1db..dc31789a9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/WrongFungiCutterWarning.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/WrongFungiCutterWarning.kt @@ -1,11 +1,11 @@ package at.hannibal2.skyhanni.features.garden.farming -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.ClickType import at.hannibal2.skyhanni.events.CropClickEvent import at.hannibal2.skyhanni.events.GardenToolChangeEvent import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.features.garden.CropType +import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getFungiCutterMode @@ -44,7 +44,7 @@ class WrongFungiCutterWarning { } private fun notifyWrong() { - if (!SkyHanniMod.feature.garden.fungiCutterWarn) return + if (!GardenAPI.config.fungiCutterWarn) return LorenzUtils.sendTitle("§cWrong Fungi Cutter Mode!", 2.seconds) if (System.currentTimeMillis() > lastPlaySoundTime + 3_00) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/AnitaExtraFarmingFortune.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/AnitaExtraFarmingFortune.kt index 1e83d8aa7..683834419 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/AnitaExtraFarmingFortune.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/AnitaExtraFarmingFortune.kt @@ -1,7 +1,8 @@ package at.hannibal2.skyhanni.features.garden.inventory -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator +import at.hannibal2.skyhanni.data.jsonobjects.repo.AnitaUpgradeCostsJson +import at.hannibal2.skyhanni.data.jsonobjects.repo.AnitaUpgradeCostsJson.Price import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.utils.InventoryUtils @@ -12,13 +13,11 @@ import at.hannibal2.skyhanni.utils.NumberUtil import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher -import at.hannibal2.skyhanni.data.jsonobjects.repo.AnitaUpgradeCostsJson -import at.hannibal2.skyhanni.data.jsonobjects.repo.AnitaUpgradeCostsJson.Price import net.minecraftforge.event.entity.player.ItemTooltipEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class AnitaExtraFarmingFortune { - private val config get() = SkyHanniMod.feature.garden.anitaShop + private val config get() = GardenAPI.config.anitaShop private var levelPrice = mapOf<Int, Price>() @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenCropMilestoneInventory.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenCropMilestoneInventory.kt index cb236050b..6a37862a9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenCropMilestoneInventory.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenCropMilestoneInventory.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.garden.inventory -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.GardenCropMilestones import at.hannibal2.skyhanni.data.GardenCropMilestones.getCounter @@ -8,6 +7,7 @@ import at.hannibal2.skyhanni.events.CropMilestoneUpdateEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.RenderInventoryItemTipEvent import at.hannibal2.skyhanni.features.garden.CropType +import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.indexOfFirst import at.hannibal2.skyhanni.utils.LorenzUtils.round @@ -19,7 +19,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class GardenCropMilestoneInventory { private var average = -1.0 - private val config get() = SkyHanniMod.feature.garden + private val config get() = GardenAPI.config @SubscribeEvent fun onCropMilestoneUpdate(event: CropMilestoneUpdateEvent) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenDeskInSBMenu.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenDeskInSBMenu.kt index a3f72ac4c..bc20b44a3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenDeskInSBMenu.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenDeskInSBMenu.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.garden.inventory -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.features.garden.GardenAPI @@ -15,7 +14,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class GardenDeskInSBMenu { - private val config get() = SkyHanniMod.feature.garden + private val config get() = GardenAPI.config private var showItem = false private val item by lazy { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenInventoryNumbers.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenInventoryNumbers.kt index fe3d690a3..a4914b2d1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenInventoryNumbers.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenInventoryNumbers.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.garden.inventory -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.GardenCropMilestones import at.hannibal2.skyhanni.data.GardenCropMilestones.getCounter @@ -15,7 +14,7 @@ import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class GardenInventoryNumbers { - private val config get() = SkyHanniMod.feature.garden.number + private val config get() = GardenAPI.config.number private var patternUpgradeTier = "§7Current Tier: §[ea](?<tier>.*)§7/§a.*".toPattern() diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenNextPlotPrice.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenNextPlotPrice.kt index 64d176bcd..bd2a3b5a3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenNextPlotPrice.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenNextPlotPrice.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.garden.inventory -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils @@ -16,7 +15,7 @@ class GardenNextPlotPrice { @SubscribeEvent fun onTooltip(event: ItemTooltipEvent) { if (!GardenAPI.inGarden()) return - if (!SkyHanniMod.feature.garden.plotPrice) return + if (!GardenAPI.config.plotPrice) return if (InventoryUtils.openInventoryName() != "Configure Plots") return diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenPlotIcon.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenPlotIcon.kt index cdd5d4358..c7ff13dc6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenPlotIcon.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenPlotIcon.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.garden.inventory -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.events.LorenzToolTipEvent @@ -20,7 +19,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object GardenPlotIcon { - private val config get() = SkyHanniMod.feature.garden.plotIcon + private val config get() = GardenAPI.config.plotIcon private val plotList get() = GardenAPI.storage?.plotIcon?.plotList private var inInventory = false private var copyStack: ItemStack? = null diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.kt index a70ca7f96..e2b15c49c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.garden.inventory -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent @@ -21,7 +20,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class SkyMartCopperPrice { private val pattern = "§c(?<amount>.*) Copper".toPattern() private var display = emptyList<List<Any>>() - private val config get() = SkyHanniMod.feature.garden.skyMart + private val config get() = GardenAPI.config.skyMart companion object { var inInventory = false diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestAPI.kt index 61bee866a..cb596f11d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestAPI.kt @@ -1,11 +1,11 @@ package at.hannibal2.skyhanni.features.garden.pests -import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName object PestAPI { - val config get() = SkyHanniMod.feature.garden.pests + val config get() = GardenAPI.config.pests val vacuumVariants = listOf( "SKYMART_VACUUM".asInternalName(), diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorColorNames.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorColorNames.kt index 5d4937f71..c35b2d78a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorColorNames.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorColorNames.kt @@ -1,9 +1,9 @@ package at.hannibal2.skyhanni.features.garden.visitor -import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.data.jsonobjects.repo.GardenJson import at.hannibal2.skyhanni.events.RepositoryReloadEvent +import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.utils.StringUtils.removeColor -import at.hannibal2.skyhanni.data.jsonobjects.repo.GardenJson import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object GardenVisitorColorNames { @@ -23,7 +23,7 @@ object GardenVisitorColorNames { } fun getColoredName(name: String): String { - if (!SkyHanniMod.feature.garden.visitors.coloredName) return name + if (!GardenAPI.config.visitors.coloredName) return name val cleanName = name.removeColor() val color = visitorColours[cleanName] ?: return name diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt index 6ddabd2f5..4625f3b47 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.garden.visitor -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.Storage import at.hannibal2.skyhanni.data.ProfileStorageData @@ -24,7 +23,7 @@ import at.hannibal2.skyhanni.utils.StringUtils.removeColor import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object GardenVisitorDropStatistics { - private val config get() = SkyHanniMod.feature.garden.visitors.dropsStatistics + private val config get() = GardenAPI.config.visitors.dropsStatistics private var display = emptyList<List<Any>>() private var acceptedVisitors = 0 diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorTimer.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorTimer.kt index 2819f1d41..31bab7d56 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorTimer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorTimer.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.features.garden.visitor -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.CropClickEvent import at.hannibal2.skyhanni.events.GuiRenderEvent @@ -28,7 +27,7 @@ import kotlin.time.DurationUnit import kotlin.time.toDuration class GardenVisitorTimer { - private val config get() = SkyHanniMod.feature.garden.visitors.timer + private val config get() = GardenAPI.config.visitors.timer private val pattern = "§b§lVisitors: §r§f\\((?<time>.*)\\)".toPattern() private var display = "" private var lastMillis = 0.seconds diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/HighlightVisitorsOutsideOfGarden.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/HighlightVisitorsOutsideOfGarden.kt index 00fb62be2..bd0fe5704 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/HighlightVisitorsOutsideOfGarden.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/HighlightVisitorsOutsideOfGarden.kt @@ -1,11 +1,12 @@ package at.hannibal2.skyhanni.features.garden.visitor -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.features.garden.visitor.VisitorConfig.VisitorBlockBehaviour +import at.hannibal2.skyhanni.data.jsonobjects.repo.GardenJson import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.PacketEvent import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.events.withAlpha +import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper import at.hannibal2.skyhanni.utils.EntityUtils import at.hannibal2.skyhanni.utils.EntityUtils.getSkinTexture @@ -13,7 +14,6 @@ import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzVec import at.hannibal2.skyhanni.utils.getLorenzVec -import at.hannibal2.skyhanni.data.jsonobjects.repo.GardenJson import at.hannibal2.skyhanni.utils.toLorenzVec import io.github.moulberry.notenoughupdates.util.SBInfo import net.minecraft.client.Minecraft @@ -27,7 +27,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class HighlightVisitorsOutsideOfGarden { private var visitorJson = mapOf<String?, List<GardenJson.GardenVisitor>>() - private val config get() = SkyHanniMod.feature.garden.visitors + private val config get() = GardenAPI.config.visitors @SubscribeEvent fun onRepoReload(event: RepositoryReloadEvent) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorAPI.kt index f71ab6883..c8a68da36 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorAPI.kt @@ -1,11 +1,11 @@ package at.hannibal2.skyhanni.features.garden.visitor -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.garden.visitor.VisitorAcceptedEvent import at.hannibal2.skyhanni.events.garden.visitor.VisitorArrivalEvent import at.hannibal2.skyhanni.events.garden.visitor.VisitorLeftEvent import at.hannibal2.skyhanni.events.garden.visitor.VisitorRefusedEvent import at.hannibal2.skyhanni.events.withAlpha +import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.EntityUtils import at.hannibal2.skyhanni.utils.LorenzColor @@ -18,7 +18,7 @@ import net.minecraft.item.ItemStack object VisitorAPI { private var visitors = mapOf<String, Visitor>() var inInventory = false - val config get() = SkyHanniMod.feature.garden.visitors + val config get() = GardenAPI.config.visitors private val logger = LorenzLogger("garden/visitors/api") fun getVisitorsMap() = visitors |