From 0bdfaab9e486f0c6adc576e3a939838ef1827c80 Mon Sep 17 00:00:00 2001 From: Walker Selby Date: Sun, 15 Oct 2023 12:50:14 +0100 Subject: Internal Change: Config deprecations (#542) migrate the config, removed id system entirely #542 --- .../skyhanni/config/ConfigUpdaterMigrator.kt | 2 +- .../skyhanni/config/features/ChatConfig.java | 205 +- .../skyhanni/config/features/CombatConfig.java | 24 +- .../config/features/CrimsonIsleConfig.java | 4 +- .../skyhanni/config/features/DevConfig.java | 302 ++- .../skyhanni/config/features/DungeonConfig.java | 186 +- .../skyhanni/config/features/EventConfig.java | 18 +- .../skyhanni/config/features/FishingConfig.java | 140 +- .../skyhanni/config/features/GardenConfig.java | 2156 ++++++++++---------- .../skyhanni/config/features/InventoryConfig.java | 217 +- .../config/features/ItemAbilityConfig.java | 33 +- .../skyhanni/config/features/MinionsConfig.java | 104 +- .../skyhanni/config/features/MiscConfig.java | 251 ++- .../skyhanni/config/features/RiftConfig.java | 40 +- .../skyhanni/config/features/SlayerConfig.java | 240 ++- .../hannibal2/skyhanni/features/chat/ChatFilter.kt | 17 +- .../skyhanni/features/chat/WatchdogHider.kt | 8 +- .../features/chat/playerchat/PlayerChatModifier.kt | 14 +- .../damageindicator/DamageIndicatorManager.kt | 6 +- .../skyhanni/features/dungeon/DungeonCleanEnd.kt | 18 +- .../skyhanni/features/dungeon/DungeonCopilot.kt | 14 +- .../skyhanni/features/dungeon/DungeonHideItems.kt | 35 +- .../skyhanni/features/dungeon/DungeonLevelColor.kt | 8 +- .../skyhanni/features/fishing/FishingTimer.kt | 28 +- .../skyhanni/features/garden/AnitaMedalProfit.kt | 13 +- .../features/garden/FarmingFortuneDisplay.kt | 16 +- .../features/garden/GardenCropTimeCommand.kt | 4 +- .../skyhanni/features/garden/GardenLevelDisplay.kt | 13 +- .../features/garden/GardenNextJacobContest.kt | 46 +- .../skyhanni/features/garden/GardenOptimalSpeed.kt | 36 +- .../skyhanni/features/garden/ToolTooltipTweaks.kt | 10 +- .../features/garden/composter/ComposterDisplay.kt | 39 +- .../garden/composter/ComposterInventoryNumbers.kt | 8 +- .../features/garden/composter/ComposterOverlay.kt | 25 +- .../composter/GardenComposterInventoryFeatures.kt | 13 +- .../garden/contest/JacobContestFFNeededDisplay.kt | 2 +- .../contest/JacobFarmingContestsInventory.kt | 21 +- .../features/garden/farming/CropMoneyDisplay.kt | 72 +- .../features/garden/farming/DicerRngDropCounter.kt | 18 +- .../features/garden/farming/FarmingArmorDrops.kt | 18 +- .../garden/farming/FarmingWeightDisplay.kt | 28 +- .../features/garden/farming/GardenBestCropTime.kt | 37 +- .../garden/farming/GardenCropMilestoneDisplay.kt | 52 +- .../features/garden/farming/GardenCropSpeed.kt | 9 +- .../garden/farming/GardenCustomKeybinds.kt | 35 +- .../garden/inventory/AnitaExtraFarmingFortune.kt | 8 +- .../inventory/GardenCropMilestoneInventory.kt | 11 +- .../garden/inventory/GardenInventoryNumbers.kt | 17 +- .../garden/inventory/SkyMartCopperPrice.kt | 16 +- .../garden/visitor/GardenVisitorColorNames.kt | 2 +- .../garden/visitor/GardenVisitorDropStatistics.kt | 15 +- .../garden/visitor/GardenVisitorFeatures.kt | 98 +- .../features/garden/visitor/GardenVisitorTimer.kt | 19 +- .../features/inventory/HideNotClickableItems.kt | 25 +- .../features/inventory/RngMeterInventory.kt | 16 +- .../skyhanni/features/inventory/StatsTuning.kt | 17 +- .../itemabilities/FireVeilWandParticles.kt | 13 +- .../skyhanni/features/minion/MinionFeatures.kt | 20 +- .../skyhanni/features/misc/CurrentPetDisplay.kt | 10 +- .../features/misc/NonGodPotEffectDisplay.kt | 10 +- .../skyhanni/features/misc/ParticleHider.kt | 20 +- .../skyhanni/features/misc/PetExpTooltip.kt | 9 +- .../skyhanni/features/misc/QuickModMenuSwitch.kt | 8 +- .../features/misc/ThunderSparksHighlight.kt | 12 +- .../misc/compacttablist/AdvancedPlayerList.kt | 2 +- .../features/misc/items/EstimatedItemValue.kt | 25 +- .../features/misc/items/EstimatedWardrobePrice.kt | 12 +- .../features/slayer/blaze/BlazeSlayerClearView.kt | 8 +- .../slayer/blaze/BlazeSlayerDaggerHelper.kt | 18 +- .../slayer/blaze/BlazeSlayerFirePitsWarning.kt | 8 +- .../features/slayer/blaze/HellionShieldHelper.kt | 10 +- .../slayer/enderman/EndermanSlayerFeatures.kt | 24 +- .../slayer/enderman/EndermanSlayerHideParticles.kt | 8 +- .../mixins/transformers/MixinBlockFire.java | 2 +- .../mixins/transformers/MixinEntityBlaze.java | 2 +- .../mixins/transformers/MixinEntityEnderman.java | 2 +- .../mixins/transformers/MixinEntityFireball.java | 2 +- .../skyhanni/test/CommandsSendToServerLogger.kt | 9 +- .../skyhanni/test/HighlightMissingRepoItems.kt | 8 +- .../at/hannibal2/skyhanni/test/ShowItemUuid.kt | 8 +- .../skyhanni/test/SkyHanniDebugsAndTests.kt | 25 +- .../skyhanni/test/TestCopyBestiaryValues.kt | 8 +- .../skyhanni/test/TestCopyRngMeterValues.kt | 8 +- .../at/hannibal2/skyhanni/test/TestExportTools.kt | 8 +- .../at/hannibal2/skyhanni/utils/LorenzUtils.kt | 2 +- .../skyhanni/utils/MinecraftConsoleFilter.kt | 47 +- 86 files changed, 2790 insertions(+), 2387 deletions(-) (limited to 'src') diff --git a/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt b/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt index 2b2d6f756..eff921734 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt @@ -9,7 +9,7 @@ import com.google.gson.JsonPrimitive object ConfigUpdaterMigrator { val logger = LorenzLogger("ConfigMigration") - val configVersion = 2 + val configVersion = 3 fun JsonElement.at(chain: List, init: Boolean): JsonElement? { if (chain.isEmpty()) return this if (this !is JsonObject) return null diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/ChatConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/ChatConfig.java index e23246580..e0324c32f 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/ChatConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/ChatConfig.java @@ -2,14 +2,9 @@ package at.hannibal2.skyhanni.config.features; import at.hannibal2.skyhanni.config.FeatureToggle; import com.google.gson.annotations.Expose; -import io.github.moulberry.moulconfig.annotations.ConfigAccordionId; -import io.github.moulberry.moulconfig.annotations.ConfigEditorAccordion; -import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; -import io.github.moulberry.moulconfig.annotations.ConfigEditorKeybind; -import io.github.moulberry.moulconfig.annotations.ConfigOption; +import io.github.moulberry.moulconfig.annotations.*; import org.lwjgl.input.Keyboard; -@SuppressWarnings("deprecation") public class ChatConfig { @Expose @@ -19,113 +14,103 @@ public class ChatConfig { @Expose @ConfigOption(name = "Chat Filter Types", desc = "") - @ConfigEditorAccordion(id = 0) - public boolean filterTypes = false; - - @Expose - @ConfigOption(name = "Hypixel Hub", desc = "Block messages outside SkyBlock in the Hypixel lobby: player joins, loot boxes, prototype lobby messages, radiating generosity and Hypixel tournaments.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - @FeatureToggle - public boolean hypixelHub = true; - - @Expose - @ConfigOption(name = "Empty", desc = "Hide all the empty messages from the chat.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - @FeatureToggle - public boolean empty = true; - - @Expose - @ConfigOption(name = "Warping", desc = "Block 'Sending request to join...' and 'Warping...' messages.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - @FeatureToggle - public boolean warping = true; - - @Expose - @ConfigOption(name = "Welcome", desc = "Hide the 'Welcome to SkyBlock' message.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - @FeatureToggle - public boolean welcome = true; - - @Expose - @ConfigOption(name = "Guild Exp", desc = "Hide Guild EXP messages.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - @FeatureToggle - public boolean guildExp = true; - - @Expose - @ConfigOption(name = "Friend Join Left", desc = "Hide friend join/left messages.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - @FeatureToggle - public boolean friendJoinLeft = false; - - @Expose - @ConfigOption(name = "Winter Gifts", desc = "Hide useless Winter Gift messages.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - @FeatureToggle - public boolean winterGift = false; - - @Expose - @ConfigOption(name = "Powder Mining", desc = "Hide messages while opening chests in the Crystal Hollows. " + - "(Except powder numbers over 1k, Prehistoric Egg and Automaton Parts)") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - @FeatureToggle - public boolean powderMining = true; - - @Expose - @ConfigOption(name = "Kill Combo", desc = "Hide messages about the current Kill Combo from the Grandma Wolf Pet.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - @FeatureToggle - public boolean killCombo = false; - - @Expose - @ConfigOption(name = "Watchdog", desc = "Hide the message where Hypixel is flexing how many players they have banned over the last week.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - @FeatureToggle - public boolean watchDog = true; - - @Expose - @ConfigOption(name = "Profile Join", desc = "Hide 'You are playing on profile' and 'Profile ID' chat messages.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - @FeatureToggle - public boolean profileJoin = true; - - //TODO remove - @Expose - @ConfigOption(name = "Others", desc = "Hide other annoying messages.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - @FeatureToggle - public boolean others = false; + @Accordion + public FilterTypesConfig filterType = new FilterTypesConfig(); + + public static class FilterTypesConfig{ + @Expose + @ConfigOption(name = "Hypixel Hub", desc = "Block messages outside SkyBlock in the Hypixel lobby: player joins, loot boxes, prototype lobby messages, radiating generosity and Hypixel tournaments.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hypixelHub = true; + + @Expose + @ConfigOption(name = "Empty", desc = "Hide all the empty messages from the chat.") + @ConfigEditorBoolean + @FeatureToggle + public boolean empty = true; + + @Expose + @ConfigOption(name = "Warping", desc = "Block 'Sending request to join...' and 'Warping...' messages.") + @ConfigEditorBoolean + @FeatureToggle + public boolean warping = true; + + @Expose + @ConfigOption(name = "Welcome", desc = "Hide the 'Welcome to SkyBlock' message.") + @ConfigEditorBoolean + @FeatureToggle + public boolean welcome = true; + + @Expose + @ConfigOption(name = "Guild Exp", desc = "Hide Guild EXP messages.") + @ConfigEditorBoolean + @FeatureToggle + public boolean guildExp = true; + + @Expose + @ConfigOption(name = "Friend Join Left", desc = "Hide friend join/left messages.") + @ConfigEditorBoolean + @FeatureToggle + public boolean friendJoinLeft = false; + + @Expose + @ConfigOption(name = "Winter Gifts", desc = "Hide useless Winter Gift messages.") + @ConfigEditorBoolean + @FeatureToggle + public boolean winterGift = false; + + @Expose + @ConfigOption(name = "Powder Mining", desc = "Hide messages while opening chests in the Crystal Hollows. " + + "(Except powder numbers over 1k, Prehistoric Egg and Automaton Parts)") + @ConfigEditorBoolean + @FeatureToggle + public boolean powderMining = true; + + @Expose + @ConfigOption(name = "Kill Combo", desc = "Hide messages about the current Kill Combo from the Grandma Wolf Pet.") + @ConfigEditorBoolean + @FeatureToggle + public boolean killCombo = false; + + @Expose + @ConfigOption(name = "Watchdog", desc = "Hide the message where Hypixel is flexing how many players they have banned over the last week.") + @ConfigEditorBoolean + @FeatureToggle + public boolean watchDog = true; + + @Expose + @ConfigOption(name = "Profile Join", desc = "Hide 'You are playing on profile' and 'Profile ID' chat messages.") + @ConfigEditorBoolean + @FeatureToggle + public boolean profileJoin = true; + + //TODO remove + @Expose + @ConfigOption(name = "Others", desc = "Hide other annoying messages.") + @ConfigEditorBoolean + @FeatureToggle + public boolean others = false; + } @Expose @ConfigOption(name = "Player Messages", desc = "") - @ConfigEditorAccordion(id = 1) - public boolean playerMessages = false; - - @Expose - @ConfigOption(name = "Player Rank Hider", desc = "Hide player ranks in all chat messages.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - @FeatureToggle - public boolean playerRankHider = false; - - @Expose - @ConfigOption(name = "Chat Filter", desc = "Scan messages sent by players for blacklisted words and gray out the message if any are found.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - @FeatureToggle - public boolean chatFilter = false; + @Accordion + public PlayerMessagesConfig playerMessage = new PlayerMessagesConfig(); + + public static class PlayerMessagesConfig{ + @Expose + @ConfigOption(name = "Player Rank Hider", desc = "Hide player ranks in all chat messages.") + @ConfigEditorBoolean + @FeatureToggle + public boolean playerRankHider = false; + + @Expose + @ConfigOption(name = "Chat Filter", desc = "Scan messages sent by players for blacklisted words and gray out the message if any are found.") + @ConfigEditorBoolean + @FeatureToggle + public boolean chatFilter = false; + } @Expose @ConfigOption(name = "Dungeon Filter", desc = "Hide annoying messages in Dungeons.") diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/CombatConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/CombatConfig.java index 58bd6fe26..a54feefe5 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/CombatConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/CombatConfig.java @@ -6,7 +6,6 @@ import at.hannibal2.skyhanni.features.misc.ghostcounter.GhostFormatting; import at.hannibal2.skyhanni.features.misc.ghostcounter.GhostUtil; import com.google.gson.annotations.Expose; import io.github.moulberry.moulconfig.annotations.Accordion; -import io.github.moulberry.moulconfig.annotations.ConfigEditorAccordion; import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; import io.github.moulberry.moulconfig.annotations.ConfigEditorButton; import io.github.moulberry.moulconfig.annotations.ConfigEditorDraggableList; @@ -127,7 +126,7 @@ public class CombatConfig { @Expose @ConfigOption(name = "Vampire Slayer", desc = "") @Accordion - public DamageIndicatorConfig.VampireSlayerConfig vampireSlayer = new DamageIndicatorConfig.VampireSlayerConfig(); + public VampireSlayerConfig vampireSlayer = new VampireSlayerConfig(); public static class VampireSlayerConfig { @Expose @@ -194,9 +193,9 @@ public class CombatConfig { @ConfigOption(name = "Text Formatting", desc = "") @Accordion @Expose - public TextFormatting textFormatting = new TextFormatting(); + public TextFormattingConfig textFormatting = new TextFormattingConfig(); - public static class TextFormatting { + public static class TextFormattingConfig { @ConfigOption(name = "§eText Formatting Info", desc = "§e%session% §ris §e§lalways §rreplaced with\n" + "§7the count for your current session.\n" + @@ -304,9 +303,9 @@ public class CombatConfig { @ConfigOption(name = "Bestiary Formatting", desc = "") @Accordion @Expose - public BestiaryFormatting bestiaryFormatting = new BestiaryFormatting(); + public BestiaryFormattingConfig bestiaryFormatting = new BestiaryFormattingConfig(); - public static class BestiaryFormatting { + public static class BestiaryFormattingConfig { @Expose @ConfigOption(name = "Bestiary", desc = "Bestiary Progress line.\n§e%value% §7is replaced with\n" + @@ -346,9 +345,9 @@ public class CombatConfig { @ConfigOption(name = "XP Per Hour Formatting", desc = "") @Accordion @Expose - public XPHourFormatting xpHourFormatting = new XPHourFormatting(); + public XPHourFormattingConfig xpHourFormatting = new XPHourFormattingConfig(); - public static class XPHourFormatting { + public static class XPHourFormattingConfig { @Expose @ConfigOption(name = "XP/h", desc = "XP Per Hour line.\n" + @@ -372,9 +371,9 @@ public class CombatConfig { @ConfigOption(name = "ETA Formatting", desc = "") @Accordion @Expose - public ETAFormatting etaFormatting = new ETAFormatting(); + public ETAFormattingConfig etaFormatting = new ETAFormattingConfig(); - public static class ETAFormatting { + public static class ETAFormattingConfig { @Expose @ConfigOption(name = "ETA to next level", desc = "ETA To Next Level Line.\n" + "§e%value% §7is replaced with one of the text below.") @@ -414,9 +413,9 @@ public class CombatConfig { @ConfigOption(name = "Kill Per Hour Formatting", desc = "") @Expose @Accordion - public KillHourFormatting killHourFormatting = new KillHourFormatting(); + public KillHourFormattingConfig killHourFormatting = new KillHourFormattingConfig(); - public static class KillHourFormatting { + public static class KillHourFormattingConfig { @Expose @ConfigOption(name = "Kill/h", desc = "Kill Per Hour line.\n§e%value% §7is replaced with\nEstimated kills per hour you get.") @ConfigEditorText @@ -529,7 +528,6 @@ public class CombatConfig { @Expose @ConfigOption(name = "Highlighters", desc = "") - @ConfigEditorAccordion(id = 0) public boolean highlighters = false; @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/CrimsonIsleConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/CrimsonIsleConfig.java index 11966d0a3..a6927b522 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/CrimsonIsleConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/CrimsonIsleConfig.java @@ -112,9 +112,9 @@ public class CrimsonIsleConfig { @ConfigOption(name = "Reputation Helper", desc = "") @Accordion @Expose - public ReputatioHelperConfig reputationHelper = new ReputatioHelperConfig(); + public ReputationHelperConfig reputationHelper = new ReputationHelperConfig(); - public static class ReputatioHelperConfig { + public static class ReputationHelperConfig { @Expose @ConfigOption(name = "Enabled", desc = "Enable features around Reputation features in the Crimson Isle.") diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/DevConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/DevConfig.java index 5fdf918e2..edf6391b4 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/DevConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/DevConfig.java @@ -3,8 +3,6 @@ package at.hannibal2.skyhanni.config.features; import at.hannibal2.skyhanni.config.core.config.Position; import com.google.gson.annotations.Expose; import io.github.moulberry.moulconfig.annotations.Accordion; -import io.github.moulberry.moulconfig.annotations.ConfigAccordionId; -import io.github.moulberry.moulconfig.annotations.ConfigEditorAccordion; import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; import io.github.moulberry.moulconfig.annotations.ConfigEditorKeybind; import io.github.moulberry.moulconfig.annotations.ConfigOption; @@ -20,90 +18,78 @@ public class DevConfig { @Expose @ConfigOption(name = "Debug", desc = "") - @ConfigEditorAccordion(id = 0) - public boolean debugDO_NOT_USE = false; - - @Expose - @ConfigOption(name = "Enable Debug", desc = "Enable Test logic") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - public boolean debugEnabled = false; + @Accordion + public DebugConfig debug = new DebugConfig(); + public static class DebugConfig{ + @Expose + @ConfigOption(name = "Enable Debug", desc = "Enable Test logic") + @ConfigEditorBoolean + public boolean enabled = false; - @Expose - @ConfigOption(name = "Command Logging", desc = "Logs stack trace information into the console when a command gets sent to Hypixel. (by any mod or the player)") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - public boolean commandLogs = false; + @Expose + @ConfigOption(name = "Command Logging", desc = "Logs stack trace information into the console when a command gets sent to Hypixel. (by any mod or the player)") + @ConfigEditorBoolean + public boolean commandLogs = false; - @Expose - @ConfigOption( - name = "Mod Menu Log", - desc = "Enables debug messages when the currently opened GUI changes, with the path to the gui class. " + - "Useful for adding more mods to quick mod menu switch." - ) - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - public boolean modMenuLog = false; + @Expose + @ConfigOption( + name = "Mod Menu Log", + desc = "Enables debug messages when the currently opened GUI changes, with the path to the gui class. " + + "Useful for adding more mods to quick mod menu switch." + ) + @ConfigEditorBoolean + public boolean modMenuLog = false; - @Expose - @ConfigOption(name = "Show Internal Name", desc = "Show internal names in item lore.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - public boolean showInternalName = false; + @Expose + @ConfigOption(name = "Show Internal Name", desc = "Show internal names in item lore.") + @ConfigEditorBoolean + public boolean showInternalName = false; - @Expose - @ConfigOption(name = "Show Empty Internal Names", desc = "Shows internal name even for items with none.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - public boolean showEmptyNames = false; + @Expose + @ConfigOption(name = "Show Empty Internal Names", desc = "Shows internal name even for items with none.") + @ConfigEditorBoolean + public boolean showEmptyNames = false; - @Expose - @ConfigOption(name = "Show Item Rarity", desc = "Show item rarities in item lore.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - public boolean showItemRarity = false; + @Expose + @ConfigOption(name = "Show Item Rarity", desc = "Show item rarities in item lore.") + @ConfigEditorBoolean + public boolean showItemRarity = false; - @Expose - @ConfigOption(name = "Copy Internal Name", desc = "Copies the internal name of an item on key press in the clipboard.") - @ConfigEditorKeybind(defaultKey = Keyboard.KEY_NONE) - @ConfigAccordionId(id = 0) - public int copyInternalName = Keyboard.KEY_NONE; + @Expose + @ConfigOption(name = "Copy Internal Name", desc = "Copies the internal name of an item on key press in the clipboard.") + @ConfigEditorKeybind(defaultKey = Keyboard.KEY_NONE) + public int copyInternalName = Keyboard.KEY_NONE; - @Expose - @ConfigOption(name = "Show NPC Price", desc = "Show NPC price in item lore.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - public boolean showNpcPrice = false; + @Expose + @ConfigOption(name = "Show NPC Price", desc = "Show NPC price in item lore.") + @ConfigEditorBoolean + public boolean showNpcPrice = false; - @Expose - @ConfigOption(name = "Show Item UUID", desc = "Show the Unique Identifier of items in the lore.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - public boolean showItemUuid = false; + @Expose + @ConfigOption(name = "Show Item UUID", desc = "Show the Unique Identifier of items in the lore.") + @ConfigEditorBoolean + public boolean showItemUuid = false; - @Expose - @ConfigOption(name = "Copy NBT Data", desc = "Copies compressed NBT data on key press in a GUI") - @ConfigEditorKeybind(defaultKey = Keyboard.KEY_NONE) - @ConfigAccordionId(id = 0) - public int copyNBTDataCompressed = Keyboard.KEY_NONE; + @Expose + @ConfigOption(name = "Copy NBT Data", desc = "Copies compressed NBT data on key press in a GUI") + @ConfigEditorKeybind(defaultKey = Keyboard.KEY_NONE) + public int copyNBTDataCompressed = Keyboard.KEY_NONE; - @Expose - @ConfigOption(name = "Copy RNG Meter", desc = "Copies internal names and maxed XP needed from RNG meter inventories as json to clipboard.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - public boolean copyRngMeter = false; + @Expose + @ConfigOption(name = "Copy RNG Meter", desc = "Copies internal names and maxed XP needed from RNG meter inventories as json to clipboard.") + @ConfigEditorBoolean + public boolean copyRngMeter = false; - @Expose + @Expose @ConfigOption(name = "Copy Bestiary Data", desc = "Copies the bestiary data from the inventory as json to clipboard.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - public boolean copyBestiaryData = false; + @ConfigEditorBoolean + public boolean copyBestiaryData = false; - @Expose - @ConfigOption(name = "Highlight Missing Repo Items", desc = "Highlights each item in the current inventory that is not in your current NEU repo.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - public boolean highlightMissingRepo = false; + @Expose + @ConfigOption(name = "Highlight Missing Repo Items", desc = "Highlights each item in the current inventory that is not in your current NEU repo.") + @ConfigEditorBoolean + public boolean highlightMissingRepo = false; + } @Expose @ConfigOption(name = "Slot Number", desc = "Show slot number in inventory while pressing this key.") @@ -113,9 +99,9 @@ public class DevConfig { @ConfigOption(name = "Parkour Waypoints", desc = "") @Accordion @Expose - public Waypoints waypoint = new Waypoints(); + public WaypointsConfig waypoint = new WaypointsConfig(); - public static class Waypoints { + public static class WaypointsConfig { @Expose @ConfigOption(name = "Save Hotkey", desc = "Saves block location to a temporarily parkour and copies everything to your clipboard.") @@ -142,97 +128,87 @@ public class DevConfig { @Expose @ConfigOption(name = "Minecraft Console", desc = "") - @ConfigEditorAccordion(id = 1) - public boolean minecraftConsole = false; - - @Expose - @ConfigOption(name = "Unfiltered Debug", desc = "Print the debug information for unfiltered console messages.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - public boolean printUnfilteredDebugs = false; - - @Expose - @ConfigOption(name = "Unfiltered Debug File", desc = "Print the debug information into log files instead of into the console for unfiltered console messages.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - public boolean logUnfilteredFile = false; - - @Expose - @ConfigOption( - name = "Outside SkyBlock", - desc = "Print the debug information for unfiltered console messages outside SkyBlock too." - ) - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - public boolean printUnfilteredDebugsOutsideSkyBlock = false; - - @Expose - @ConfigOption( - name = "Log Filtered", - desc = "Log the filtered messages into the console." - ) - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - public boolean printFilteredReason = false; - - @Expose - @ConfigOption(name = "Console Filters", desc = "") - @ConfigAccordionId(id = 1) - @ConfigEditorAccordion(id = 2) - public boolean consoleFilters = false; - - @Expose - @ConfigOption(name = "Filter Chat", desc = "Filter chat messages.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - public boolean filterChat = false; - - @Expose - @ConfigOption(name = "Filter Grow Buffer", desc = "Filter 'Needed to grow BufferBuilder buffer:'") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - public boolean filterGrowBuffer = true; - - @Expose - @ConfigOption(name = "Filter Sound Error", desc = "Filter 'Unable to play unknown soundEvent'.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - public boolean filterUnknownSound = true; - - @Expose - @ConfigOption(name = "Filter Scoreboard Errors", desc = "Filter error messages with Scoreboard: removeTeam, createTeam, " + - "removeObjective and 'scoreboard team already exists'.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - public boolean filterScoreboardErrors = true; + @Accordion + public MinecraftConsoleConfig minecraftConsoles = new MinecraftConsoleConfig(); - @Expose - @ConfigOption(name = "Filter Particle", desc = "Filter message 'Could not spawn particle effect VILLAGER_HAPPY'.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - public boolean filterParticleVillagerHappy = true; + public static class MinecraftConsoleConfig{ + @Expose + @ConfigOption(name = "Unfiltered Debug", desc = "Print the debug information for unfiltered console messages.") + @ConfigEditorBoolean + public boolean printUnfilteredDebugs = false; - @Expose - @ConfigOption(name = "Filter OptiFine", desc = "Filter OptiFine messages CustomItems and ConnectedTextures during loading.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - public boolean filterOptiFine = true; + @Expose + @ConfigOption(name = "Unfiltered Debug File", desc = "Print the debug information into log files instead of into the console for unfiltered console messages.") + @ConfigEditorBoolean + public boolean logUnfilteredFile = false; - @Expose - @ConfigOption(name = "Filter AsmHelper Transformer", desc = "Filter messages when AsmHelper is Transforming a class during loading.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - public boolean filterAmsHelperTransformer = true; + @Expose + @ConfigOption( + name = "Outside SkyBlock", + desc = "Print the debug information for unfiltered console messages outside SkyBlock too." + ) + @ConfigEditorBoolean + public boolean printUnfilteredDebugsOutsideSkyBlock = false; - @Expose - @ConfigOption(name = "Filter Applying AsmWriter", desc = "Filter messages when AsmHelper is applying AsmWriter ModifyWriter.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - public boolean filterAsmHelperApplying = true; + @Expose + @ConfigOption( + name = "Log Filtered", + desc = "Log the filtered messages into the console." + ) + @ConfigEditorBoolean + public boolean printFilteredReason = false; - @Expose - @ConfigOption(name = "Filter Biome ID Bounds", desc = "Filter message 'Biome ID is out of bounds'.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - public boolean filterBiomeIdBounds = true; + @Expose + @ConfigOption(name = "Console Filters", desc = "") + @Accordion + public ConsoleFiltersConfig consoleFilter = new ConsoleFiltersConfig(); + + public static class ConsoleFiltersConfig{ + @Expose + @ConfigOption(name = "Filter Chat", desc = "Filter chat messages.") + @ConfigEditorBoolean + public boolean filterChat = false; + + @Expose + @ConfigOption(name = "Filter Grow Buffer", desc = "Filter 'Needed to grow BufferBuilder buffer:'") + @ConfigEditorBoolean + public boolean filterGrowBuffer = true; + + @Expose + @ConfigOption(name = "Filter Sound Error", desc = "Filter 'Unable to play unknown soundEvent'.") + @ConfigEditorBoolean + public boolean filterUnknownSound = true; + + @Expose + @ConfigOption(name = "Filter Scoreboard Errors", desc = "Filter error messages with Scoreboard: removeTeam, createTeam, " + + "removeObjective and 'scoreboard team already exists'.") + @ConfigEditorBoolean + public boolean filterScoreboardErrors = true; + + @Expose + @ConfigOption(name = "Filter Particle", desc = "Filter message 'Could not spawn particle effect VILLAGER_HAPPY'.") + @ConfigEditorBoolean + public boolean filterParticleVillagerHappy = true; + + @Expose + @ConfigOption(name = "Filter OptiFine", desc = "Filter OptiFine messages CustomItems and ConnectedTextures during loading.") + @ConfigEditorBoolean + public boolean filterOptiFine = true; + + @Expose + @ConfigOption(name = "Filter AsmHelper Transformer", desc = "Filter messages when AsmHelper is Transforming a class during loading.") + @ConfigEditorBoolean + public boolean filterAmsHelperTransformer = true; + + @Expose + @ConfigOption(name = "Filter Applying AsmWriter", desc = "Filter messages when AsmHelper is applying AsmWriter ModifyWriter.") + @ConfigEditorBoolean + public boolean filterAsmHelperApplying = true; + + @Expose + @ConfigOption(name = "Filter Biome ID Bounds", desc = "Filter message 'Biome ID is out of bounds'.") + @ConfigEditorBoolean + public boolean filterBiomeIdBounds = true; + } + } } diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/DungeonConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/DungeonConfig.java index c4c241ad0..20b6e0295 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/DungeonConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/DungeonConfig.java @@ -4,8 +4,6 @@ import at.hannibal2.skyhanni.config.FeatureToggle; import at.hannibal2.skyhanni.config.core.config.Position; import com.google.gson.annotations.Expose; import io.github.moulberry.moulconfig.annotations.Accordion; -import io.github.moulberry.moulconfig.annotations.ConfigAccordionId; -import io.github.moulberry.moulconfig.annotations.ConfigEditorAccordion; import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; import io.github.moulberry.moulconfig.annotations.ConfigOption; @@ -35,24 +33,24 @@ public class DungeonConfig { @Expose public Position deathCounterPos = new Position(10, 10, false, true); - @ConfigOption(name = "Clean End", desc = "") - @ConfigEditorAccordion(id = 2) - public boolean cleanEnd = false; - @Expose - @ConfigOption(name = "Clean Ending", desc = "After the last Dungeon boss has died, all entities and " + - "particles are no longer displayed and the music stops playing, but the loot chests are still displayed.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - @FeatureToggle - public boolean cleanEndToggle = false; + @ConfigOption(name = "Clean End", desc = "") + @Accordion + public CleanEndConfig cleanEnd = new CleanEndConfig(); + public static class CleanEndConfig{ + @Expose + @ConfigOption(name = "Clean Ending", desc = "After the last Dungeon boss has died, all entities and " + + "particles are no longer displayed and the music stops playing, but the loot chests are still displayed.") + @ConfigEditorBoolean + @FeatureToggle + public boolean toggle = false; - @Expose - @ConfigOption(name = "Ignore Guardians", desc = "Ignore F3 and M3 Guardians from the clean end feature when " + - "sneaking. Makes it easier to kill them after the boss died already. Thanks Hypixel.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - public boolean cleanEndF3IgnoreGuardians = false; + @Expose + @ConfigOption(name = "Ignore Guardians", desc = "Ignore F3 and M3 Guardians from the clean end feature when " + + "sneaking. Makes it easier to kill them after the boss died already. Thanks Hypixel.") + @ConfigEditorBoolean + public boolean F3IgnoreGuardians = false; + } @Expose @ConfigOption(name = "Boss Damage Splash", desc = "Hides damage splashes while inside the boss room (fixes a Skytils feature).") @@ -73,101 +71,101 @@ public class DungeonConfig { public boolean highlightTeammates = true; + @Expose @ConfigOption(name = "Object Hider", desc = "Hide various things in Dungeons.") - @ConfigEditorAccordion(id = 3) - public boolean objectHider = false; + @Accordion + public ObjectHiderConfig objectHider = new ObjectHiderConfig(); + public static class ObjectHiderConfig { + @Expose + @ConfigOption(name = "Hide Superboom TNT", desc = "Hide Superboom TNT laying around in Dungeons.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hideSuperboomTNT = false; - @Expose - @ConfigOption(name = "Hide Superboom TNT", desc = "Hide Superboom TNT laying around in Dungeons.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 3) - @FeatureToggle - public boolean hideSuperboomTNT = false; + @Expose + @ConfigOption(name = "Hide Blessings", desc = "Hide Blessings laying around in Dungeons.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hideBlessing = false; - @Expose - @ConfigOption(name = "Hide Blessings", desc = "Hide Blessings laying around in Dungeons.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 3) - @FeatureToggle - public boolean hideBlessing = false; + @Expose + @ConfigOption(name = "Hide Revive Stones", desc = "Hide Revive Stones laying around in Dungeons.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hideReviveStone = false; - @Expose - @ConfigOption(name = "Hide Revive Stones", desc = "Hide Revive Stones laying around in Dungeons.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 3) - @FeatureToggle - public boolean hideReviveStone = false; + @Expose + @ConfigOption(name = "Hide Premium Flesh", desc = "Hide Premium Flesh laying around in Dungeons.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hidePremiumFlesh = false; - @Expose - @ConfigOption(name = "Hide Premium Flesh", desc = "Hide Premium Flesh laying around in Dungeons.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 3) - @FeatureToggle - public boolean hidePremiumFlesh = false; + @Expose + @ConfigOption(name = "Hide Journal Entry", desc = "Hide Journal Entry pages laying around in Dungeons.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hideJournalEntry = false; - @Expose - @ConfigOption(name = "Hide Journal Entry", desc = "Hide Journal Entry pages laying around in Dungeons.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 3) - @FeatureToggle - public boolean hideJournalEntry = false; + @Expose + @ConfigOption(name = "Hide Skeleton Skull", desc = "Hide Skeleton Skulls laying around in Dungeons.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hideSkeletonSkull = true; - @Expose - @ConfigOption(name = "Hide Skeleton Skull", desc = "Hide Skeleton Skulls laying around in Dungeons.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 3) - @FeatureToggle - public boolean hideSkeletonSkull = true; + @Expose + @ConfigOption(name = "Hide Healer Orbs", desc = "Hides the damage, ability damage and defensive orbs that spawn when the Healer kills mobs.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hideHealerOrbs = false; - @Expose - @ConfigOption(name = "Hide Healer Orbs", desc = "Hides the damage, ability damage and defensive orbs that spawn when the Healer kills mobs.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 3) - @FeatureToggle - public boolean hideHealerOrbs = false; + @Expose + @ConfigOption(name = "Hide Healer Fairy", desc = "Hide the Golden Fairy that follows the Healer in Dungeons.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hideHealerFairy = false; + } @Expose - @ConfigOption(name = "Hide Healer Fairy", desc = "Hide the Golden Fairy that follows the Healer in Dungeons.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 3) - @FeatureToggle - public boolean hideHealerFairy = false; - @ConfigOption(name = "Message Filter", desc = "") - @ConfigEditorAccordion(id = 4) - public boolean messageFilter = false; + @Accordion + public MessageFilterConfig messageFilter = new MessageFilterConfig(); - @Expose - @ConfigOption(name = "Keys and Doors", desc = "Hides the chat message when picking up keys or opening doors in Dungeons.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 4) - @FeatureToggle - public boolean messageFilterKeysAndDoors = false; + public static class MessageFilterConfig{ + @Expose + @ConfigOption(name = "Keys and Doors", desc = "Hides the chat message when picking up keys or opening doors in Dungeons.") + @ConfigEditorBoolean + @FeatureToggle + public boolean keysAndDoors = false; + } + @Expose @ConfigOption(name = "Dungeon Copilot", desc = "") - @ConfigEditorAccordion(id = 5) - public boolean dungeonCopilot = false; + @Accordion + public DungeonCopilotConfig dungeonCopilot = new DungeonCopilotConfig(); - @Expose - @ConfigOption(name = "Copilot Enabled", desc = "Suggests what to do next in Dungeons.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 5) - @FeatureToggle - public boolean copilotEnabled = false; + public static class DungeonCopilotConfig{ + @Expose + @ConfigOption(name = "Copilot Enabled", desc = "Suggests what to do next in Dungeons.") + @ConfigEditorBoolean + @FeatureToggle + public boolean enabled = false; - @Expose - public Position copilotPos = new Position(10, 10, false, true); + @Expose + public Position pos = new Position(10, 10, false, true); + } - @ConfigOption(name = "Party Finder", desc = "") - @ConfigEditorAccordion(id = 6) - public boolean partyFinder = false; @Expose - @ConfigOption(name = "Colored Class Level", desc = "Color class levels in Party Finder.") - @ConfigAccordionId(id = 6) - @ConfigEditorBoolean - @FeatureToggle - public boolean partyFinderColoredClassLevel = true; + @ConfigOption(name = "Party Finder", desc = "") + @Accordion + public PartyFinderConfig partyFinder = new PartyFinderConfig(); + public static class PartyFinderConfig { + @Expose + @ConfigOption(name = "Colored Class Level", desc = "Color class levels in Party Finder.") + @ConfigEditorBoolean + @FeatureToggle + public boolean coloredClassLevel = true; + } @Expose @ConfigOption(name = "Tab List", desc = "") diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/EventConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/EventConfig.java index b0bcf8e04..a349fb2f0 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/EventConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/EventConfig.java @@ -4,7 +4,6 @@ import at.hannibal2.skyhanni.config.FeatureToggle; import at.hannibal2.skyhanni.config.core.config.Position; import com.google.gson.annotations.Expose; import io.github.moulberry.moulconfig.annotations.Accordion; -import io.github.moulberry.moulconfig.annotations.ConfigAccordionId; import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; import io.github.moulberry.moulconfig.annotations.ConfigEditorDraggableList; import io.github.moulberry.moulconfig.annotations.ConfigEditorKeybind; @@ -28,9 +27,9 @@ public class EventConfig { @Expose @ConfigOption(name = "Bingo Card", desc = "") @Accordion - public BingoCard bingoCard = new BingoCard(); + public BingoCardConfig bingoCard = new BingoCardConfig(); - public static class BingoCard { + public static class BingoCardConfig { @Expose @ConfigOption(name = "Enable", desc = "Displays the Bingo Card.") @ConfigEditorBoolean @@ -70,9 +69,9 @@ public class EventConfig { @Expose @ConfigOption(name = "Compact Chat Messages", desc = "") @Accordion - public CompactChat compactChat = new CompactChat(); + public CompactChatConfig compactChat = new CompactChatConfig(); - public static class CompactChat { + public static class CompactChatConfig { @Expose @ConfigOption(name = "Enable", desc = "Shortens chat messages about skill level ups, collection gains, " + @@ -160,10 +159,9 @@ public class EventConfig { @Expose @ConfigOption(name = "Inquisitor Waypoint Sharing", desc = "") @Accordion - @ConfigAccordionId(id = 9) - public InquisitorSharing inquisitorSharing = new InquisitorSharing(); + public InquisitorSharingConfig inquisitorSharing = new InquisitorSharingConfig(); - public static class InquisitorSharing { + public static class InquisitorSharingConfig { @Expose @ConfigOption(name = "Enabled", desc = "Shares your Inquisitor and receiving other Inquisitors via Party Chat.") @@ -330,9 +328,9 @@ public class EventConfig { // @ConfigOption(name = "300þ Anniversary Celebration", desc = "Features for the 300þ year of SkyBlock") @Accordion @Expose - public Century century = new Century(); + public CenturyConfig century = new CenturyConfig(); - public static class Century { + public static class CenturyConfig { @ConfigOption(name = "Enable Active Player Timer", desc = "Show a HUD telling you how much longer you have to wait to be eligible for another free ticket.") @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/FishingConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/FishingConfig.java index f05f8ea22..70957e0ea 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/FishingConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/FishingConfig.java @@ -4,8 +4,6 @@ import at.hannibal2.skyhanni.config.FeatureToggle; import at.hannibal2.skyhanni.config.core.config.Position; import com.google.gson.annotations.Expose; import io.github.moulberry.moulconfig.annotations.Accordion; -import io.github.moulberry.moulconfig.annotations.ConfigAccordionId; -import io.github.moulberry.moulconfig.annotations.ConfigEditorAccordion; import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; import io.github.moulberry.moulconfig.annotations.ConfigEditorColour; import io.github.moulberry.moulconfig.annotations.ConfigEditorDropdown; @@ -91,89 +89,85 @@ public class FishingConfig { public boolean odgerLocation = true; } + @Expose @ConfigOption(name = "Thunder Spark", desc = "") - @ConfigEditorAccordion(id = 1) - public boolean thunderSpark = false; + @Accordion + public ThunderSparkConfig thunderSpark = new ThunderSparkConfig(); + public static class ThunderSparkConfig { + @Expose + @ConfigOption(name = "Thunder Spark Highlight", desc = "Highlight Thunder Sparks after killing a Thunder.") + @ConfigEditorBoolean + @FeatureToggle + public boolean highlight = false; - @Expose - @ConfigOption(name = "Thunder Spark Highlight", desc = "Highlight Thunder Sparks after killing a Thunder.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - @FeatureToggle - public boolean thunderSparkHighlight = false; + @Expose + @ConfigOption(name = "Thunder Spark Color", desc = "Color of the Thunder Sparks.") + @ConfigEditorColour + public String color = "0:255:255:255:255"; + } @Expose - @ConfigOption(name = "Thunder Spark Color", desc = "Color of the Thunder Sparks.") - @ConfigEditorColour - @ConfigAccordionId(id = 1) - public String thunderSparkColor = "0:255:255:255:255"; - @ConfigOption(name = "Barn Fishing Timer", desc = "") - @ConfigEditorAccordion(id = 2) - public boolean barnTimer_ = false; - - @Expose - @ConfigOption( - name = "Barn Fishing Timer", - desc = "Show the time and amount of sea creatures while fishing on the barn via hub." - ) - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - @FeatureToggle - public boolean barnTimer = true; + @Accordion + public BarnTimerConfig barnTimer = new BarnTimerConfig(); + public static class BarnTimerConfig{ + @Expose + @ConfigOption( + name = "Barn Fishing Timer", + desc = "Show the time and amount of sea creatures while fishing on the barn via hub." + ) + @ConfigEditorBoolean + @FeatureToggle + public boolean enabled = true; - @Expose - public Position barnTimerPos = new Position(10, 10, false, true); + @Expose + @ConfigOption( + name = "Worm Fishing", + desc = "Show the Barn Fishing Timer even for worms or other sea creatures in the Crystal Hollows." + ) + @ConfigEditorBoolean + public boolean crystalHollows = true; - @Expose - @ConfigOption( - name = "Worm Fishing", - desc = "Show the Barn Fishing Timer even for worms or other sea creatures in the Crystal Hollows." - ) - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - public boolean barnTimerCrystalHollows = true; + @Expose + @ConfigOption( + name = "Stranded Fishing", + desc = "Show the Barn Fishing Timer even on all the different islands Stranded players can visit." + ) + @ConfigEditorBoolean + public boolean forStranded = true; - @Expose - @ConfigOption( - name = "Stranded Fishing", - desc = "Show the Barn Fishing Timer even on all the different islands Stranded players can visit." - ) - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - public boolean barnTimerForStranded = true; + @Expose + @ConfigOption( + name = "Worm Cap Alert", + desc = "Alerts you with sound if you hit the Worm Sea Creature limit of 60." + ) + @ConfigEditorBoolean + public boolean wormLimitAlert = true; - @Expose - @ConfigOption( - name = "Worm Cap Alert", - desc = "Alerts you with sound if you hit the Worm Sea Creature limit of 60." - ) - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - public boolean wormLimitAlert = true; + @Expose + @ConfigOption(name = "Reset Timer Hotkey", desc = "Press this key to reset the timer manualy") + @ConfigEditorKeybind(defaultKey = Keyboard.KEY_NONE) + public int manualResetTimer = Keyboard.KEY_NONE; - @Expose - @ConfigOption(name = "Reset Timer Hotkey", desc = "Press this key to reset the timer manualy") - @ConfigEditorKeybind(defaultKey = Keyboard.KEY_NONE) - @ConfigAccordionId(id = 2) - public int manualResetTimer = Keyboard.KEY_NONE; + @Expose + @ConfigOption(name = "Fishing Timer Alert", desc = "Change the amount of time in seconds until the timer dings.") + @ConfigEditorSlider( + minValue = 240, + maxValue = 360, + minStep = 10 + ) + public int alertTime = 330; - @Expose - @ConfigOption(name = "Fishing Timer Alert", desc = "Change the amount of time in seconds until the timer dings.") - @ConfigEditorSlider( - minValue = 240, - maxValue = 360, - minStep = 10 - ) - @ConfigAccordionId(id = 2) - public int barnTimerAlertTime = 330; + @Expose + public Position pos = new Position(10, 10, false, true); + } @Expose @ConfigOption(name = "Chum/Chumcap Bucket Hider", desc = "") @Accordion - public ChumBucketHider chumBucketHider = new ChumBucketHider(); + public ChumBucketHiderConfig chumBucketHider = new ChumBucketHiderConfig(); - public static class ChumBucketHider { + public static class ChumBucketHiderConfig { @Expose @ConfigOption(name = "Enable", desc = "Hide the Chum/Chumcap Bucket name tags for other players.") @@ -195,9 +189,9 @@ public class FishingConfig { @Expose @ConfigOption(name = "Fished Item Name", desc = "") @Accordion - public FishedItemName fishedItemName = new FishedItemName(); + public FishedItemNameConfig fishedItemName = new FishedItemNameConfig(); - public static class FishedItemName { + public static class FishedItemNameConfig { @Expose @ConfigOption(name = "Enabled", desc = "Show the fished item name above the item when fishing.") @@ -215,9 +209,9 @@ public class FishingConfig { @Expose @ConfigOption(name = "Fishing Hook Display", desc = "") @Accordion - public FishingHookDisplay fishingHookDisplay = new FishingHookDisplay(); + public FishingHookDisplayConfig fishingHookDisplay = new FishingHookDisplayConfig(); - public static class FishingHookDisplay { + public static class FishingHookDisplayConfig { @Expose @ConfigOption(name = "Enabled", desc = "Display the Hypixel timer until the fishing hook can be pulled out of the water/lava, only bigger and on your screen.") diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/GardenConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/GardenConfig.java index a74895a7f..ad1643128 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/GardenConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/GardenConfig.java @@ -7,8 +7,6 @@ import at.hannibal2.skyhanni.features.garden.inventory.GardenPlotIcon; import at.hannibal2.skyhanni.utils.LorenzUtils; import com.google.gson.annotations.Expose; import io.github.moulberry.moulconfig.annotations.Accordion; -import io.github.moulberry.moulconfig.annotations.ConfigAccordionId; -import io.github.moulberry.moulconfig.annotations.ConfigEditorAccordion; import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; import io.github.moulberry.moulconfig.annotations.ConfigEditorButton; import io.github.moulberry.moulconfig.annotations.ConfigEditorDraggableList; @@ -25,1307 +23,1207 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -@SuppressWarnings("deprecation") public class GardenConfig { @Expose @ConfigOption(name = "SkyMart", desc = "") - @ConfigEditorAccordion(id = 0) - public boolean skyMart = false; - - @Expose - @ConfigOption(name = "Copper Price", desc = "Show copper to coin prices inside the SkyMart inventory.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - @FeatureToggle - public boolean skyMartCopperPrice = true; + @Accordion + public SkyMartConfig skyMart = new SkyMartConfig(); + public static class SkyMartConfig{ + @Expose + @ConfigOption(name = "Copper Price", desc = "Show copper to coin prices inside the SkyMart inventory.") + @ConfigEditorBoolean + @FeatureToggle + public boolean copperPrice = true; - @Expose - @ConfigOption(name = "Advanced Stats", desc = "Show the BIN price and copper price for every item.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - public boolean skyMartCopperPriceAdvancedStats = false; + @Expose + @ConfigOption(name = "Advanced Stats", desc = "Show the BIN price and copper price for every item.") + @ConfigEditorBoolean + public boolean copperPriceAdvancedStats = false; - @Expose - public Position skyMartCopperPricePos = new Position(211, 132, false, true); + @Expose + public Position copperPricePos = new Position(211, 132, false, true); + } @Expose @ConfigOption(name = "Visitor", desc = "") - @ConfigEditorAccordion(id = 1) - public boolean visitor = false; - - @Expose - @ConfigOption(name = "Visitor Timer", desc = "") - @ConfigAccordionId(id = 1) - @ConfigEditorAccordion(id = 2) - public boolean visitorTimer = false; - - @Expose - @ConfigOption(name = "Visitor Timer", desc = "Timer when the next visitor will appear, " + - "and a number for how many visitors are already waiting.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - @FeatureToggle - public boolean visitorTimerEnabled = true; - - @Expose - @ConfigOption(name = "Sixth Visitor Estimate", desc = "Estimate when the sixth visitor in the queue will arrive. " + - "May be inaccurate with co-op members farming simultaneously.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - public boolean visitorTimerSixthVisitorEnabled = true; - - @Expose - @ConfigOption(name = "Sixth Visitor Warning", desc = "Notifies when it is believed that the sixth visitor has arrived. " + - "May be inaccurate with co-op members farming simultaneously.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - public boolean visitorTimerSixthVisitorWarning = true; - - @Expose - public Position visitorTimerPos = new Position(390, 65, false, true); - - @Expose - @ConfigOption(name = "Visitor Items Needed", desc = "") - @ConfigAccordionId(id = 1) - @ConfigEditorAccordion(id = 3) - public boolean visitorNeeds = false; - - @Expose - @ConfigOption(name = "Items Needed", desc = "Show all items needed for the visitors.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 3) - @FeatureToggle - public boolean visitorNeedsDisplay = true; - - @Expose - public Position visitorNeedsPos = new Position(180, 170, false, true); + @Accordion + public VisitorConfig visitors = new VisitorConfig(); + public static class VisitorConfig{ + @Expose + @ConfigOption(name = "Visitor Timer", desc = "") + @Accordion + public TimerConfig timer = new TimerConfig(); + public static class TimerConfig{ + @Expose + @ConfigOption(name = "Visitor Timer", desc = "Timer when the next visitor will appear, " + + "and a number for how many visitors are already waiting.") + @ConfigEditorBoolean + @FeatureToggle + public boolean enabled = true; + + @Expose + @ConfigOption(name = "Sixth Visitor Estimate", desc = "Estimate when the sixth visitor in the queue will arrive. " + + "May be inaccurate with co-op members farming simultaneously.") + @ConfigEditorBoolean + public boolean sixthVisitorEnabled = true; + + @Expose + @ConfigOption(name = "Sixth Visitor Warning", desc = "Notifies when it is believed that the sixth visitor has arrived. " + + "May be inaccurate with co-op members farming simultaneously.") + @ConfigEditorBoolean + public boolean sixthVisitorWarning = true; + + @Expose + public Position pos = new Position(390, 65, false, true); + } - @Expose - @ConfigOption(name = "Only when Close", desc = "Only show the needed items when close to the visitors.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 3) - public boolean visitorNeedsOnlyWhenClose = false; + @Expose + @ConfigOption(name = "Visitor Items Needed", desc = "") + @Accordion + public NeedsConfig needs = new NeedsConfig(); + public static class NeedsConfig{ + @Expose + @ConfigOption(name = "Items Needed", desc = "Show all items needed for the visitors.") + @ConfigEditorBoolean + @FeatureToggle + public boolean display = true; + + @Expose + public Position pos = new Position(180, 170, false, true); + + @Expose + @ConfigOption(name = "Only when Close", desc = "Only show the needed items when close to the visitors.") + @ConfigEditorBoolean + public boolean onlyWhenClose = false; + + @Expose + @ConfigOption(name = "Bazaar Alley", desc = "Show the Visitor Items List while inside the Bazaar Alley in the Hub. " + + "This helps buying the correct amount when not having a Booster Cookie Buff active.") + @ConfigEditorBoolean + public boolean inBazaarAlley = true; + + @Expose + @ConfigOption(name = "Show Price", desc = "Show the coin price in the items needed list.") + @ConfigEditorBoolean + public boolean showPrice = true; + + @Expose + @ConfigOption(name = "Item Preview", desc = "Show the base type for the required items next to new visitors. §cNote that some visitors may require any crop.") + @ConfigEditorBoolean + @FeatureToggle + public boolean itemPreview = true; + } - @Expose - @ConfigOption(name = "Bazaar Alley", desc = "Show the Visitor Items List while inside the Bazaar Alley in the Hub. " + - "This helps buying the correct amount when not having a Booster Cookie Buff active.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 3) - public boolean visitorNeedsInBazaarAlley = true; + @Expose + @ConfigOption(name = "Visitor Inventory", desc = "") + @Accordion + public InventoryConfig inventory = new InventoryConfig(); + public static class InventoryConfig{ + @Expose + @ConfigOption(name = "Visitor Price", desc = "Show the Bazaar price of the items required for the visitors, like in NEU.") + @ConfigEditorBoolean + @FeatureToggle + public boolean showPrice = false; + + @Expose + @ConfigOption(name = "Amount and Time", desc = "Show the exact item amount and the remaining time when farmed manually. Especially useful for Ironman.") + @ConfigEditorBoolean + public boolean exactAmountAndTime = true; + + @Expose + @ConfigOption(name = "Copper Price", desc = "Show the price per copper inside the visitor GUI.") + @ConfigEditorBoolean + @FeatureToggle + public boolean copperPrice = true; + + @Expose + @ConfigOption(name = "Copper Time", desc = "Show the time required per copper inside the visitor GUI.") + @ConfigEditorBoolean + @FeatureToggle + public boolean copperTime = false; + + @Expose + @ConfigOption(name = "Garden Exp Price", desc = "Show the price per garden experience inside the visitor GUI.") + @ConfigEditorBoolean + @FeatureToggle + public boolean experiencePrice = false; + } - @Expose - @ConfigOption(name = "Show Price", desc = "Show the coin price in the items needed list.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 3) - public boolean visitorNeedsShowPrice = true; + @Expose + @ConfigOption(name = "Visitor Reward Warning", desc = "") + @Accordion + public RewardWarningConfig rewardWarning = new RewardWarningConfig(); + public static class RewardWarningConfig { + + @Expose + @ConfigOption(name = "Notify in Chat", desc = "Send a chat message once you talk to a visitor with reward.") + @ConfigEditorBoolean + @FeatureToggle + public boolean notifyInChat = true; + + @Expose + @ConfigOption(name = "Show over Name", desc = "Show the reward name above the visitor name.") + @ConfigEditorBoolean + @FeatureToggle + public boolean showOverName = true; + + @Expose + @ConfigOption(name = "Prevent Refusing", desc = "Prevent the refusal of a visitor with reward.") + @ConfigEditorBoolean + @FeatureToggle + public boolean preventRefusing = true; + + @Expose + @ConfigOption(name = "Bypass Key", desc = "Hold that key to bypass the Prevent Refusing feature.") + @ConfigEditorKeybind(defaultKey = Keyboard.KEY_NONE) + public int bypassKey = Keyboard.KEY_NONE; + + + /** + * Sync up with {at.hannibal2.skyhanni.features.garden.visitor.VisitorReward} + */ + @Expose + @ConfigOption( + name = "Items", + desc = "Warn for these reward items." + ) + @ConfigEditorDraggableList( + exampleText = { + "§9Flowering Bouquet", + "§9Overgrown Grass", + "§9Green Bandana", + "§9Dedication IV", + "§9Music Rune", + "§cSpace Helmet", + "§9Cultivating I", + "§9Replenish I", + } + ) + public List drops = new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5, 6)); + } - @Expose - @ConfigOption(name = "Item Preview", desc = "Show the base type for the required items next to new visitors. §cNote that some visitors may require any crop.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 3) - @FeatureToggle - public boolean visitorItemPreview = true; + @Expose + @ConfigOption(name = "Notification Chat", desc = "Show in chat when a new visitor is visiting your island.") + @ConfigEditorBoolean + @FeatureToggle + public boolean notificationChat = true; - @Expose - @ConfigOption(name = "Visitor Inventory", desc = "") - @ConfigAccordionId(id = 1) - @ConfigEditorAccordion(id = 4) - public boolean visitorInventory = false; + @Expose + @ConfigOption(name = "Notification Title", desc = "Show a title when a new visitor is visiting your island.") + @ConfigEditorBoolean + @FeatureToggle + public boolean notificationTitle = true; - @Expose - @ConfigOption(name = "Visitor Price", desc = "Show the Bazaar price of the items required for the visitors, like in NEU.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 4) - @FeatureToggle - public boolean visitorShowPrice = false; + @Expose + @ConfigOption(name = "Highlight Status", desc = "Highlight the status for visitors with a text above or with color.") + @ConfigEditorDropdown(values = {"Color Only", "Name Only", "Both", "Disabled"}) + public int highlightStatus = 2; - @Expose - @ConfigOption(name = "Amount and Time", desc = "Show the exact item amount and the remaining time when farmed manually. Especially useful for Ironman.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 4) - public boolean visitorExactAmountAndTime = true; + @Expose + @ConfigOption(name = "Colored Name", desc = "Show the visitor name in the color of the rarity.") + @ConfigEditorBoolean + @FeatureToggle + public boolean coloredName = true; - @Expose - @ConfigOption(name = "Copper Price", desc = "Show the price per copper inside the visitor GUI.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 4) - @FeatureToggle - public boolean visitorCopperPrice = true; + @Expose + @ConfigOption(name = "Hypixel Message", desc = "Hide the chat message from Hypixel that a new visitor has arrived at your garden.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hypixelArrivedMessage = true; - @Expose - @ConfigOption(name = "Copper Time", desc = "Show the time required per copper inside the visitor GUI.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 4) - @FeatureToggle - public boolean visitorCopperTime = false; + @Expose + @ConfigOption(name = "Hide Chat", desc = "Hide chat messages from the visitors in garden. (Except Beth and Spaceman)") + @ConfigEditorBoolean + @FeatureToggle + public boolean hideChat = true; - @Expose - @ConfigOption(name = "Garden Exp Price", desc = "Show the price per garden experience inside the visitor GUI.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 4) - @FeatureToggle - public boolean visitorExperiencePrice = false; + @Expose + @ConfigOption(name = "Visitor Drops Statistics Counter", desc = "") + @Accordion + public DropsStatisticsConfig dropsStatistics = new DropsStatisticsConfig(); + + public static class DropsStatisticsConfig { + + @Expose + @ConfigOption( + name = "Enabled", + desc = "Tallies up statistic about visitors and the rewards you have received from them." + ) + @ConfigEditorBoolean + @FeatureToggle + public boolean enabled = true; + + @Expose + @ConfigOption( + name = "Text Format", + desc = "Drag text to change the appearance of the overlay." + ) + @ConfigEditorDraggableList( + exampleText = { + "§e§lVisitor Statistics", + "§e1,636 Total", + "§a1,172§f-§9382§f-§681§f-§c1", + "§21,382 Accepted", + "§c254 Denied", + " ", + "§c62,072 Copper", + "§33.2m Farming EXP", + "§647.2m Coins Spent", + "§b23 §9Flowering Bouquet", + "§b4 §9Overgrown Grass", + "§b2 §9Green Bandana", + "§b1 §9Dedication IV", + "§b6 §9Music Rune", + "§b1 §cSpace Helmet", + "§b1 §9Cultivating I", + "§b1 §9Replenish I", + " ", // If they want another empty row + "§212,735 Garden EXP", + "§b11,056 Bits", + "§250,556 Mithril Powder", + "§d50,556 Gemstone Powder", + } + ) + public List textFormat = new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12)); + + + @Expose + @ConfigOption(name = "Display Numbers First", desc = "Determines whether the number or drop name displays first. " + + "§eNote: Will not update the preview above!") + @ConfigEditorBoolean + public boolean displayNumbersFirst = true; + + @Expose + @ConfigOption(name = "Display Icons", desc = "Replaces the drop names with icons. " + + "§eNote: Will not update the preview above!") + @ConfigEditorBoolean + public boolean displayIcons = false; + + @Expose + @ConfigOption(name = "Only on Barn Plot", desc = "Only shows the overlay while on the Barn plot.") + @ConfigEditorBoolean + public boolean onlyOnBarn = true; + + @Expose + public Position pos = new Position(5, 20, false, true); + } + } @Expose - @ConfigOption(name = "Visitor Reward Warning", desc = "") - @ConfigAccordionId(id = 1) + @ConfigOption(name = "Numbers", desc = "") @Accordion - public VisitorRewardWarning visitorRewardWarning = new VisitorRewardWarning(); + public NumbersConfig number = new NumbersConfig(); + public static class NumbersConfig{ + @Expose + @ConfigOption(name = "Crop Milestone", desc = "Show the number of crop milestones in the inventory.") + @ConfigEditorBoolean + @FeatureToggle + public boolean cropMilestone = true; - public static class VisitorRewardWarning { + @Expose + @ConfigOption(name = "Average Milestone", desc = "Show the average crop milestone in the crop milestone inventory.") + @ConfigEditorBoolean + @FeatureToggle + public boolean averageCropMilestone = true; @Expose - @ConfigOption(name = "Notify in Chat", desc = "Send a chat message once you talk to a visitor with reward.") + @ConfigOption(name = "Crop Upgrades", desc = "Show the number of upgrades in the crop upgrades inventory.") @ConfigEditorBoolean @FeatureToggle - public boolean notifyInChat = true; + public boolean cropUpgrades = true; @Expose - @ConfigOption(name = "Show over Name", desc = "Show the reward name above the visitor name.") + @ConfigOption(name = "Composter Upgrades", desc = "Show the number of upgrades in the Composter upgrades inventory.") @ConfigEditorBoolean @FeatureToggle - public boolean showOverName = true; + public boolean composterUpgrades = true; + } + @Expose + @ConfigOption(name = "Crop Milestones", desc = "") + @Accordion + public CropMilestonesConfig cropMilestones = new CropMilestonesConfig(); + public static class CropMilestonesConfig{ @Expose - @ConfigOption(name = "Prevent Refusing", desc = "Prevent the refusal of a visitor with reward.") + @ConfigOption( + name = "Progress Display", + desc = "Shows the progress and ETA until the next crop milestone is reached and the current crops/minute value. " + + "§eRequires a tool with either a counter or Cultivating enchantment for full accuracy." + ) @ConfigEditorBoolean @FeatureToggle - public boolean preventRefusing = true; + public boolean progress = true; + + @Expose + @ConfigOption( + name = "Warn When Close", + desc = "Warn with title and sound when the next crop milestone upgrade happens in 5 seconds. " + + "Useful for switching to a different pet for leveling.") + @ConfigEditorBoolean + public boolean warnClose = false; @Expose - @ConfigOption(name = "Bypass Key", desc = "Hold that key to bypass the Prevent Refusing feature.") - @ConfigEditorKeybind(defaultKey = Keyboard.KEY_NONE) - public int bypassKey = Keyboard.KEY_NONE; + @ConfigOption( + name = "Time Format", + desc = "Change the highest time unit to show (1h30m vs 90min)") + @ConfigEditorDropdown(values = {"Year", "Day", "Hour", "Minute", "Second"}) + public Property highestTimeFormat = Property.of(0); + @Expose + @ConfigOption( + name = "Maxed Milestone", + desc = "Calculate the progress and ETA till maxed milestone (46) instead of next milestone.") + @ConfigEditorBoolean + public Property bestShowMaxedNeeded = Property.of(false); - /** - * Sync up with {at.hannibal2.skyhanni.features.garden.visitor.VisitorReward} - */ @Expose @ConfigOption( - name = "Items", - desc = "Warn for these reward items." + name = "Milestone Text", + desc = "Drag text to change the appearance of the overlay.\n" + + "Hold a farming tool to show the overlay." ) @ConfigEditorDraggableList( exampleText = { - "§9Flowering Bouquet", - "§9Overgrown Grass", - "§9Green Bandana", - "§9Dedication IV", - "§9Music Rune", - "§cSpace Helmet", - "§9Cultivating I", - "§9Replenish I", + "§6Crop Milestones", + "§7Pumpkin Tier 22", + "§e12,300§8/§e100,000", + "§7In §b12m 34s", + "§7Crops/Minute§8: §e12,345", + "§7Blocks/Second§8: §e19.85", + "§7Percentage: §e12.34%", } ) - public List drops = new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5, 6)); + public List text = new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5)); + + @Expose + @ConfigOption(name = "Block Broken Precision", desc = "The amount of decimals displayed in blocks/second.") + @ConfigEditorSlider( + minValue = 0, + maxValue = 6, + minStep = 1 + ) + public int blocksBrokenPrecision = 2; + + @Expose + @ConfigOption(name = "Seconds Before Reset", desc = "How many seconds of not farming until blocks/second resets.") + @ConfigEditorSlider( + minValue = 2, + maxValue = 60, + minStep = 1 + ) + public int blocksBrokenResetTime = 5; + + @Expose + public Position progressDisplayPos = new Position(-400, -200, false, true); + @Expose + @ConfigOption(name = "Best Crop", desc = "") + @Accordion + public NextConfig next = new NextConfig(); + // TODO moulconfig runnable support + public static class NextConfig{ + @Expose + @ConfigOption( + name = "Best Display", + desc = "Lists all crops and their ETA till next milestone. Sorts for best crop for getting garden or SkyBlock levels.") + @ConfigEditorBoolean + @FeatureToggle + public boolean bestDisplay = true; + + // TODO moulconfig runnable support + @Expose + @ConfigOption(name = "Sort Type", desc = "Sort the crops by either garden or SkyBlock EXP.") + @ConfigEditorDropdown(values = {"Garden Exp", "SkyBlock Exp"}) + public int bestType = 0; + + // TODO moulconfig runnable support + @Expose + @ConfigOption(name = "Only Show Top", desc = "Only show the top # crops.") + @ConfigEditorSlider( + minValue = 1, + maxValue = 10, + minStep = 1 + ) + public int showOnlyBest = 10; + + @Expose + @ConfigOption(name = "Extend Top List", desc = "Add current crop to the list if its lower ranked than the set limit by extending the list.") + @ConfigEditorBoolean + public boolean showCurrent = true; + + // TODO moulconfig runnable support + @Expose + @ConfigOption( + name = "Always On", + desc = "Show the Best Display always while on the garden.") + @ConfigEditorBoolean + public boolean bestAlwaysOn = false; + + @Expose + @ConfigOption( + name = "Compact Display", + desc = "A more compact best crop time: Removing the crop name and exp, hide the # number and using a more compact time format.") + @ConfigEditorBoolean + public boolean bestCompact = false; + + @Expose + @ConfigOption( + name = "Hide Title", + desc = "Hides the 'Best Crop Time' line entirely.") + @ConfigEditorBoolean + public boolean bestHideTitle = false; + + + @Expose + public Position displayPos = new Position(-200, -200, false, true); + } + @Expose + @ConfigOption(name = "Mushroom Pet Perk", desc = "") + @Accordion + public MushroomPetPerkConfig mushroomPetPerk = new MushroomPetPerkConfig(); + // TODO moulconfig runnable support + public static class MushroomPetPerkConfig{ + @Expose + @ConfigOption( + name = "Display Enabled", + desc = "Show the progress and ETA for mushroom crops when farming other crops because of the Mooshroom Cow perk.") + @ConfigEditorBoolean + @FeatureToggle + public boolean enabled = true; + + @Expose + @ConfigOption( + name = "Mushroom Text", + desc = "Drag text to change the appearance of the overlay.\n" + + "Hold a farming tool to show the overlay." + ) + @ConfigEditorDraggableList( + exampleText = { + "§6Mooshroom Cow Perk", + "§7Mushroom Tier 8", + "§e6,700§8/§e15,000", + "§7In §b12m 34s", + "§7Percentage: §e12.34%", + } + ) + public List text = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + + @Expose + public Position pos = new Position(-112, -143, false, true); + } } + // TODO moulconfig runnable support @Expose - @ConfigOption(name = "Notification Chat", desc = "Show in chat when a new visitor is visiting your island.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - @FeatureToggle - public boolean visitorNotificationChat = true; + @ConfigOption(name = "Custom Keybinds", desc = "") + @Accordion + public KeyBindConfig keyBind = new KeyBindConfig(); - @Expose - @ConfigOption(name = "Notification Title", desc = "Show a title when a new visitor is visiting your island.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - @FeatureToggle - public boolean visitorNotificationTitle = true; + public static class KeyBindConfig{ + @Expose + @ConfigOption(name = "Enabled", desc = "Use custom keybinds while holding a farming tool or Daedalus Axe in the hand.") + @ConfigEditorBoolean + @FeatureToggle + public boolean enabled = false; - @Expose - @ConfigOption(name = "Highlight Status", desc = "Highlight the status for visitors with a text above or with color.") - @ConfigEditorDropdown(values = {"Color Only", "Name Only", "Both", "Disabled"}) - @ConfigAccordionId(id = 1) - public int visitorHighlightStatus = 2; + @ConfigOption(name = "Disable All", desc = "Disable all keys.") + @ConfigEditorButton(buttonText = "Disable") + public Runnable presetDisable = () -> { + attack = Keyboard.KEY_NONE; + useItem = Keyboard.KEY_NONE; + left = Keyboard.KEY_NONE; + right = Keyboard.KEY_NONE; + forward = Keyboard.KEY_NONE; + back = Keyboard.KEY_NONE; + jump = Keyboard.KEY_NONE; + sneak = Keyboard.KEY_NONE; + + Minecraft.getMinecraft().thePlayer.closeScreen(); + }; - @Expose - @ConfigOption(name = "Colored Name", desc = "Show the visitor name in the color of the rarity.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - @FeatureToggle - public boolean visitorColoredName = true; + @ConfigOption(name = "Set Default", desc = "Reset all keys to default.") + @ConfigEditorButton(buttonText = "Default") + public Runnable presetDefault = () -> { + attack = -100; + useItem = -99; + left = Keyboard.KEY_A; + right = Keyboard.KEY_D; + forward = Keyboard.KEY_W; + back = Keyboard.KEY_S; + jump = Keyboard.KEY_SPACE; + sneak = Keyboard.KEY_LSHIFT; + Minecraft.getMinecraft().thePlayer.closeScreen(); + }; - @Expose - @ConfigOption(name = "Hypixel Message", desc = "Hide the chat message from Hypixel that a new visitor has arrived at your garden.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - @FeatureToggle - public boolean visitorHypixelArrivedMessage = true; + @Expose + @ConfigOption(name = "Attack", desc = "") + @ConfigEditorKeybind(defaultKey = -100) + public int attack = -100; - @Expose - @ConfigOption(name = "Hide Chat", desc = "Hide chat messages from the visitors in garden. (Except Beth and Spaceman)") - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - @FeatureToggle - public boolean visitorHideChat = true; + @Expose + @ConfigOption(name = "Use Item", desc = "") + @ConfigEditorKeybind(defaultKey = -99) + public int useItem = -99; - @Expose - @ConfigOption(name = "Visitor Drops Statistics Counter", desc = "") - @Accordion - public VisitorDrops visitorDropsStatistics = new VisitorDrops(); + @Expose + @ConfigOption(name = "Move Left", desc = "") + @ConfigEditorKeybind(defaultKey = Keyboard.KEY_A) + public int left = Keyboard.KEY_A; - public static class VisitorDrops { + @Expose + @ConfigOption(name = "Move Right", desc = "") + @ConfigEditorKeybind(defaultKey = Keyboard.KEY_D) + public int right = Keyboard.KEY_D; @Expose - @ConfigOption( - name = "Enabled", - desc = "Tallies up statistic about visitors and the rewards you have received from them." - ) - @ConfigEditorBoolean - @FeatureToggle - public boolean enabled = true; + @ConfigOption(name = "Move Forward", desc = "") + @ConfigEditorKeybind(defaultKey = Keyboard.KEY_W) + public int forward = Keyboard.KEY_W; @Expose - @ConfigOption( - name = "Text Format", - desc = "Drag text to change the appearance of the overlay." - ) - @ConfigEditorDraggableList( - exampleText = { - "§e§lVisitor Statistics", - "§e1,636 Total", - "§a1,172§f-§9382§f-§681§f-§c1", - "§21,382 Accepted", - "§c254 Denied", - " ", - "§c62,072 Copper", - "§33.2m Farming EXP", - "§647.2m Coins Spent", - "§b23 §9Flowering Bouquet", - "§b4 §9Overgrown Grass", - "§b2 §9Green Bandana", - "§b1 §9Dedication IV", - "§b6 §9Music Rune", - "§b1 §cSpace Helmet", - "§b1 §9Cultivating I", - "§b1 §9Replenish I", - " ", // If they want another empty row - "§212,735 Garden EXP", - "§b11,056 Bits", - "§250,556 Mithril Powder", - "§d50,556 Gemstone Powder", - } - ) - public List textFormat = new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12)); + @ConfigOption(name = "Move Back", desc = "") + @ConfigEditorKeybind(defaultKey = Keyboard.KEY_S) + public int back = Keyboard.KEY_S; + + @Expose + @ConfigOption(name = "Jump", desc = "") + @ConfigEditorKeybind(defaultKey = Keyboard.KEY_SPACE) + public int jump = Keyboard.KEY_SPACE; + @Expose + @ConfigOption(name = "Sneak", desc = "") + @ConfigEditorKeybind(defaultKey = Keyboard.KEY_LSHIFT) + public int sneak = Keyboard.KEY_LSHIFT; + } + @Expose + @ConfigOption(name = "Optimal Speed", desc = "") + @Accordion + public OptimalSpeedConfig optimalSpeeds = new OptimalSpeedConfig(); + public static class OptimalSpeedConfig{ @Expose - @ConfigOption(name = "Display Numbers First", desc = "Determines whether the number or drop name displays first. " + - "§eNote: Will not update the preview above!") + @ConfigOption(name = "Enabled", desc = "Show the optimal speed for your current tool in the hand.\n" + + "(Thanks MelonKingDE for the default values).") @ConfigEditorBoolean - public boolean displayNumbersFirst = true; + @FeatureToggle + public boolean enabled = true; @Expose - @ConfigOption(name = "Display Icons", desc = "Replaces the drop names with icons. " + - "§eNote: Will not update the preview above!") + @ConfigOption(name = "Warning Title", desc = "Warn via title when you don't have the optimal speed.") @ConfigEditorBoolean - public boolean displayIcons = false; + public boolean warning = false; @Expose - @ConfigOption(name = "Only on Barn Plot", desc = "Only shows the overlay while on the Barn plot.") + @ConfigOption(name = "Rancher Boots", desc = "Allows you to set the optimal speed in the Rancher Boots overlay by clicking on the presets.") @ConfigEditorBoolean - public boolean onlyOnBarn = true; + @FeatureToggle + public boolean signEnabled = true; @Expose - public Position visitorDropPos = new Position(5, 20, false, true); - } + public Position signPosition = new Position(20, -195, false, true); - @Expose - @ConfigOption(name = "Numbers", desc = "") - @ConfigEditorAccordion(id = 5) - public boolean numbers = false; + @Expose + @ConfigOption(name = "Custom Speed", desc = "Change the exact speed for every single crop.") + @Accordion + public CustomSpeedConfig customSpeed = new CustomSpeedConfig(); + + public static class CustomSpeedConfig { + + @Expose + @ConfigOption(name = "Wheat", desc = "Suggested farm speed:\n" + + "§e5 Blocks§7: §f✦ 93 speed\n" + + "§e4 Blocks§7: §f✦ 116 speed") + @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1) + public int wheat = 93; + + @Expose + @ConfigOption(name = "Carrot", desc = "Suggested farm speed:\n" + + "§e5 Blocks§7: §f✦ 93 speed\n" + + "§e4 Blocks§7: §f✦ 116 speed") + @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1) + public int carrot = 93; + + @Expose + @ConfigOption(name = "Potato", desc = "Suggested farm speed:\n" + + "§e5 Blocks§7: §f✦ 93 speed\n" + + "§e4 Blocks§7: §f✦ 116 speed") + @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1) + public int potato = 93; + + @Expose + @ConfigOption(name = "Nether Wart", desc = "Suggested farm speed:\n" + + "§e5 Blocks§7: §f✦ 93 speed\n" + + "§e4 Blocks§7: §f✦ 116 speed") + @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1) + public int netherWart = 93; + + @Expose + @ConfigOption(name = "Pumpkin", desc = "Suggested farm speed:\n" + + "§e3 Blocks§7: §f✦ 155 speed\n" + + "§e2 Blocks§7: §f✦ 265 §7or §f400 speed") + @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1) + public int pumpkin = 155; + + @Expose + @ConfigOption(name = "Melon", desc = "Suggested farm speed:\n" + + "§e3 Blocks§7: §f✦ 155 speed\n" + + "§e2 Blocks§7: §f✦ 265 or 400 speed") + @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1) + public int melon = 155; + + @Expose + @ConfigOption(name = "Cocoa Beans", desc = "Suggested farm speed:\n" + + "§e3 Blocks§7: §f✦ 155 speed\n" + + "§e4 Blocks§7: §f✦ 116 speed") + @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1) + public int cocoaBeans = 155; + + // TODO does other speed settings exist? + @Expose + @ConfigOption(name = "Sugar Cane", desc = "Suggested farm speed:\n" + + "§eYaw 45§7: §f✦ 328 speed") + @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1) + public int sugarCane = 328; + + @Expose + @ConfigOption(name = "Cactus", desc = "Suggested farm speed:\n" + + "§eNormal§7: §f✦ 400 speed\n" + + "§eRacing Helmet§7: §f✦ 464 speed\n" + + "§eBlack Cat§7: §f✦ 464 speed") + @ConfigEditorSlider(minValue = 1, maxValue = 500, minStep = 1) + public int cactus = 400; + + // TODO does other speed settings exist? + @Expose + @ConfigOption(name = "Mushroom", desc = "Suggested farm speed:\n" + + "§eYaw 60§7: §f✦ 233 speed") + @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1) + public int mushroom = 233; + } - @Expose - @ConfigOption(name = "Crop Milestone", desc = "Show the number of crop milestones in the inventory.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 5) - @FeatureToggle - public boolean numberCropMilestone = true; + @Expose + public Position pos = new Position(5, -200, false, true); + } @Expose - @ConfigOption(name = "Average Milestone", desc = "Show the average crop milestone in the crop milestone inventory.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 5) - @FeatureToggle - public boolean numberAverageCropMilestone = true; + @ConfigOption(name = "Garden Level", desc = "") + public GardenLevelConfig gardenLevels = new GardenLevelConfig(); + public static class GardenLevelConfig{ + @Expose + @ConfigOption(name = "Display", desc = "Show the current Garden level and progress to the next level.") + @ConfigEditorBoolean + @FeatureToggle + public boolean display = true; - @Expose - @ConfigOption(name = "Crop Upgrades", desc = "Show the number of upgrades in the crop upgrades inventory.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 5) - @FeatureToggle - public boolean numberCropUpgrades = true; + @Expose + public Position pos = new Position(390, 40, false, true); + } @Expose - @ConfigOption(name = "Composter Upgrades", desc = "Show the number of upgrades in the Composter upgrades inventory.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 5) - @FeatureToggle - public boolean numberComposterUpgrades = true; + @ConfigOption(name = "Farming Weight", desc = "") + @Accordion + public EliteFarmingWeightConfig eliteFarmingWeights = new EliteFarmingWeightConfig(); - @Expose - @ConfigOption(name = "Crop Milestones", desc = "") - @ConfigEditorAccordion(id = 6) - public boolean cropMilestones = false; + public static class EliteFarmingWeightConfig{ + @Expose + @ConfigOption(name = "Display", desc = "Display your farming weight on screen. " + + "The calculation and API is provided by The Elite SkyBlock farmers. " + + "See §ehttps://elitebot.dev/info §7for more info.") + @ConfigEditorBoolean + @FeatureToggle + public boolean display = true; - @Expose - @ConfigOption( - name = "Progress Display", - desc = "Shows the progress and ETA until the next crop milestone is reached and the current crops/minute value. " + - "§eRequires a tool with either a counter or Cultivating enchantment for full accuracy." - ) - @ConfigEditorBoolean - @ConfigAccordionId(id = 6) - @FeatureToggle - public boolean cropMilestoneProgress = true; + @Expose + public Position pos = new Position(180, 10, false, true); - @Expose - @ConfigOption( - name = "Warn When Close", - desc = "Warn with title and sound when the next crop milestone upgrade happens in 5 seconds. " + - "Useful for switching to a different pet for leveling.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 6) - public boolean cropMilestoneWarnClose = false; + @Expose + @ConfigOption(name = "Leaderboard Ranking", desc = "Show your position in the farming weight leaderboard. " + + "Only if your farming weight is high enough! Updates every 10 minutes.") + @ConfigEditorBoolean + public boolean leaderboard = true; - @Expose - @ConfigOption( - name = "Time Format", - desc = "Change the highest time unit to show (1h30m vs 90min)") - @ConfigEditorDropdown(values = {"Year", "Day", "Hour", "Minute", "Second"}) - @ConfigAccordionId(id = 6) - public Property cropMilestoneHighestTimeFormat = Property.of(0); + @Expose + @ConfigOption(name = "Overtake ETA", desc = "Show a timer estimating when you'll move up a spot in the leaderboard! " + + "Will show an ETA to rank #10,000 if you're not on the leaderboard yet.") + @ConfigEditorBoolean + public boolean overtakeETA = false; - @Expose - @ConfigOption( - name = "Maxed Milestone", - desc = "Calculate the progress and ETA till maxed milestone (46) instead of next milestone.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 6) - public Property cropMilestoneBestShowMaxedNeeded = Property.of(false); + @Expose + @ConfigOption(name = "Offscreen Drop Message", desc = "Show a chat message when joining Garden how many spots you have dropped since last Garden join.") + @ConfigEditorBoolean + public boolean offScreenDropMessage = true; - @Expose - @ConfigOption( - name = "Milestone Text", - desc = "Drag text to change the appearance of the overlay.\n" + - "Hold a farming tool to show the overlay." - ) - @ConfigEditorDraggableList( - exampleText = { - "§6Crop Milestones", - "§7Pumpkin Tier 22", - "§e12,300§8/§e100,000", - "§7In §b12m 34s", - "§7Crops/Minute§8: §e12,345", - "§7Blocks/Second§8: §e19.85", - "§7Percentage: §e12.34%", - } - ) - @ConfigAccordionId(id = 6) - public List cropMilestoneText = new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5)); + @Expose + @ConfigOption(name = "Always ETA", desc = "Show the Overtake ETA always, even when not farming at the moment.") + @ConfigEditorBoolean + public boolean overtakeETAAlways = true; - @Expose - @ConfigOption(name = "Block Broken Precision", desc = "The amount of decimals displayed in blocks/second.") - @ConfigEditorSlider( - minValue = 0, - maxValue = 6, - minStep = 1 - ) - @ConfigAccordionId(id = 6) - public int blocksBrokenPrecision = 2; + @Expose + @ConfigOption(name = "ETA Goal", desc = "Override the Overtake ETA to show when you'll reach the specified rank (if not there yet). (Default: \"10,000\")") + @ConfigEditorText + public String ETAGoalRank = "10000"; - @Expose - @ConfigOption(name = "Seconds Before Reset", desc = "How many seconds of not farming until blocks/second resets.") - @ConfigEditorSlider( - minValue = 2, - maxValue = 60, - minStep = 1 - ) - @ConfigAccordionId(id = 6) - public int blocksBrokenResetTime = 5; + @Expose + @ConfigOption(name = "Show below 200", desc = "Show the farming weight data even if you are below 200 weight.") + @ConfigEditorBoolean + public boolean ignoreLow = false; + } @Expose - public Position cropMilestoneProgressDisplayPos = new Position(-400, -200, false, true); + @ConfigOption(name = "Dicer Counter", desc = "") + @Accordion + public DicerCounterConfig dicerCounters = new DicerCounterConfig(); + public static class DicerCounterConfig{ + @Expose + @ConfigOption(name = "RNG Drop Counter", desc = "Count RNG drops for Melon Dicer and Pumpkin Dicer.") + @ConfigEditorBoolean + @FeatureToggle + public boolean display = true; - @Expose - @ConfigOption(name = "Best Crop", desc = "") - @ConfigAccordionId(id = 6) - @ConfigEditorAccordion(id = 7) - public boolean cropMilestoneNext = false; - // TODO moulconfig runnable support + @Expose + @ConfigOption(name = "Hide Chat", desc = "Hide the chat message when dropping a RNG Dicer drop.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hideChat = false; - @Expose - @ConfigOption( - name = "Best Display", - desc = "Lists all crops and their ETA till next milestone. Sorts for best crop for getting garden or SkyBlock levels.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 7) - @FeatureToggle - public boolean cropMilestoneBestDisplay = true; + @Expose + public Position pos = new Position(16, -232, false, true); + } - // TODO moulconfig runnable support @Expose - @ConfigOption(name = "Sort Type", desc = "Sort the crops by either garden or SkyBlock EXP.") - @ConfigEditorDropdown(values = {"Garden Exp", "SkyBlock Exp"}) - @ConfigAccordionId(id = 7) - public int cropMilestoneBestType = 0; + @ConfigOption(name = "Money per Hour", desc = "") + @Accordion + public MoneyPerHourConfig moneyPerHours = new MoneyPerHourConfig(); + public static class MoneyPerHourConfig{ + @Expose + @ConfigOption(name = "Show Money per Hour", + desc = "Displays the money per hour YOU get with YOUR crop/minute value when selling the item to bazaar. " + + "Supports Bountiful, Mushroom Cow Perk, Armor Crops and Dicer Drops. Their toggles are below.") + @ConfigEditorBoolean + @FeatureToggle + public boolean display = true; - // TODO moulconfig runnable support - @Expose - @ConfigOption(name = "Only Show Top", desc = "Only show the top # crops.") - @ConfigEditorSlider( - minValue = 1, - maxValue = 10, - minStep = 1 - ) - @ConfigAccordionId(id = 7) - public int cropMilestoneShowOnlyBest = 10; - - @Expose - @ConfigOption(name = "Extend Top List", desc = "Add current crop to the list if its lower ranked than the set limit by extending the list.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 7) - public boolean cropMilestoneShowCurrent = true; - - // TODO moulconfig runnable support - @Expose - @ConfigOption( - name = "Always On", - desc = "Show the Best Display always while on the garden.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 7) - public boolean cropMilestoneBestAlwaysOn = false; - - @Expose - @ConfigOption( - name = "Compact Display", - desc = "A more compact best crop time: Removing the crop name and exp, hide the # number and using a more compact time format.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 7) - public boolean cropMilestoneBestCompact = false; - - @Expose - @ConfigOption( - name = "Hide Title", - desc = "Hides the 'Best Crop Time' line entirely.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 7) - public boolean cropMilestoneBestHideTitle = false; - - - @Expose - public Position cropMilestoneNextDisplayPos = new Position(-200, -200, false, true); - - @Expose - @ConfigOption(name = "Mushroom Pet Perk", desc = "") - @ConfigAccordionId(id = 6) - @ConfigEditorAccordion(id = 15) - public boolean cropMilestoneMushroomPetPerk = false; - - // TODO moulconfig runnable support - @Expose - @ConfigOption( - name = "Display Enabled", - desc = "Show the progress and ETA for mushroom crops when farming other crops because of the Mooshroom Cow perk.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 15) - @FeatureToggle - public boolean cropMilestoneMushroomPetPerkEnabled = true; - - @Expose - @ConfigOption( - name = "Mushroom Text", - desc = "Drag text to change the appearance of the overlay.\n" + - "Hold a farming tool to show the overlay." - ) - @ConfigEditorDraggableList( - exampleText = { - "§6Mooshroom Cow Perk", - "§7Mushroom Tier 8", - "§e6,700§8/§e15,000", - "§7In §b12m 34s", - "§7Percentage: §e12.34%", - } - ) - @ConfigAccordionId(id = 15) - public List cropMilestoneMushroomPetPerkText = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); - - @Expose - public Position cropMilestoneMushroomPetPerkPos = new Position(-112, -143, false, true); - - // TODO moulconfig runnable support - @Expose - @ConfigOption(name = "Custom Keybind", desc = "") - @ConfigEditorAccordion(id = 8) - public boolean keybind = false; - - @Expose - @ConfigOption(name = "Enabled", desc = "Use custom keybinds while holding a farming tool or Daedalus Axe in the hand.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 8) - @FeatureToggle - public boolean keyBindEnabled = false; - - @ConfigOption(name = "Disable All", desc = "Disable all keys.") - @ConfigEditorButton(buttonText = "Disable") - @ConfigAccordionId(id = 8) - public Runnable keyBindPresetDisable = () -> { - keyBindAttack = Keyboard.KEY_NONE; - keyBindUseItem = Keyboard.KEY_NONE; - keyBindLeft = Keyboard.KEY_NONE; - keyBindRight = Keyboard.KEY_NONE; - keyBindForward = Keyboard.KEY_NONE; - keyBindBack = Keyboard.KEY_NONE; - keyBindJump = Keyboard.KEY_NONE; - keyBindSneak = Keyboard.KEY_NONE; - - Minecraft.getMinecraft().thePlayer.closeScreen(); - }; - - @ConfigOption(name = "Set Default", desc = "Reset all keys to default.") - @ConfigEditorButton(buttonText = "Default") - @ConfigAccordionId(id = 8) - public Runnable keyBindPresetDefault = () -> { - keyBindAttack = -100; - keyBindUseItem = -99; - keyBindLeft = Keyboard.KEY_A; - keyBindRight = Keyboard.KEY_D; - keyBindForward = Keyboard.KEY_W; - keyBindBack = Keyboard.KEY_S; - keyBindJump = Keyboard.KEY_SPACE; - keyBindSneak = Keyboard.KEY_LSHIFT; - Minecraft.getMinecraft().thePlayer.closeScreen(); - }; - - @Expose - @ConfigOption(name = "Attack", desc = "") - @ConfigAccordionId(id = 8) - @ConfigEditorKeybind(defaultKey = -100) - public int keyBindAttack = -100; - - @Expose - @ConfigOption(name = "Use Item", desc = "") - @ConfigAccordionId(id = 8) - @ConfigEditorKeybind(defaultKey = -99) - public int keyBindUseItem = -99; - - @Expose - @ConfigOption(name = "Move Left", desc = "") - @ConfigAccordionId(id = 8) - @ConfigEditorKeybind(defaultKey = Keyboard.KEY_A) - public int keyBindLeft = Keyboard.KEY_A; - - @Expose - @ConfigOption(name = "Move Right", desc = "") - @ConfigAccordionId(id = 8) - @ConfigEditorKeybind(defaultKey = Keyboard.KEY_D) - public int keyBindRight = Keyboard.KEY_D; - - @Expose - @ConfigOption(name = "Move Forward", desc = "") - @ConfigAccordionId(id = 8) - @ConfigEditorKeybind(defaultKey = Keyboard.KEY_W) - public int keyBindForward = Keyboard.KEY_W; - - @Expose - @ConfigOption(name = "Move Back", desc = "") - @ConfigAccordionId(id = 8) - @ConfigEditorKeybind(defaultKey = Keyboard.KEY_S) - public int keyBindBack = Keyboard.KEY_S; - - @Expose - @ConfigOption(name = "Jump", desc = "") - @ConfigAccordionId(id = 8) - @ConfigEditorKeybind(defaultKey = Keyboard.KEY_SPACE) - public int keyBindJump = Keyboard.KEY_SPACE; - - @Expose - @ConfigOption(name = "Sneak", desc = "") - @ConfigAccordionId(id = 8) - @ConfigEditorKeybind(defaultKey = Keyboard.KEY_LSHIFT) - public int keyBindSneak = Keyboard.KEY_LSHIFT; - - @Expose - @ConfigOption(name = "Optimal Speed", desc = "") - @ConfigEditorAccordion(id = 9) - public boolean optimalSpeed = false; - - @Expose - @ConfigOption(name = "Enabled", desc = "Show the optimal speed for your current tool in the hand.\n" + - "(Thanks MelonKingDE for the default values).") - @ConfigEditorBoolean - @ConfigAccordionId(id = 9) - @FeatureToggle - public boolean optimalSpeedEnabled = true; - - @Expose - @ConfigOption(name = "Warning Title", desc = "Warn via title when you don't have the optimal speed.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 9) - public boolean optimalSpeedWarning = false; - - @Expose - @ConfigOption(name = "Rancher Boots", desc = "Allows you to set the optimal speed in the Rancher Boots overlay by clicking on the presets.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 9) - @FeatureToggle - public boolean optimalSpeedSignEnabled = true; + // TODO moulconfig runnable support + @Expose + @ConfigOption(name = "Only Show Top", desc = "Only show the best # items.") + @ConfigEditorSlider( + minValue = 1, + maxValue = 25, + minStep = 1 + ) + public int showOnlyBest = 5; - @Expose - public Position optimalSpeedSignPosition = new Position(20, -195, false, true); + @Expose + @ConfigOption(name = "Extend Top List", desc = "Add current crop to the list if its lower ranked than the set limit by extending the list.") + @ConfigEditorBoolean + public boolean showCurrent = true; - @Expose - @ConfigOption(name = "Custom Speed", desc = "Change the exact speed for every single crop.") - @Accordion - @ConfigAccordionId(id = 9) - public CustomSpeed optimalSpeedCustom = new CustomSpeed(); + // TODO moulconfig runnable support + @Expose + @ConfigOption( + name = "Always On", + desc = "Always show the money/hour Display while on the garden.") + @ConfigEditorBoolean + public boolean alwaysOn = false; - public static class CustomSpeed { + @Expose + @ConfigOption( + name = "Compact Mode", + desc = "Hide the item name and the position number.") + @ConfigEditorBoolean + public boolean compact = false; @Expose - @ConfigOption(name = "Wheat", desc = "Suggested farm speed:\n" + - "§e5 Blocks§7: §f✦ 93 speed\n" + - "§e4 Blocks§7: §f✦ 116 speed") - @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1) - public int wheat = 93; + @ConfigOption( + name = "Compact Price", + desc = "Show the price more compact.") + @ConfigEditorBoolean + public boolean compactPrice = false; @Expose - @ConfigOption(name = "Carrot", desc = "Suggested farm speed:\n" + - "§e5 Blocks§7: §f✦ 93 speed\n" + - "§e4 Blocks§7: §f✦ 116 speed") - @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1) - public int carrot = 93; + @ConfigOption( + name = "Use Custom", + desc = "Use the custom format below instead of classic ➜ §eSell Offer §7and other profiles ➜ §eNPC Price.") + @ConfigEditorBoolean + public boolean useCustomFormat = false; @Expose - @ConfigOption(name = "Potato", desc = "Suggested farm speed:\n" + - "§e5 Blocks§7: §f✦ 93 speed\n" + - "§e4 Blocks§7: §f✦ 116 speed") - @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1) - public int potato = 93; + @ConfigOption( + name = "Custom Format", + desc = "Set what prices to show") + @ConfigEditorDraggableList( + exampleText = { + "§eSell Offer", + "§eInstant Sell", + "§eNPC Price" + }, + requireNonEmpty = true + ) + public List customFormat = new ArrayList<>(Arrays.asList(0, 1, 2)); @Expose - @ConfigOption(name = "Nether Wart", desc = "Suggested farm speed:\n" + - "§e5 Blocks§7: §f✦ 93 speed\n" + - "§e4 Blocks§7: §f✦ 116 speed") - @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1) - public int netherWart = 93; + @ConfigOption( + name = "Merge Seeds", + desc = "Merge the seeds price with the wheat price.") + @ConfigEditorBoolean + public boolean mergeSeeds = true; @Expose - @ConfigOption(name = "Pumpkin", desc = "Suggested farm speed:\n" + - "§e3 Blocks§7: §f✦ 155 speed\n" + - "§e2 Blocks§7: §f✦ 265 §7or §f400 speed") - @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1) - public int pumpkin = 155; + @ConfigOption( + name = "Include Bountiful", + desc = "Includes the coins from Bountiful in the calculation.") + @ConfigEditorBoolean + public boolean bountiful = true; @Expose - @ConfigOption(name = "Melon", desc = "Suggested farm speed:\n" + - "§e3 Blocks§7: §f✦ 155 speed\n" + - "§e2 Blocks§7: §f✦ 265 or 400 speed") - @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1) - public int melon = 155; + @ConfigOption( + name = "Include Mooshroom Cow", + desc = "Includes the coins you get from selling the mushrooms from your Mooshroom Cow pet.") + @ConfigEditorBoolean + public boolean mooshroom = true; @Expose - @ConfigOption(name = "Cocoa Beans", desc = "Suggested farm speed:\n" + - "§e3 Blocks§7: §f✦ 155 speed\n" + - "§e4 Blocks§7: §f✦ 116 speed") - @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1) - public int cocoaBeans = 155; + @ConfigOption( + name = "Include Armor Drops", + desc = "Includes the average coins/hr from your armor.") + @ConfigEditorBoolean + public boolean armor = true; - // TODO does other speed settings exist? @Expose - @ConfigOption(name = "Sugar Cane", desc = "Suggested farm speed:\n" + - "§eYaw 45§7: §f✦ 328 speed") - @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1) - public int sugarCane = 328; + @ConfigOption( + name = "Include Dicer Drops", + desc = "Includes the average coins/hr from your melon or pumpkin dicer.") + @ConfigEditorBoolean + public boolean dicer = true; @Expose - @ConfigOption(name = "Cactus", desc = "Suggested farm speed:\n" + - "§eNormal§7: §f✦ 400 speed\n" + - "§eRacing Helmet§7: §f✦ 464 speed\n" + - "§eBlack Cat§7: §f✦ 464 speed") - @ConfigEditorSlider(minValue = 1, maxValue = 500, minStep = 1) - public int cactus = 400; + @ConfigOption( + name = "Hide Title", + desc = "Hides the first line of 'Money Per Hour' entirely.") + @ConfigEditorBoolean + public boolean hideTitle = false; - // TODO does other speed settings exist? @Expose - @ConfigOption(name = "Mushroom", desc = "Suggested farm speed:\n" + - "§eYaw 60§7: §f✦ 233 speed") - @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1) - public int mushroom = 233; + public Position pos = new Position(-330, 170, false, true); } - @Expose - public Position optimalSpeedPos = new Position(5, -200, false, true); - - @Expose - @ConfigOption(name = "Garden Level", desc = "") - @ConfigEditorAccordion(id = 10) - public boolean gardenLevel = false; - - @Expose - @ConfigOption(name = "Display", desc = "Show the current Garden level and progress to the next level.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 10) - @FeatureToggle - public boolean gardenLevelDisplay = true; - - @Expose - public Position gardenLevelPos = new Position(390, 40, false, true); - - @Expose - @ConfigOption(name = "Farming Weight", desc = "") - @ConfigEditorAccordion(id = 11) - public boolean eliteFarmingWeight = false; - - @Expose - @ConfigOption(name = "Display", desc = "Display your farming weight on screen. " + - "The calculation and API is provided by The Elite SkyBlock farmers. " + - "See §ehttps://elitebot.dev/info §7for more info.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 11) - @FeatureToggle - public boolean eliteFarmingWeightDisplay = true; - - @Expose - public Position eliteFarmingWeightPos = new Position(180, 10, false, true); - - @Expose - @ConfigOption(name = "Leaderboard Ranking", desc = "Show your position in the farming weight leaderboard. " + - "Only if your farming weight is high enough! Updates every 10 minutes.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 11) - public boolean eliteFarmingWeightLeaderboard = true; - - @Expose - @ConfigOption(name = "Overtake ETA", desc = "Show a timer estimating when you'll move up a spot in the leaderboard! " + - "Will show an ETA to rank #10,000 if you're not on the leaderboard yet.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 11) - public boolean eliteFarmingWeightOvertakeETA = false; - - @Expose - @ConfigOption(name = "Offscreen Drop Message", desc = "Show a chat message when joining Garden how many spots you have dropped since last Garden join.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 11) - public boolean eliteFarmingWeightOffScreenDropMessage = true; - - @Expose - @ConfigOption(name = "Always ETA", desc = "Show the Overtake ETA always, even when not farming at the moment.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 11) - public boolean eliteFarmingWeightOvertakeETAAlways = true; - - @Expose - @ConfigOption(name = "ETA Goal", desc = "Override the Overtake ETA to show when you'll reach the specified rank (if not there yet). (Default: \"10,000\")") - @ConfigEditorText - @ConfigAccordionId(id = 11) - public String eliteFarmingWeightETAGoalRank = "10000"; - - @Expose - @ConfigOption(name = "Show below 200", desc = "Show the farming weight data even if you are below 200 weight.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 11) - public boolean eliteFarmingWeightIgnoreLow = false; - - @Expose - @ConfigOption(name = "Dicer Counter", desc = "") - @ConfigEditorAccordion(id = 12) - public boolean dicerCounter = false; - - @Expose - @ConfigOption(name = "RNG Drop Counter", desc = "Count RNG drops for Melon Dicer and Pumpkin Dicer.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 12) - @FeatureToggle - public boolean dicerCounterDisplay = true; - - @Expose - @ConfigOption(name = "Hide Chat", desc = "Hide the chat message when dropping a RNG Dicer drop.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 12) - @FeatureToggle - public boolean dicerCounterHideChat = false; - - @Expose - public Position dicerCounterPos = new Position(16, -232, false, true); - - @Expose - @ConfigOption(name = "Money per Hour", desc = "") - @ConfigEditorAccordion(id = 13) - public boolean moneyPerHour = false; - - @Expose - @ConfigOption(name = "Show Money per Hour", - desc = "Displays the money per hour YOU get with YOUR crop/minute value when selling the item to bazaar. " + - "Supports Bountiful, Mushroom Cow Perk, Armor Crops and Dicer Drops. Their toggles are below.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 13) - @FeatureToggle - public boolean moneyPerHourDisplay = true; - - // TODO moulconfig runnable support - @Expose - @ConfigOption(name = "Only Show Top", desc = "Only show the best # items.") - @ConfigEditorSlider( - minValue = 1, - maxValue = 25, - minStep = 1 - ) - @ConfigAccordionId(id = 13) - public int moneyPerHourShowOnlyBest = 5; - - @Expose - @ConfigOption(name = "Extend Top List", desc = "Add current crop to the list if its lower ranked than the set limit by extending the list.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 13) - public boolean moneyPerHourShowCurrent = true; - - // TODO moulconfig runnable support - @Expose - @ConfigOption( - name = "Always On", - desc = "Always show the money/hour Display while on the garden.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 13) - public boolean moneyPerHourAlwaysOn = false; - - @Expose - @ConfigOption( - name = "Compact Mode", - desc = "Hide the item name and the position number.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 13) - public boolean moneyPerHourCompact = false; - - @Expose - @ConfigOption( - name = "Compact Price", - desc = "Show the price more compact.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 13) - public boolean moneyPerHourCompactPrice = false; - - @Expose - @ConfigOption( - name = "Use Custom", - desc = "Use the custom format below instead of classic ➜ §eSell Offer §7and other profiles ➜ §eNPC Price.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 13) - public boolean moneyPerHourUseCustomFormat = false; - - @Expose - @ConfigOption( - name = "Custom Format", - desc = "Set what prices to show") - @ConfigEditorDraggableList( - exampleText = { - "§eSell Offer", - "§eInstant Sell", - "§eNPC Price" - }, - requireNonEmpty = true - ) - @ConfigAccordionId(id = 13) - public List moneyPerHourCustomFormat = new ArrayList<>(Arrays.asList(0, 1, 2)); - - @Expose - @ConfigOption( - name = "Merge Seeds", - desc = "Merge the seeds price with the wheat price.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 13) - public boolean moneyPerHourMergeSeeds = true; - - @Expose - @ConfigOption( - name = "Include Bountiful", - desc = "Includes the coins from Bountiful in the calculation.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 13) - public boolean moneyPerHourBountiful = true; - - @Expose - @ConfigOption( - name = "Include Mooshroom Cow", - desc = "Includes the coins you get from selling the mushrooms from your Mooshroom Cow pet.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 13) - public boolean moneyPerHourMooshroom = true; - - @Expose - @ConfigOption( - name = "Include Armor Drops", - desc = "Includes the average coins/hr from your armor.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 13) - public boolean moneyPerHourArmor = true; - - @Expose - @ConfigOption( - name = "Include Dicer Drops", - desc = "Includes the average coins/hr from your melon or pumpkin dicer.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 13) - public boolean moneyPerHourDicer = true; - - @Expose - @ConfigOption( - name = "Hide Title", - desc = "Hides the first line of 'Money Per Hour' entirely.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 13) - public boolean moneyPerHourHideTitle = false; - - @Expose - public Position moneyPerHourPos = new Position(-330, 170, false, true); - @Expose @ConfigOption(name = "Next Jacob's Contest", desc = "") - @ConfigEditorAccordion(id = 14) - public boolean nextJacobContest = false; - - @Expose - @ConfigOption(name = "Show Jacob's Contest", desc = "Show the current or next Jacob's farming contest time and crops.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 14) - @FeatureToggle - public boolean nextJacobContestDisplay = true; + @Accordion + public NextJacobContestConfig nextJacobContests = new NextJacobContestConfig(); + public static class NextJacobContestConfig{ + @Expose + @ConfigOption(name = "Show Jacob's Contest", desc = "Show the current or next Jacob's farming contest time and crops.") + @ConfigEditorBoolean + @FeatureToggle + public boolean display = true; - @Expose - @ConfigOption(name = "Outside Garden", desc = "Show the timer not only in Garden but everywhere in SkyBlock.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 14) - public boolean nextJacobContestEverywhere = false; + @Expose + @ConfigOption(name = "Outside Garden", desc = "Show the timer not only in Garden but everywhere in SkyBlock.") + @ConfigEditorBoolean + public boolean everywhere = false; - @Expose - @ConfigOption(name = "In Other Guis", desc = "Mark the current or next Farming Contest crops in other farming GUIs as underlined.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 14) - public boolean nextJacobContestOtherGuis = false; + @Expose + @ConfigOption(name = "In Other Guis", desc = "Mark the current or next Farming Contest crops in other farming GUIs as underlined.") + @ConfigEditorBoolean + public boolean otherGuis = false; - @Expose - @ConfigOption(name = "Fetch Contests", desc = "Automatically fetch Contests from elitebot.dev for the current year if they're uploaded already.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 14) - public boolean nextJacobContestsFetchAutomatically = true; + @Expose + @ConfigOption(name = "Fetch Contests", desc = "Automatically fetch Contests from elitebot.dev for the current year if they're uploaded already.") + @ConfigEditorBoolean + public boolean fetchAutomatically = true; - @Expose - @ConfigOption(name = "Share Contests", desc = "Share the list of upcoming Contests to elitebot.dev for everyone else to then fetch automatically.") - @ConfigEditorDropdown(values = { "Ask When Needed", "Share Automatically", "Disabled" }) - @ConfigAccordionId(id = 14) - public int nextJacobContestsShareAutomatically = 0; + @Expose + @ConfigOption(name = "Share Contests", desc = "Share the list of upcoming Contests to elitebot.dev for everyone else to then fetch automatically.") + @ConfigEditorDropdown(values = { "Ask When Needed", "Share Automatically", "Disabled" }) + public int shareAutomatically = 0; - @Expose - @ConfigOption(name = "Warning", desc = "Show a warning shortly before a new Jacob's Contest starts.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 14) - public boolean nextJacobContestWarn = false; + @Expose + @ConfigOption(name = "Warning", desc = "Show a warning shortly before a new Jacob's Contest starts.") + @ConfigEditorBoolean + public boolean warn = false; - @Expose - @ConfigOption(name = "Warning Time", desc = "Set the warning time in seconds before a Jacob's Contest begins.") - @ConfigEditorSlider( - minValue = 10, - maxValue = 60 * 5, - minStep = 1 - ) - @ConfigAccordionId(id = 14) - public int nextJacobContestWarnTime = 60 * 2; + @Expose + @ConfigOption(name = "Warning Time", desc = "Set the warning time in seconds before a Jacob's Contest begins.") + @ConfigEditorSlider( + minValue = 10, + maxValue = 60 * 5, + minStep = 1 + ) + public int warnTime = 60 * 2; - @Expose - @ConfigOption(name = "Popup Warning", desc = "Opens a popup when the warning time is reached and Minecraft is not in focus.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 14) - public boolean nextJacobContestWarnPopup = false; + @Expose + @ConfigOption(name = "Popup Warning", desc = "Opens a popup when the warning time is reached and Minecraft is not in focus.") + @ConfigEditorBoolean + public boolean warnPopup = false; - @Expose - public Position nextJacobContestPos = new Position(-200, 10, false, true); + @Expose + public Position pos = new Position(-200, 10, false, true); + } @Expose @ConfigOption(name = "Farming Armor Drops", desc = "") - @ConfigEditorAccordion(id = 18) - public boolean farmingArmorDrops = false; - - @Expose - @ConfigOption(name = "Show Counter", desc = "Count all §9Cropie§7, §5Squash §7and §6Fermento §7dropped.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 18) - @FeatureToggle - public boolean farmingArmorDropsEnabled = true; + @Accordion + public FarmingArmorDropsConfig farmingArmorDrop = new FarmingArmorDropsConfig(); + public static class FarmingArmorDropsConfig{ + @Expose + @ConfigOption(name = "Show Counter", desc = "Count all §9Cropie§7, §5Squash §7and §6Fermento §7dropped.") + @ConfigEditorBoolean + @FeatureToggle + public boolean enabled = true; - @Expose - @ConfigOption(name = "Hide Chat", desc = "Hide the chat message when receiving a farming armor drop.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 18) - @FeatureToggle - public boolean farmingArmorDropsHideChat = false; + @Expose + @ConfigOption(name = "Hide Chat", desc = "Hide the chat message when receiving a farming armor drop.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hideChat = false; - @Expose - public Position farmingArmorDropsPos = new Position(16, -232, false, true); + @Expose + public Position pos = new Position(16, -232, false, true); + } @Expose @ConfigOption(name = "Anita Shop", desc = "") - @ConfigEditorAccordion(id = 16) - public boolean anitaMedalProfit = false; - - @Expose - @ConfigOption( - name = "Medal Prices", - desc = "Helps to identify profitable items to buy at the Anita item shop " + - "and potential profit from selling the item in the Auction House." - ) - @ConfigEditorBoolean - @ConfigAccordionId(id = 16) - @FeatureToggle - public boolean anitaMedalProfitEnabled = true; + @Accordion + public AnitaShopConfig anitaShop = new AnitaShopConfig(); + public static class AnitaShopConfig { + @Expose + @ConfigOption( + name = "Medal Prices", + desc = "Helps to identify profitable items to buy at the Anita item shop " + + "and potential profit from selling the item in the Auction House." + ) + @ConfigEditorBoolean + @FeatureToggle + public boolean medalProfitEnabled = true; - @Expose - @ConfigOption( - name = "Extra Farming Fortune", - desc = "Show current tier and cost to max out in the item tooltip.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 16) - @FeatureToggle - public boolean extraFarmingFortune = true; + @Expose + @ConfigOption( + name = "Extra Farming Fortune", + desc = "Show current tier and cost to max out in the item tooltip.") + @ConfigEditorBoolean + @FeatureToggle + public boolean extraFarmingFortune = true; - @Expose - public Position anitaMedalProfitPos = new Position(206, 158, false, true); + @Expose + public Position medalProfitPos = new Position(206, 158, false, true); + } @Expose @ConfigOption(name = "Composter", desc = "") - @ConfigEditorAccordion(id = 17) - public boolean composter = false; - - @Expose - @ConfigOption( - name = "Composter Overlay", - desc = "Show organic matter, fuel, and profit prices while inside the Composter Inventory." - ) - @ConfigEditorBoolean - @ConfigAccordionId(id = 17) - @FeatureToggle - public boolean composterOverlay = true; - - @Expose - @ConfigOption(name = "Overlay Price", desc = "Toggle for Bazaar 'buy order' vs 'instant buy' price in composter overlay.") - @ConfigEditorDropdown(values = {"Instant Buy", "Buy Order"}) - @ConfigAccordionId(id = 17) - public int composterOverlayPriceType = 0; - - @Expose - @ConfigOption(name = "Retrieve From", desc = "Change where to retrieve the materials from in the composter overlay: The Bazaar or Sacks.") - @ConfigEditorDropdown(values = {"Bazaar", "Sacks"}) - @ConfigAccordionId(id = 17) - public int composterOverlayRetrieveFrom = 0; - - @Expose - public Position composterOverlayOrganicMatterPos = new Position(140, 152, false, true); - - @Expose - public Position composterOverlayFuelExtrasPos = new Position(-320, 152, false, true); + @Accordion + public ComposterConfig composters = new ComposterConfig(); + public static class ComposterConfig{ + @Expose + @ConfigOption( + name = "Composter Overlay", + desc = "Show organic matter, fuel, and profit prices while inside the Composter Inventory." + ) + @ConfigEditorBoolean + @FeatureToggle + public boolean overlay = true; - @Expose - @ConfigOption( - name = "Display Element", - desc = "Displays the Compost data from the tab list as GUI element." - ) - @ConfigEditorBoolean - @ConfigAccordionId(id = 17) - @FeatureToggle - public boolean composterDisplayEnabled = true; + @Expose + @ConfigOption(name = "Overlay Price", desc = "Toggle for Bazaar 'buy order' vs 'instant buy' price in composter overlay.") + @ConfigEditorDropdown(values = {"Instant Buy", "Buy Order"}) + public int overlayPriceType = 0; - @Expose - @ConfigOption( - name = "Outside Garden", - desc = "Show Time till Composter is empty outside Garden" - ) - @ConfigEditorBoolean - @ConfigAccordionId(id = 17) - @FeatureToggle - public boolean composterDisplayOutsideGarden = false; + @Expose + @ConfigOption(name = "Retrieve From", desc = "Change where to retrieve the materials from in the composter overlay: The Bazaar or Sacks.") + @ConfigEditorDropdown(values = {"Bazaar", "Sacks"}) + public int retrieveFrom = 0; - @Expose - @ConfigOption( - name = "Composter Warning", - desc = "Warn when the Composter gets close to empty, even outside Garden." - ) - @ConfigEditorBoolean - @ConfigAccordionId(id = 17) - public boolean composterWarnAlmostClose = false; + @Expose + public Position overlayOrganicMatterPos = new Position(140, 152, false, true); - @Expose - @ConfigOption( - name = "Upgrade Price", - desc = "Show the price for the Composter Upgrade in the lore." - ) - @ConfigEditorBoolean - @ConfigAccordionId(id = 17) - @FeatureToggle - public boolean composterUpgradePrice = true; + @Expose + public Position overlayFuelExtrasPos = new Position(-320, 152, false, true); - @Expose - @ConfigOption( - name = "Round Amount Needed", - desc = "Rounds the amount needed to fill your Composter down so that you don't overspend." - ) - @ConfigEditorBoolean - @ConfigAccordionId(id = 17) - public boolean composterRoundDown = true; + @Expose + @ConfigOption( + name = "Display Element", + desc = "Displays the Compost data from the tab list as GUI element." + ) + @ConfigEditorBoolean + @FeatureToggle + public boolean displayEnabled = true; - @Expose - @ConfigOption( - name = "Highlight Upgrade", - desc = "Highlight Upgrades that can be bought right now." - ) - @ConfigEditorBoolean - @ConfigAccordionId(id = 17) - @FeatureToggle - public boolean composterHighLightUpgrade = true; + @Expose + @ConfigOption( + name = "Outside Garden", + desc = "Show Time till Composter is empty outside Garden" + ) + @ConfigEditorBoolean + @FeatureToggle + public boolean displayOutsideGarden = false; - @Expose - @ConfigOption( - name = "Inventory Numbers", - desc = "Show the amount of Organic Matter, Fuel and Composts Available while inside the Composter Inventory." - ) - @ConfigEditorBoolean - @ConfigAccordionId(id = 17) - @FeatureToggle - public boolean composterInventoryNumbers = true; + @Expose + @ConfigOption( + name = "Composter Warning", + desc = "Warn when the Composter gets close to empty, even outside Garden." + ) + @ConfigEditorBoolean + public boolean warnAlmostClose = false; - @Expose - @ConfigOption(name = "Notification When Low Composter", desc = "") - @ConfigAccordionId(id = 17) - @ConfigEditorAccordion(id = 21) - public boolean composterNotifyLow = false; + @Expose + @ConfigOption( + name = "Upgrade Price", + desc = "Show the price for the Composter Upgrade in the lore." + ) + @ConfigEditorBoolean + @FeatureToggle + public boolean upgradePrice = true; - @Expose - @ConfigOption(name = "Enable", desc = "Show a notification when Organic Matter or Fuel runs low in your Composter.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 21) - @FeatureToggle - public boolean composterNotifyLowEnabled = false; + @Expose + @ConfigOption( + name = "Round Amount Needed", + desc = "Rounds the amount needed to fill your Composter down so that you don't overspend." + ) + @ConfigEditorBoolean + public boolean roundDown = true; - @Expose - @ConfigOption(name = "Show Title", desc = "Send a title to notify.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 21) - public boolean composterNotifyLowTitle = false; + @Expose + @ConfigOption( + name = "Highlight Upgrade", + desc = "Highlight Upgrades that can be bought right now." + ) + @ConfigEditorBoolean + @FeatureToggle + public boolean highlightUpgrade = true; - @Expose - @ConfigOption(name = "Min Organic Matter", desc = "Warn when Organic Matter is below this value.") - @ConfigEditorSlider( - minValue = 1_000, - maxValue = 80_000, - minStep = 1 - ) - @ConfigAccordionId(id = 21) - public int composterNotifyLowOrganicMatter = 20_000; + @Expose + @ConfigOption( + name = "Inventory Numbers", + desc = "Show the amount of Organic Matter, Fuel and Composts Available while inside the Composter Inventory." + ) + @ConfigEditorBoolean + @FeatureToggle + public boolean inventoryNumbers = true; - @Expose - @ConfigOption(name = "Min Fuel Cap", desc = "Warn when Fuel is below this value.") - @ConfigEditorSlider( - minValue = 500, - maxValue = 40_000, - minStep = 1 - ) - @ConfigAccordionId(id = 21) - public int composterNotifyLowFuel = 10_000; + @Expose + @ConfigOption(name = "Notification When Low Composter", desc = "") + @Accordion + public NotifyLowConfig notifyLow = new NotifyLowConfig(); + public static class NotifyLowConfig { + @Expose + @ConfigOption(name = "Enable", desc = "Show a notification when Organic Matter or Fuel runs low in your Composter.") + @ConfigEditorBoolean + @FeatureToggle + public boolean enabled = false; + + @Expose + @ConfigOption(name = "Show Title", desc = "Send a title to notify.") + @ConfigEditorBoolean + public boolean title = false; + + @Expose + @ConfigOption(name = "Min Organic Matter", desc = "Warn when Organic Matter is below this value.") + @ConfigEditorSlider( + minValue = 1_000, + maxValue = 80_000, + minStep = 1 + ) + public int organicMatter = 20_000; + + @Expose + @ConfigOption(name = "Min Fuel Cap", desc = "Warn when Fuel is below this value.") + @ConfigEditorSlider( + minValue = 500, + maxValue = 40_000, + minStep = 1 + ) + public int fuel = 10_000; + } - @Expose - public Position composterDisplayPos = new Position(-390, 10, false, true); + @Expose + public Position displayPos = new Position(-390, 10, false, true); - @Expose - public Position composterOutsideGardenPos = new Position(-363, 13, false, true); + @Expose + public Position outsideGardenPos = new Position(-363, 13, false, true); + } @Expose @ConfigOption(name = "Farming Fortune Display", desc = "") - @ConfigEditorAccordion(id = 22) - public boolean farmingFortune = false; - - @Expose - @ConfigOption( - name = "FF Display", - desc = "Displays the true Farming Fortune for the current crop, including all crop-specific and hidden bonuses." - ) - @ConfigEditorBoolean - @ConfigAccordionId(id = 22) - @FeatureToggle - public boolean farmingFortuneDisplay = true; + @Accordion + public FarmingFortuneConfig farmingFortunes = new FarmingFortuneConfig(); + public static class FarmingFortuneConfig{ + @Expose + @ConfigOption( + name = "FF Display", + desc = "Displays the true Farming Fortune for the current crop, including all crop-specific and hidden bonuses." + ) + @ConfigEditorBoolean + @FeatureToggle + public boolean display = true; - @Expose - @ConfigOption( - name = "Show As Drop Multiplier", - desc = "Adds 100 to the displayed Farming Fortune so that it represents a drop multiplier rather than" + - " the chance for bonus drops. " - ) - @ConfigEditorBoolean - @ConfigAccordionId(id = 22) - public boolean farmingFortuneDropMultiplier = true; + @Expose + @ConfigOption( + name = "Show As Drop Multiplier", + desc = "Adds 100 to the displayed Farming Fortune so that it represents a drop multiplier rather than" + + " the chance for bonus drops. " + ) + @ConfigEditorBoolean + public boolean dropMultiplier = true; - @ConfigOption(name = "Farming Fortune Guide", desc = "Opens a guide that breaks down your Farming Fortune.\n§eCommand: /ff") - @ConfigEditorButton(buttonText = "Open") - public Runnable open = Commands::openFortuneGuide; + @ConfigOption(name = "Farming Fortune Guide", desc = "Opens a guide that breaks down your Farming Fortune.\n§eCommand: /ff") + @ConfigEditorButton(buttonText = "Open") + public Runnable open = Commands::openFortuneGuide; - @Expose - public Position farmingFortunePos = new Position(5, -180, false, true); + @Expose + public Position pos = new Position(5, -180, false, true); + } @Expose @ConfigOption(name = "Tooltip Tweaks", desc = "") - @ConfigEditorAccordion(id = 20) - public boolean tooltipTweaks = false; - - @Expose - @ConfigOption( - name = "Compact Descriptions", - desc = "Hides redundant parts of reforge descriptions, generic counter description, and Farmhand perk explanation." - ) - @ConfigEditorBoolean - @ConfigAccordionId(id = 20) - @FeatureToggle - public boolean compactToolTooltips = false; + @Accordion + public TooltipTweaksConfig tooltipTweak = new TooltipTweaksConfig(); + public static class TooltipTweaksConfig{ + @Expose + @ConfigOption( + name = "Compact Descriptions", + desc = "Hides redundant parts of reforge descriptions, generic counter description, and Farmhand perk explanation." + ) + @ConfigEditorBoolean + @FeatureToggle + public boolean compactToolTooltips = false; - @Expose - @ConfigOption( - name = "Breakdown Hotkey", - desc = "When the keybind is pressed, show a breakdown of all fortune sources on a tool." - ) - @ConfigEditorKeybind(defaultKey = Keyboard.KEY_LSHIFT) - @ConfigAccordionId(id = 20) - public int fortuneTooltipKeybind = Keyboard.KEY_LSHIFT; + @Expose + @ConfigOption( + name = "Breakdown Hotkey", + desc = "When the keybind is pressed, show a breakdown of all fortune sources on a tool." + ) + @ConfigEditorKeybind(defaultKey = Keyboard.KEY_LSHIFT) + public int fortuneTooltipKeybind = Keyboard.KEY_LSHIFT; - @Expose - @ConfigOption( - name = "Tooltip Format", - desc = "Show crop-specific Farming Fortune in tooltip.\n" + - "§fShow: §7Crop-specific Fortune indicated as §6[+196]\n" + - "§fReplace: §7Edits the total Fortune to include crop-specific Fortune." - ) - @ConfigEditorDropdown(values = {"Default", "Show", "Replace"}) - @ConfigAccordionId(id = 20) - public int cropTooltipFortune = 1; + @Expose + @ConfigOption( + name = "Tooltip Format", + desc = "Show crop-specific Farming Fortune in tooltip.\n" + + "§fShow: §7Crop-specific Fortune indicated as §6[+196]\n" + + "§fReplace: §7Edits the total Fortune to include crop-specific Fortune." + ) + @ConfigEditorDropdown(values = {"Default", "Show", "Replace"}) + public int cropTooltipFortune = 1; - @Expose - @ConfigOption( - name = "Total Crop Milestone", - desc = "Shows the progress bar till maxed crop milestone in the crop milestone inventory." - ) - @ConfigEditorBoolean - @ConfigAccordionId(id = 20) - @FeatureToggle - public boolean cropMilestoneTotalProgress = true; + @Expose + @ConfigOption( + name = "Total Crop Milestone", + desc = "Shows the progress bar till maxed crop milestone in the crop milestone inventory." + ) + @ConfigEditorBoolean + @FeatureToggle + public boolean cropMilestoneTotalProgress = true; + } @Expose @ConfigOption(name = "Yaw and Pitch", desc = "") @Accordion - public YawPitchDisplay yawPitchDisplay = new YawPitchDisplay(); + public YawPitchDisplayConfig yawPitchDisplay = new YawPitchDisplayConfig(); - public static class YawPitchDisplay { + public static class YawPitchDisplayConfig { @Expose @ConfigOption(name = "Enable", desc = "Displays yaw and pitch while holding a farming tool. Automatically fades out if there is no movement.") @@ -1384,9 +1282,9 @@ public class GardenConfig { @Expose @ConfigOption(name = "Crop Start Location", desc = "") @Accordion - public CropStartLocation cropStartLocation = new CropStartLocation(); + public CropStartLocationConfig cropStartLocation = new CropStartLocationConfig(); - public static class CropStartLocation { + public static class CropStartLocationConfig { @Expose @ConfigOption(name = "Enable", desc = "Show the start waypoint for your farm with the currently holding tool.") diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/InventoryConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/InventoryConfig.java index adf684a84..971985b74 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/InventoryConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/InventoryConfig.java @@ -4,8 +4,6 @@ import at.hannibal2.skyhanni.config.FeatureToggle; import at.hannibal2.skyhanni.config.core.config.Position; import com.google.gson.annotations.Expose; import io.github.moulberry.moulconfig.annotations.Accordion; -import io.github.moulberry.moulconfig.annotations.ConfigAccordionId; -import io.github.moulberry.moulconfig.annotations.ConfigEditorAccordion; import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; import io.github.moulberry.moulconfig.annotations.ConfigEditorColour; import io.github.moulberry.moulconfig.annotations.ConfigEditorDraggableList; @@ -19,144 +17,139 @@ import java.util.List; public class InventoryConfig { - @ConfigOption(name = "Not Clickable Items", desc = "") - @ConfigEditorAccordion(id = 0) - public boolean hideNotClickable = false; - @Expose - @ConfigOption(name = "Enabled", desc = "Hide items that are not clickable in the current inventory: ah, bz, accessory bag, etc.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - @FeatureToggle - public boolean hideNotClickableItems = false; + @ConfigOption(name = "Not Clickable Items", desc = "") + @Accordion + public HideNotClickableConfig hideNotClickable = new HideNotClickableConfig(); - @Expose - @ConfigOption(name = "Block Clicks", desc = "Block the clicks on these items.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - public boolean hideNotClickableItemsBlockClicks = true; + public static class HideNotClickableConfig{ + @Expose + @ConfigOption(name = "Enabled", desc = "Hide items that are not clickable in the current inventory: ah, bz, accessory bag, etc.") + @ConfigEditorBoolean + @FeatureToggle + public boolean items = false; - @Expose - @ConfigOption( - name = "Opacity", - desc = "How strong should the items be grayed out?" - ) - @ConfigEditorSlider( - minValue = 0, - maxValue = 255, - minStep = 5 - ) - @ConfigAccordionId(id = 0) - public int hideNotClickableOpacity = 180; + @Expose + @ConfigOption(name = "Block Clicks", desc = "Block the clicks on these items.") + @ConfigEditorBoolean + public boolean itemsBlockClicks = true; - @Expose - @ConfigOption(name = "Bypass With Control", desc = "Adds the ability to bypass not clickable items when holding the control key.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - public boolean notClickableItemsBypass = true; + @Expose + @ConfigOption( + name = "Opacity", + desc = "How strong should the items be grayed out?" + ) + @ConfigEditorSlider( + minValue = 0, + maxValue = 255, + minStep = 5 + ) + public int opacity = 180; - @Expose - @ConfigOption(name = "Green Line", desc = "Adds green line around items that are clickable.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - public boolean hideNotClickableItemsGreenLine = true; + @Expose + @ConfigOption(name = "Bypass With Control", desc = "Adds the ability to bypass not clickable items when holding the control key.") + @ConfigEditorBoolean + public boolean itemsBypass = true; - @ConfigOption(name = "RNG Meter", desc = "") - @ConfigEditorAccordion(id = 1) - public boolean rngMeter = false; + @Expose + @ConfigOption(name = "Green Line", desc = "Adds green line around items that are clickable.") + @ConfigEditorBoolean + public boolean itemsGreenLine = true; - @Expose - @ConfigOption(name = "Floor Names", desc = "Show the Floor names in the Catacombs RNG Meter inventory.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - @FeatureToggle - public boolean rngMeterFloorName = false; + } @Expose - @ConfigOption(name = "No Drop", desc = "Highlight floors without a drop selected in the Catacombs RNG Meter inventory.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - @FeatureToggle - public boolean rngMeterNoDrop = false; + @ConfigOption(name = "RNG Meter", desc = "") + @Accordion + public RngMeterConfig rngMeter = new RngMeterConfig(); + public static class RngMeterConfig{ + @Expose + @ConfigOption(name = "Floor Names", desc = "Show the Floor names in the Catacombs RNG Meter inventory.") + @ConfigEditorBoolean + @FeatureToggle + public boolean floorName = false; - @Expose - @ConfigOption(name = "Selected Drop", desc = "Highlight the selected drop in the Catacombs or Slayer RNG Meter inventory.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - @FeatureToggle - public boolean rngMeterSelectedDrop = false; + @Expose + @ConfigOption(name = "No Drop", desc = "Highlight floors without a drop selected in the Catacombs RNG Meter inventory.") + @ConfigEditorBoolean + @FeatureToggle + public boolean noDrop = false; - @ConfigOption(name = "Stats Tuning", desc = "") - @ConfigEditorAccordion(id = 2) - public boolean statsTuning = false; + @Expose + @ConfigOption(name = "Selected Drop", desc = "Highlight the selected drop in the Catacombs or Slayer RNG Meter inventory.") + @ConfigEditorBoolean + @FeatureToggle + public boolean selectedDrop = false; + } @Expose - @ConfigOption(name = "Selected Stats", desc = "Show the tuning stats in the Thaumaturgy inventory.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - @FeatureToggle - public boolean statsTuningSelectedStats = true; + @ConfigOption(name = "Stats Tuning", desc = "") + @Accordion + public StatsTuningConfig statsTuning = new StatsTuningConfig(); + public static class StatsTuningConfig{ + @Expose + @ConfigOption(name = "Selected Stats", desc = "Show the tuning stats in the Thaumaturgy inventory.") + @ConfigEditorBoolean + @FeatureToggle + public boolean selectedStats = true; - @Expose - @ConfigOption(name = "Tuning Points", desc = "Show the amount of selected Tuning Points in the Stats Tuning inventory.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - @FeatureToggle - public boolean statsTuningPoints = true; + @Expose + @ConfigOption(name = "Tuning Points", desc = "Show the amount of selected Tuning Points in the Stats Tuning inventory.") + @ConfigEditorBoolean + @FeatureToggle + public boolean points = true; - @Expose - @ConfigOption(name = "Selected Template", desc = "Highlight the selected template in the Stats Tuning inventory.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - @FeatureToggle - public boolean statsTuningSelectedTemplate = true; + @Expose + @ConfigOption(name = "Selected Template", desc = "Highlight the selected template in the Stats Tuning inventory.") + @ConfigEditorBoolean + @FeatureToggle + public boolean selectedTemplate = true; - @Expose - @ConfigOption(name = "Template Stats", desc = "Show the type of stats for the Tuning Point templates.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - @FeatureToggle - public boolean statsTuningTemplateStats = true; + @Expose + @ConfigOption(name = "Template Stats", desc = "Show the type of stats for the Tuning Point templates.") + @ConfigEditorBoolean + @FeatureToggle + public boolean templateStats = true; + } @Expose @ConfigOption(name = "Jacob Farming Contest", desc = "") - @ConfigEditorAccordion(id = 3) - public boolean jacobFarmingContest = false; + @Accordion + public JacobFarmingContestConfig jacobFarmingContests = new JacobFarmingContestConfig(); + public static class JacobFarmingContestConfig{ + @Expose + @ConfigOption(name = "Unclaimed Rewards", desc = "Highlight contests with unclaimed rewards in the Jacob inventory.") + @ConfigEditorBoolean + @FeatureToggle + public boolean highlightRewards = true; - @Expose - @ConfigOption(name = "Unclaimed Rewards", desc = "Highlight contests with unclaimed rewards in the Jacob inventory.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 3) - @FeatureToggle - public boolean jacobFarmingContestHighlightRewards = true; + @Expose + @ConfigOption(name = "Contest Time", desc = "Adds the real time format to the Contest description.") + @ConfigEditorBoolean + @FeatureToggle + public boolean realTime = true; - @Expose - @ConfigOption(name = "Contest Time", desc = "Adds the real time format to the Contest description.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 3) - @FeatureToggle - public boolean jacobFarmingContestRealTime = true; + @Expose + @ConfigOption(name = "Medal Icon", desc = "Adds a symbol that shows what medal you received in this Contest. " + + "§eIf you use a texture pack this may cause conflicting icons.") + @ConfigEditorBoolean + @FeatureToggle + public boolean medalIcon = true; + + @Expose + @ConfigOption(name = "Finnegan Icon", desc = "Uses a different indicator for when the Contest happened during Mayor Finnegan.") + @ConfigEditorBoolean + public boolean finneganIcon = true; + } - @Expose - @ConfigOption(name = "Medal Icon", desc = "Adds a symbol that shows what medal you received in this Contest. " + - "§eIf you use a texture pack this may cause conflicting icons.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 3) - @FeatureToggle - public boolean jacobFarmingContestMedalIcon = true; - @Expose - @ConfigOption(name = "Finnegan Icon", desc = "Uses a different indicator for when the Contest happened during Mayor Finnegan.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 3) - public boolean jacobFarmingContestFinneganIcon = true; @Expose @ConfigOption(name = "Sack Items Display", desc = "") @Accordion - public SackDisplay sackDisplay = new SackDisplay(); + public SackDisplayConfig sackDisplay = new SackDisplayConfig(); - public static class SackDisplay { + public static class SackDisplayConfig { @Expose @ConfigOption(name = "Enabled", desc = "Show contained items inside a sack inventory.") diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/ItemAbilityConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/ItemAbilityConfig.java index e30e06fcb..5e326a209 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/ItemAbilityConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/ItemAbilityConfig.java @@ -4,8 +4,6 @@ import at.hannibal2.skyhanni.config.FeatureToggle; import at.hannibal2.skyhanni.config.core.config.Position; import com.google.gson.annotations.Expose; import io.github.moulberry.moulconfig.annotations.Accordion; -import io.github.moulberry.moulconfig.annotations.ConfigAccordionId; -import io.github.moulberry.moulconfig.annotations.ConfigEditorAccordion; import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; import io.github.moulberry.moulconfig.annotations.ConfigEditorColour; import io.github.moulberry.moulconfig.annotations.ConfigEditorDropdown; @@ -26,23 +24,22 @@ public class ItemAbilityConfig { @Expose @ConfigOption(name = "Fire Veil", desc = "") - @ConfigEditorAccordion(id = 1) - public boolean fireVeilWand = false; - - @Expose - @ConfigOption(name = "Fire Veil Design", desc = "Changes the flame particles of the Fire Veil Wand ability.") - @ConfigEditorDropdown(values = {"Particles", "Line", "Off"}) - @ConfigAccordionId(id = 1) - public int fireVeilWandDisplay = 0; + @Accordion + public FireVeilWandConfig fireVeilWands = new FireVeilWandConfig(); + public static class FireVeilWandConfig{ + @Expose + @ConfigOption(name = "Fire Veil Design", desc = "Changes the flame particles of the Fire Veil Wand ability.") + @ConfigEditorDropdown(values = {"Particles", "Line", "Off"}) + public int display = 0; - @Expose - @ConfigOption( - name = "Line Color", - desc = "Changes the color of the Fire Veil Wand line." - ) - @ConfigEditorColour - @ConfigAccordionId(id = 1) - public String fireVeilWandDisplayColor = "0:245:255:85:85"; + @Expose + @ConfigOption( + name = "Line Color", + desc = "Changes the color of the Fire Veil Wand line." + ) + @ConfigEditorColour + public String displayColor = "0:245:255:85:85"; + } @ConfigOption(name = "Chicken Head", desc = "") @Accordion diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/MinionsConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/MinionsConfig.java index 2563ca25a..35fe9d8f7 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/MinionsConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/MinionsConfig.java @@ -3,12 +3,7 @@ package at.hannibal2.skyhanni.config.features; import at.hannibal2.skyhanni.config.FeatureToggle; import at.hannibal2.skyhanni.config.core.config.Position; import com.google.gson.annotations.Expose; -import io.github.moulberry.moulconfig.annotations.ConfigAccordionId; -import io.github.moulberry.moulconfig.annotations.ConfigEditorAccordion; -import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; -import io.github.moulberry.moulconfig.annotations.ConfigEditorColour; -import io.github.moulberry.moulconfig.annotations.ConfigEditorSlider; -import io.github.moulberry.moulconfig.annotations.ConfigOption; +import io.github.moulberry.moulconfig.annotations.*; public class MinionsConfig { @@ -23,62 +18,61 @@ public class MinionsConfig { @ConfigEditorBoolean public boolean nameOnlyTier = false; + @Expose @ConfigOption(name = "Last Clicked", desc = "") - @ConfigEditorAccordion(id = 0) - public boolean lastClickedMinion = false; + @Accordion + public LastClickedMinionConfig lastClickedMinion = new LastClickedMinionConfig(); + public static class LastClickedMinionConfig { + @Expose + @ConfigOption(name = "Last Minion Display", desc = "Marks the location of the last clicked minion, even through walls.") + @ConfigEditorBoolean + @FeatureToggle + public boolean display = false; - @Expose - @ConfigOption(name = "Last Minion Display", desc = "Marks the location of the last clicked minion, even through walls.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - @FeatureToggle - public boolean lastClickedMinionDisplay = false; + @Expose + @ConfigOption( + name = "Last Minion Color", + desc = "The color in which the last minion should be displayed." + ) + @ConfigEditorColour + public String color = "0:245:85:255:85"; - @Expose - @ConfigOption( - name = "Last Minion Color", - desc = "The color in which the last minion should be displayed." - ) - @ConfigEditorColour - @ConfigAccordionId(id = 0) - public String lastOpenedMinionColor = "0:245:85:255:85"; + @Expose + @ConfigOption( + name = "Last Minion Time", + desc = "Time in seconds how long the last minion should be displayed." + ) + @ConfigEditorSlider( + minValue = 3, + maxValue = 120, + minStep = 1 + ) + public int time = 20; + } @Expose - @ConfigOption( - name = "Last Minion Time", - desc = "Time in seconds how long the last minion should be displayed." - ) - @ConfigEditorSlider( - minValue = 3, - maxValue = 120, - minStep = 1 - ) - @ConfigAccordionId(id = 0) - public int lastOpenedMinionTime = 20; - @ConfigOption(name = "Emptied Time", desc = "") - @ConfigEditorAccordion(id = 1) - public boolean emptiedTime = false; + @Accordion + public EmptiedTimeConfig emptiedTime = new EmptiedTimeConfig(); + public static class EmptiedTimeConfig{ + @Expose + @ConfigOption(name = "Emptied Time Display", desc = "Show the time when the hopper in the minion was last emptied.") + @ConfigEditorBoolean + @FeatureToggle + public boolean display = false; - @Expose - @ConfigOption(name = "Emptied Time Display", desc = "Show the time when the hopper in the minion was last emptied.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - @FeatureToggle - public boolean emptiedTimeDisplay = false; - - @Expose - @ConfigOption( - name = "Distance", - desc = "Maximum distance to display minion data." - ) - @ConfigEditorSlider( - minValue = 3, - maxValue = 30, - minStep = 1 - ) - @ConfigAccordionId(id = 1) - public int distance = 10; + @Expose + @ConfigOption( + name = "Distance", + desc = "Maximum distance to display minion data." + ) + @ConfigEditorSlider( + minValue = 3, + maxValue = 30, + minStep = 1 + ) + public int distance = 10; + } @Expose @ConfigOption(name = "Hopper Profit Display", desc = "Use the hopper's held coins and the last empty time to calculate the coins per day.") diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java index 081716f3f..33eed59ae 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java @@ -4,8 +4,6 @@ import at.hannibal2.skyhanni.config.FeatureToggle; import at.hannibal2.skyhanni.config.core.config.Position; import com.google.gson.annotations.Expose; import io.github.moulberry.moulconfig.annotations.Accordion; -import io.github.moulberry.moulconfig.annotations.ConfigAccordionId; -import io.github.moulberry.moulconfig.annotations.ConfigEditorAccordion; import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; import io.github.moulberry.moulconfig.annotations.ConfigEditorColour; import io.github.moulberry.moulconfig.annotations.ConfigEditorDraggableList; @@ -25,40 +23,39 @@ public class MiscConfig { @Expose @ConfigOption(name = "Pet", desc = "") - @ConfigEditorAccordion(id = 0) - public boolean pet = false; - - @Expose - @ConfigOption(name = "Pet Display", desc = "Show the currently active pet.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - @FeatureToggle - public boolean petDisplay = false; - - @Expose - @ConfigOption(name = "Pet Experience Tooltip", desc = "") - @ConfigAccordionId(id = 0) @Accordion - public PetExperienceToolTipConfig petExperienceToolTip = new PetExperienceToolTipConfig(); - - public static class PetExperienceToolTipConfig { - + public PetConfig pets = new PetConfig(); + public static class PetConfig{ @Expose - @ConfigOption(name = "Enabled", desc = "Show the full pet exp and the progress to level 100 (ignoring rarity) when hovering over a pet while pressing shift key.") + @ConfigOption(name = "Pet Display", desc = "Show the currently active pet.") @ConfigEditorBoolean @FeatureToggle - public boolean petDisplay = true; + public boolean display = false; @Expose - @ConfigOption(name = "Show Always", desc = "Show this info always, even if not pressing shift key.") - @ConfigEditorBoolean - public boolean showAlways = false; + @ConfigOption(name = "Pet Experience Tooltip", desc = "") + @Accordion + public PetExperienceToolTipConfig petExperienceToolTip = new PetExperienceToolTipConfig(); - @Expose - @ConfigOption(name = "Dragon Egg", desc = "For a Golden Dragon Egg, show progress to level 100 instead of 200.") - @ConfigEditorBoolean - public boolean showGoldenDragonEgg = true; + public static class PetExperienceToolTipConfig { + @Expose + @ConfigOption(name = "Enabled", desc = "Show the full pet exp and the progress to level 100 (ignoring rarity) when hovering over a pet while pressing shift key.") + @ConfigEditorBoolean + @FeatureToggle + public boolean petDisplay = true; + + @Expose + @ConfigOption(name = "Show Always", desc = "Show this info always, even if not pressing shift key.") + @ConfigEditorBoolean + public boolean showAlways = false; + + @Expose + @ConfigOption(name = "Dragon Egg", desc = "For a Golden Dragon Egg, show progress to level 100 instead of 200.") + @ConfigEditorBoolean + public boolean showGoldenDragonEgg = true; + + } } @Expose @@ -74,143 +71,128 @@ public class MiscConfig { @Expose @ConfigOption(name = "Mode", desc = "Hide the armor of players.") @ConfigEditorDropdown(values = {"All", "Own Armor", "Other's Armor", "Off"}) - @ConfigAccordionId(id = 1) public int mode = 3; @Expose @ConfigOption(name = "Only Helmet", desc = "Only hide the helmet.") @ConfigEditorBoolean() - @ConfigAccordionId(id = 3) public Boolean onlyHelmet = false; } @Expose @ConfigOption(name = "Potion Effects", desc = "") - @ConfigEditorAccordion(id = 5) - public boolean potionEffects = false; - - @Expose - @ConfigOption(name = "Non God Pot Effects", desc = "Display the active potion effects that are not part of the God Pot.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 5) - @FeatureToggle - public boolean nonGodPotEffectDisplay = false; + @Accordion + public PotionEffectsConfig potionEffect = new PotionEffectsConfig(); + public static class PotionEffectsConfig{ + @Expose + @ConfigOption(name = "Non God Pot Effects", desc = "Display the active potion effects that are not part of the God Pot.") + @ConfigEditorBoolean + @FeatureToggle + public boolean nonGodPotEffectDisplay = false; - @Expose - @ConfigOption(name = "Show Mixins", desc = "Include God Pot mixins in the Non God Pot Effects display.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 5) - @FeatureToggle - public boolean nonGodPotEffectShowMixins = false; + @Expose + @ConfigOption(name = "Show Mixins", desc = "Include God Pot mixins in the Non God Pot Effects display.") + @ConfigEditorBoolean + @FeatureToggle + public boolean nonGodPotEffectShowMixins = false; - @Expose - public Position nonGodPotEffectPos = new Position(10, 10, false, true); + @Expose + public Position nonGodPotEffectPos = new Position(10, 10, false, true); + } @Expose @ConfigOption(name = "Particle Hider", desc = "") - @ConfigEditorAccordion(id = 9) - public boolean particleHider = false; - - @Expose - @ConfigOption(name = "Blaze Particles", desc = "Hide Blaze particles.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 9) - @FeatureToggle - public boolean hideBlazeParticles = false; + @Accordion + public ParticleHiderConfig particleHiders = new ParticleHiderConfig(); + public static class ParticleHiderConfig{ + @Expose + @ConfigOption(name = "Blaze Particles", desc = "Hide Blaze particles.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hideBlazeParticles = false; - @Expose - @ConfigOption(name = "Enderman Particles", desc = "Hide Enderman particles.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 9) - @FeatureToggle - public boolean hideEndermanParticles = false; + @Expose + @ConfigOption(name = "Enderman Particles", desc = "Hide Enderman particles.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hideEndermanParticles = false; - @Expose - @ConfigOption(name = "Fireball Particles", desc = "Hide fireball particles.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 9) - @FeatureToggle - public boolean hideFireballParticles = true; + @Expose + @ConfigOption(name = "Fireball Particles", desc = "Hide fireball particles.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hideFireballParticles = true; - @Expose - @ConfigOption(name = "Fire Particles", desc = "Hide particles from the fire block.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 9) - @FeatureToggle - public boolean hideFireBlockParticles = true; + @Expose + @ConfigOption(name = "Fire Particles", desc = "Hide particles from the fire block.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hideFireBlockParticles = true; - @Expose - @ConfigOption(name = "Smoke Particles", desc = "Hide smoke particles.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 9) - @FeatureToggle - public boolean hideSmokeParticles = false; + @Expose + @ConfigOption(name = "Smoke Particles", desc = "Hide smoke particles.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hideSmokeParticles = false; - @Expose - @ConfigOption(name = "Far Particles", desc = "Hide particles that are more than 40 blocks away.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 9) - @FeatureToggle - public boolean hideFarParticles = true; + @Expose + @ConfigOption(name = "Far Particles", desc = "Hide particles that are more than 40 blocks away.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hideFarParticles = true; - @Expose - @ConfigOption(name = "Close Redstone Particles", desc = "Hide Redstone particles around the player (appear for some potion effects).") - @ConfigEditorBoolean - @ConfigAccordionId(id = 9) - @FeatureToggle - public boolean hideCloseRedstoneparticles = true; + @Expose + @ConfigOption(name = "Close Redstone Particles", desc = "Hide Redstone particles around the player (appear for some potion effects).") + @ConfigEditorBoolean + @FeatureToggle + public boolean hideCloseRedstoneParticles = true; + } @Expose @ConfigOption(name = "Estimated Item Value", desc = "(Prices for Enchantments, Reforge Stones, Gemstones, Drill Parts and more)") - @ConfigEditorAccordion(id = 11) - public boolean estimatedItemValue = false; - - @Expose - @ConfigOption(name = "Enable Estimated Price", desc = "Displays an Estimated Item Value for the item you hover over.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 11) - @FeatureToggle - public boolean estimatedIemValueEnabled = false; - - @Expose - @ConfigOption(name = "Hotkey", desc = "Press this key to show the Estimated Item Value.") - @ConfigEditorKeybind(defaultKey = Keyboard.KEY_NONE) - @ConfigAccordionId(id = 11) - public int estimatedItemValueHotkey = Keyboard.KEY_NONE; + @Accordion + public EstimatedItemValueConfig estimatedItemValues = new EstimatedItemValueConfig(); + public static class EstimatedItemValueConfig{ + @Expose + @ConfigOption(name = "Enable Estimated Price", desc = "Displays an Estimated Item Value for the item you hover over.") + @ConfigEditorBoolean + @FeatureToggle + public boolean enabled = false; - @Expose - @ConfigOption(name = "Show Always", desc = "Ignore the hotkey and always display the item value.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 11) - public boolean estimatedIemValueAlwaysEnabled = true; + @Expose + @ConfigOption(name = "Hotkey", desc = "Press this key to show the Estimated Item Value.") + @ConfigEditorKeybind(defaultKey = Keyboard.KEY_NONE) + public int hotkey = Keyboard.KEY_NONE; - @Expose - @ConfigOption(name = "Enchantments Cap", desc = "Only show the top # most expensive enchantments.") - @ConfigEditorSlider( - minValue = 1, - maxValue = 30, - minStep = 1 - ) - @ConfigAccordionId(id = 11) - public Property estimatedIemValueEnchantmentsCap = Property.of(7); + @Expose + @ConfigOption(name = "Show Always", desc = "Ignore the hotkey and always display the item value.") + @ConfigEditorBoolean + public boolean alwaysEnabled = true; + @Expose + @ConfigOption(name = "Enchantments Cap", desc = "Only show the top # most expensive enchantments.") + @ConfigEditorSlider( + minValue = 1, + maxValue = 30, + minStep = 1 + ) + public Property enchantmentsCap = Property.of(7); - @Expose - @ConfigOption(name = "Show Exact Price", desc = "Show the exact total price instead of the compact number.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 11) - public boolean estimatedIemValueExactPrice = false; + @Expose + @ConfigOption(name = "Show Exact Price", desc = "Show the exact total price instead of the compact number.") + @ConfigEditorBoolean + public boolean exactPrice = false; - @Expose - @ConfigOption(name = "Show Armor Value", desc = "Show the value of the full armor set in the Wardrobe inventory.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 11) - @FeatureToggle - public boolean estimatedIemValueArmor = true; + @Expose + @ConfigOption(name = "Show Armor Value", desc = "Show the value of the full armor set in the Wardrobe inventory.") + @ConfigEditorBoolean + @FeatureToggle + public boolean armor = true; - @Expose - public Position itemPriceDataPos = new Position(140, 90, false, true); + @Expose + public Position itemPriceDataPos = new Position(140, 90, false, true); + } @ConfigOption(name = "Discord Rich Presence", desc = "") @Accordion @@ -589,7 +571,6 @@ public class MiscConfig { @Expose @ConfigOption(name = "Player Sort", desc = "Change the sort order of player names in the tab list.") @ConfigEditorDropdown(values = {"Rank (Default)", "SB Level", "Name (Abc)", "Ironman/Bingo", "Party/Friends/Guild", "Random"}) - @ConfigAccordionId(id = 1) public int playerSortOrder = 0; @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java index d639068a5..6ac5f7452 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java @@ -45,9 +45,9 @@ public class RiftConfig { @ConfigOption(name = "Crux Talisman Progress", desc = "") @Accordion @Expose - public CruxTalismanDisplay cruxTalisman = new CruxTalismanDisplay(); + public CruxTalismanDisplayConfig cruxTalisman = new CruxTalismanDisplayConfig(); - public static class CruxTalismanDisplay { + public static class CruxTalismanDisplayConfig { @Expose @ConfigOption(name = "Crux Talisman Display", desc = "Display progress of the Crux Talisman on screen.") @ConfigEditorBoolean @@ -162,9 +162,9 @@ public class RiftConfig { @ConfigOption(name = "Kloon Hacking", desc = "") @Accordion @Expose - public KloonHacking hacking = new KloonHacking(); + public KloonHackingConfig hacking = new KloonHackingConfig(); - public static class KloonHacking { + public static class KloonHackingConfig { @Expose @ConfigOption(name = "Hacking Solver", desc = "Highlights the correct button to click in the hacking inventory.") @@ -259,9 +259,9 @@ public class RiftConfig { @ConfigOption(name = "Mirrorverse", desc = "") @Accordion @Expose - public MirrorVerse mirrorVerseConfig = new MirrorVerse(); + public MirrorVerseConfig mirrorVerseConfig = new MirrorVerseConfig(); - public static class MirrorVerse { + public static class MirrorVerseConfig { @ConfigOption(name = "Lava Maze", desc = "") @Accordion @@ -302,9 +302,9 @@ public class RiftConfig { @ConfigOption(name = "Upside Down Parkour", desc = "") @Accordion @Expose - public UpsideDownParkour upsideDownParkour = new UpsideDownParkour(); + public UpsideDownParkourConfig upsideDownParkour = new UpsideDownParkourConfig(); - public static class UpsideDownParkour { + public static class UpsideDownParkourConfig { @Expose @ConfigOption(name = "Enabled", desc = "Helps solving the upside down parkour in the Mirrorverse by showing the correct way.") @@ -343,9 +343,9 @@ public class RiftConfig { @ConfigOption(name = "Dance Room Helper", desc = "") @Accordion @Expose - public DanceRoomHelper danceRoomHelper = new DanceRoomHelper(); + public DanceRoomHelperConfig danceRoomHelper = new DanceRoomHelperConfig(); - public static class DanceRoomHelper { + public static class DanceRoomHelperConfig { @Expose @ConfigOption(name = "Enabled", desc = "Helps to solve the dance room in the Mirrorverse by showing multiple tasks at once.") @@ -377,9 +377,9 @@ public class RiftConfig { @Expose @ConfigOption(name = "Formatting", desc = "") @Accordion - public DanceRoomFormatting danceRoomFormatting = new DanceRoomFormatting(); + public DanceRoomFormattingConfig danceRoomFormatting = new DanceRoomFormattingConfig(); - public static class DanceRoomFormatting { + public static class DanceRoomFormattingConfig { @Expose @ConfigOption(name = "Now", desc = "Formatting for \"Now:\"") @@ -399,9 +399,9 @@ public class RiftConfig { @Expose @ConfigOption(name = "Color Option", desc = "") @Accordion - public Color color = new Color(); + public ColorConfig color = new ColorConfig(); - public static class Color { + public static class ColorConfig { @Expose @ConfigOption(name = "Move", desc = "Color for the Move instruction") @ConfigEditorText @@ -504,9 +504,9 @@ public class RiftConfig { @Expose @ConfigOption(name = "Living Metal Suit Progress", desc = "") @Accordion - public LivingMetalSuitProgress livingMetalSuitProgress = new LivingMetalSuitProgress(); + public LivingMetalSuitProgressConfig livingMetalSuitProgress = new LivingMetalSuitProgressConfig(); - public static class LivingMetalSuitProgress { + public static class LivingMetalSuitProgressConfig { @Expose @ConfigOption(name = "Enabled", desc = "Display Living Metal Suit progress.") @@ -642,9 +642,9 @@ public class RiftConfig { @Expose @ConfigOption(name = "Motes Sell Price", desc = "") @Accordion - public Motes motes = new Motes(); + public MotesConfig motes = new MotesConfig(); - public static class Motes { + public static class MotesConfig { @Expose @ConfigOption(name = "Show Motes Price", desc = "Show the Motes NPC price in the item lore.") @@ -660,9 +660,9 @@ public class RiftConfig { @Expose @ConfigOption(name = "Inventory Value", desc = "") @Accordion - public InventoryValue inventoryValue = new InventoryValue(); + public InventoryValueConfig inventoryValue = new InventoryValueConfig(); - public static class InventoryValue { + public static class InventoryValueConfig { @Expose @ConfigOption(name = "Inventory Value", desc = "Show total Motes NPC price for the current opened inventory.") @ConfigEditorBoolean diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/SlayerConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/SlayerConfig.java index ede756f26..b4fc1800d 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/SlayerConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/SlayerConfig.java @@ -4,8 +4,6 @@ import at.hannibal2.skyhanni.config.FeatureToggle; import at.hannibal2.skyhanni.config.core.config.Position; import com.google.gson.annotations.Expose; import io.github.moulberry.moulconfig.annotations.Accordion; -import io.github.moulberry.moulconfig.annotations.ConfigAccordionId; -import io.github.moulberry.moulconfig.annotations.ConfigEditorAccordion; import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; import io.github.moulberry.moulconfig.annotations.ConfigEditorColour; import io.github.moulberry.moulconfig.annotations.ConfigEditorDropdown; @@ -17,137 +15,131 @@ public class SlayerConfig { @Expose @ConfigOption(name = "Enderman Slayer Features", desc = "") - @ConfigEditorAccordion(id = 0) - public boolean enderman = false; - - @Expose - @ConfigOption(name = "Yang Glyph (beacon)", desc = "") - @ConfigAccordionId(id = 0) @Accordion - public EndermanBeaconConfig endermanBeaconConfig = new EndermanBeaconConfig(); + public EndermanConfig endermen = new EndermanConfig(); + public static class EndermanConfig{ + @Expose + @ConfigOption(name = "Yang Glyph (beacon)", desc = "") + @Accordion + public EndermanBeaconConfig endermanBeaconConfig = new EndermanBeaconConfig(); - public static class EndermanBeaconConfig { + public static class EndermanBeaconConfig { - @Expose - @ConfigOption(name = "Highlight Beacon", - desc = "Highlight the Enderman Slayer Yang Glyph (beacon) in red color and added a timer for when he explodes. " + - "Supports beacon in hand and beacon flying.") - @ConfigEditorBoolean - @FeatureToggle - public boolean highlightBeacon = true; + @Expose + @ConfigOption(name = "Highlight Beacon", + desc = "Highlight the Enderman Slayer Yang Glyph (beacon) in red color and added a timer for when he explodes. " + + "Supports beacon in hand and beacon flying.") + @ConfigEditorBoolean + @FeatureToggle + public boolean highlightBeacon = true; - @Expose - @ConfigOption(name = "Beacon Color", desc = "Color of the beacon.") - @ConfigEditorColour - public String beaconColor = "0:255:255:0:88"; + @Expose + @ConfigOption(name = "Beacon Color", desc = "Color of the beacon.") + @ConfigEditorColour + public String beaconColor = "0:255:255:0:88"; - @Expose - @ConfigOption(name = "Show Warning", desc = "Displays a warning mid-screen when the Enderman Slayer throws a Yang Glyph (beacon).") - @ConfigEditorBoolean - @FeatureToggle - public boolean showWarning = false; + @Expose + @ConfigOption(name = "Show Warning", desc = "Displays a warning mid-screen when the Enderman Slayer throws a Yang Glyph (beacon).") + @ConfigEditorBoolean + @FeatureToggle + public boolean showWarning = false; + + @Expose + @ConfigOption(name = "Show Line", desc = "Draw a line starting at your crosshair to the beacon.") + @ConfigEditorBoolean + @FeatureToggle + public boolean showLine = false; + + @Expose + @ConfigOption(name = "Line Color", desc = "Color of the line.") + @ConfigEditorColour + public String lineColor = "0:255:255:0:88"; + + @Expose + @ConfigOption(name = "Line Width", desc = "Width of the line.") + @ConfigEditorSlider(minStep = 1, minValue = 1, maxValue = 10) + public int lineWidth = 3; + } @Expose - @ConfigOption(name = "Show Line", desc = "Draw a line starting at your crosshair to the beacon.") + @ConfigOption(name = "Highlight Nukekubi Skulls", desc = "Highlights the Enderman Slayer Nukekubi Skulls (Eyes).") @ConfigEditorBoolean @FeatureToggle - public boolean showLine = false; + public boolean highlightNukekebi = false; @Expose - @ConfigOption(name = "Line Color", desc = "Color of the line.") - @ConfigEditorColour - public String lneColor = "0:255:255:0:88"; + @ConfigOption(name = "Phase Display", desc = "Show the current phase of the Enderman Slayer in damage indcator.") + @ConfigEditorBoolean + public boolean phaseDisplay = false; @Expose - @ConfigOption(name = "Line Width", desc = "Width of the line.") - @ConfigEditorSlider(minStep = 1, minValue = 1, maxValue = 10) - public int lineWidth = 3; + @ConfigOption(name = "Hide Particles", desc = "Hide particles around Enderman Slayer bosses and Mini-Bosses.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hideParticles = false; } - @Expose - @ConfigOption(name = "Highlight Nukekubi Skulls", desc = "Highlights the Enderman Slayer Nukekubi Skulls (Eyes).") - @ConfigEditorBoolean - @FeatureToggle - @ConfigAccordionId(id = 0) - public boolean endermanHighlightNukekebi = false; - - @Expose - @ConfigOption(name = "Phase Display", desc = "Show the current phase of the Enderman Slayer in damage indcator.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - public boolean endermanPhaseDisplay = false; - - @Expose - @ConfigOption(name = "Hide Particles", desc = "Hide particles around Enderman Slayer bosses and Mini-Bosses.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - @FeatureToggle - public boolean endermanHideParticles = false; @Expose @ConfigOption(name = "Blaze", desc = "") - @ConfigEditorAccordion(id = 1) - public boolean blaze = false; + @Accordion + public BlazeConfig blazes = new BlazeConfig(); + public static class BlazeConfig{ + @Expose + @ConfigOption(name = "Hellion Shields", desc = "") + @Accordion + public BlazeHellionConfig hellion = new BlazeHellionConfig(); + public static class BlazeHellionConfig{ + @Expose + @ConfigOption(name = "Colored Mobs", desc = "Color the Blaze Slayer boss and the demons in the right hellion shield color.") + @ConfigEditorBoolean + @FeatureToggle + public boolean coloredMobs = false; - @Expose - @ConfigOption(name = "Hellion Shields", desc = "") - @ConfigEditorAccordion(id = 2) - @ConfigAccordionId(id = 1) - public boolean blazeHellion = false; + @Expose + @ConfigOption(name = "Blaze Daggers", desc = "Faster and permanent display for the Blaze Slayer daggers.") + @ConfigEditorBoolean + @FeatureToggle + public boolean daggers = false; - @Expose - @ConfigOption(name = "Colored Mobs", desc = "Color the Blaze Slayer boss and the demons in the right hellion shield color.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - @FeatureToggle - public boolean blazeColoredMobs = false; + @Expose + @ConfigOption(name = "Right Dagger", desc = "Mark the right dagger to use for Blaze Slayer in the dagger overlay.") + @ConfigEditorBoolean + @FeatureToggle + public boolean markRightHellionShield = false; - @Expose - @ConfigOption(name = "Blaze Daggers", desc = "Faster and permanent display for the Blaze Slayer daggers.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - @FeatureToggle - public boolean blazeDaggers = false; + @Expose + @ConfigOption(name = "First Dagger", desc = "Select the first, left sided dagger for the display.") + @ConfigEditorDropdown(values = {"Spirit/Crystal", "Ashen/Auric"}) + public int firstDagger = 0; - @Expose - @ConfigOption(name = "Right Dagger", desc = "Mark the right dagger to use for Blaze Slayer in the dagger overlay.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - @FeatureToggle - public boolean blazeMarkRightHellionShield = false; + @Expose + @ConfigOption(name = "Hide Chat", desc = "Remove the wrong Blaze Slayer dagger messages from chat.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hideDaggerWarning = false; + } - @Expose - @ConfigOption(name = "First Dagger", desc = "Select the first, left sided dagger for the display.") - @ConfigEditorDropdown(values = {"Spirit/Crystal", "Ashen/Auric"}) - @ConfigAccordionId(id = 2) - public int blazeFirstDagger = 0; - @Expose - @ConfigOption(name = "Hide Chat", desc = "Remove the wrong Blaze Slayer dagger messages from chat.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - @FeatureToggle - public boolean blazeHideDaggerWarning = false; + @Expose + @ConfigOption(name = "Fire Pits", desc = "Warning when the fire pit phase starts for the Blaze Slayer tier 3 and 4.") + @ConfigEditorBoolean + @FeatureToggle + public boolean firePitsWarning = false; - @Expose - @ConfigOption(name = "Fire Pits", desc = "Warning when the fire pit phase starts for the Blaze Slayer tier 3 and 4.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - @FeatureToggle - public boolean firePitsWarning = false; + @Expose + @ConfigOption(name = "Phase Display", desc = "Show the current phase of the Blaze Slayer boss.") + @ConfigEditorBoolean + public boolean phaseDisplay = false; + + @Expose + @ConfigOption(name = "Clear View", desc = "Hide particles and fireballs near Blaze Slayer bosses and demons.") + @ConfigEditorBoolean + @FeatureToggle + public boolean clearView = false; + } - @Expose - @ConfigOption(name = "Phase Display", desc = "Show the current phase of the Blaze Slayer boss.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - public boolean blazePhaseDisplay = false; - @Expose - @ConfigOption(name = "Clear View", desc = "Hide particles and fireballs near Blaze Slayer bosses and demons.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - @FeatureToggle - public boolean blazeClearView = false; @Expose @ConfigOption(name = "Vampire Slayer Features", desc = "") @@ -159,9 +151,9 @@ public class SlayerConfig { @Expose @ConfigOption(name = "Your Boss", desc = "") @Accordion - public OwnBoss ownBoss = new OwnBoss(); + public OwnBossConfig ownBoss = new OwnBossConfig(); - public static class OwnBoss { + public static class OwnBossConfig { @Expose @ConfigOption(name = "Highlight Your Boss", desc = "Highlight your own Vampire Slayer boss.") @@ -196,9 +188,9 @@ public class SlayerConfig { @Expose @ConfigOption(name = "Others Boss", desc = "") @Accordion - public OthersBoss othersBoss = new OthersBoss(); + public OthersBossConfig othersBoss = new OthersBossConfig(); - public static class OthersBoss { + public static class OthersBossConfig { @Expose @ConfigOption(name = "Highlight Others Boss", desc = "Highlight others players boss.\nYou need to hit them first.") @@ -233,9 +225,9 @@ public class SlayerConfig { @Expose @ConfigOption(name = "Co-op Boss", desc = "") @Accordion - public CoopBossHighlight coopBoss = new CoopBossHighlight(); + public CoopBossHighlightConfig coopBoss = new CoopBossHighlightConfig(); - public static class CoopBossHighlight { + public static class CoopBossHighlightConfig { @Expose @ConfigOption(name = "Highlight Co-op Boss", desc = "Highlight boss of your co-op member.") @ConfigEditorBoolean @@ -317,9 +309,9 @@ public class SlayerConfig { @Expose @ConfigOption(name = "Blood Ichor", desc = "") @Accordion - public BloodIchor bloodIchor = new BloodIchor(); + public BloodIchorConfig bloodIchor = new BloodIchorConfig(); - public static class BloodIchor { + public static class BloodIchorConfig { @Expose @ConfigOption(name = "Highlight Blood Ichor", desc = "Highlight the Blood Ichor.") @ConfigEditorBoolean @@ -353,9 +345,9 @@ public class SlayerConfig { @Expose @ConfigOption(name = "Killer Spring", desc = "") @Accordion - public KillerSpring killerSpring = new KillerSpring(); + public KillerSpringConfig killerSpring = new KillerSpringConfig(); - public static class KillerSpring { + public static class KillerSpringConfig { @Expose @ConfigOption(name = "Highlight Killer Spring", desc = "Highlight the Killer Spring tower.") @ConfigEditorBoolean @@ -383,9 +375,9 @@ public class SlayerConfig { @Expose @ConfigOption(name = "Item Profit Tracker", desc = "") @Accordion - public ItemProfitTracker itemProfitTracker = new ItemProfitTracker(); + public ItemProfitTrackerConfig itemProfitTracker = new ItemProfitTrackerConfig(); - public static class ItemProfitTracker { + public static class ItemProfitTrackerConfig { @Expose @ConfigOption(name = "Enabled", desc = "Count all items you pick up while doing slayer, " + @@ -429,9 +421,9 @@ public class SlayerConfig { @Expose @ConfigOption(name = "Items on Ground", desc = "") @Accordion - public ItemsOnGround itemsOnGround = new ItemsOnGround(); + public ItemsOnGroundConfig itemsOnGround = new ItemsOnGroundConfig(); - public static class ItemsOnGround { + public static class ItemsOnGroundConfig { @Expose @ConfigOption(name = "Enabled", desc = "Show the name and price of items laying on the ground. §cOnly in slayer areas!") @@ -448,9 +440,9 @@ public class SlayerConfig { @Expose @ConfigOption(name = "RNG Meter Display", desc = "") @Accordion - public RngMeterDisplay rngMeterDisplay = new RngMeterDisplay(); + public RngMeterDisplayConfig rngMeterDisplay = new RngMeterDisplayConfig(); - public static class RngMeterDisplay { + public static class RngMeterDisplayConfig { @Expose @ConfigOption(name = "Enabled", desc = "Display amount of bosses needed until next RNG meter drop.") @@ -476,9 +468,9 @@ public class SlayerConfig { @Expose @ConfigOption(name = "Boss Spawn Warning", desc = "") @Accordion - public SlayerBossWarning slayerBossWarning = new SlayerBossWarning(); + public SlayerBossWarningConfig slayerBossWarning = new SlayerBossWarningConfig(); - public static class SlayerBossWarning { + public static class SlayerBossWarningConfig { @Expose @ConfigOption(name = "Enabled", desc = "Send a title when your boss is about to spawn.") diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt index cbe4d4f56..6772e67cf 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.chat import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.StringUtils.matchRegex @@ -9,7 +10,7 @@ import at.hannibal2.skyhanni.utils.StringUtils.trimWhiteSpaceAndResets import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class ChatFilter { - private val config get() = SkyHanniMod.feature.chat + private val config get() = SkyHanniMod.feature.chat.filterType @SubscribeEvent fun onChatMessage(event: LorenzChatEvent) { @@ -348,4 +349,18 @@ class ChatFilter { else -> false } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(3, "chat.hypixelHub", "chat.filterType.hypixelHub") + event.move(3, "chat.empty", "chat.filterType.empty") + event.move(3, "chat.warping", "chat.filterType.warping") + event.move(3, "chat.guildExp", "chat.filterType.guildExp") + event.move(3, "chat.friendJoinLeft", "chat.filterType.friendJoinLeft") + event.move(3, "chat.winterGift", "chat.filterType.winterGift") + event.move(3, "chat.powderMining", "chat.filterType.powderMining") + event.move(3, "chat.killCombo", "chat.filterType.killCombo") + event.move(3, "chat.profileJoin", "chat.filterType.profileJoin") + event.move(3, "chat.others", "chat.filterType.others") + } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/WatchdogHider.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/WatchdogHider.kt index 099d52067..739eaa123 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/WatchdogHider.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/WatchdogHider.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.chat import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.ChatManager import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.utils.LorenzUtils @@ -15,7 +16,7 @@ class WatchdogHider { @SubscribeEvent fun onChatMessage(event: LorenzChatEvent) { - if (!LorenzUtils.onHypixel || !SkyHanniMod.feature.chat.watchDog) return + if (!LorenzUtils.onHypixel || !SkyHanniMod.feature.chat.filterType.watchDog) return when (event.message) { watchdogStartLine -> { @@ -48,6 +49,11 @@ class WatchdogHider { private const val watchdogAnnouncementLine = "§4[WATCHDOG ANNOUNCEMENT]" private const val watchdogEndLine = "§c" } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(3, "chat.watchDog", "chat.filterType.watchDog") + } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt index e63c925df..60ed955a3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.chat.playerchat import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.features.dungeon.DungeonMilestonesDisplay import at.hannibal2.skyhanni.features.misc.MarkedPlayerManager @@ -10,6 +11,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class PlayerChatModifier { + private val config get() = SkyHanniMod.feature.chat.playerMessage private val patterns = mutableListOf() init { @@ -58,7 +60,7 @@ class PlayerChatModifier { private fun cutMessage(input: String): String { var string = input - if (SkyHanniMod.feature.chat.playerRankHider) { + if (config.playerRankHider) { for (pattern in patterns) { string = string.replace(pattern, "§b$1") } @@ -72,7 +74,7 @@ class PlayerChatModifier { } } - if (SkyHanniMod.feature.chat.chatFilter && string.contains("§r§f: ") && PlayerChatFilter.shouldChatFilter(string)) { + if (config.chatFilter && string.contains("§r§f: ") && PlayerChatFilter.shouldChatFilter(string)) { string = string.replace("§r§f: ", "§r§7: ") } @@ -84,4 +86,12 @@ class PlayerChatModifier { return string } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(3, "chat.playerRankHider", "chat.playerMessage.playerRankHider") + event.move(3, "chat.chatFilter", "chat.playerMessage.chatFilter") + } + + } diff --git a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt index b8fa406b9..f9f84f9f7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt @@ -455,7 +455,7 @@ class DamageIndicatorManager { entity.setHellionShield(null) } - if (!SkyHanniMod.feature.slayer.blazePhaseDisplay) return "" + if (!SkyHanniMod.feature.slayer.blazes.phaseDisplay) return "" var calcHealth = health val calcMaxHealth: Int @@ -610,7 +610,7 @@ class DamageIndicatorManager { calcHealth.toLong(), calcMaxHealth.toLong() ).getChatColor() + NumberUtil.format(calcHealth) - if (!SkyHanniMod.feature.slayer.endermanPhaseDisplay) { + if (!SkyHanniMod.feature.slayer.endermen.phaseDisplay) { result = "" entityData.namePrefix = "" } @@ -854,6 +854,8 @@ class DamageIndicatorManager { @SubscribeEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "damageIndicator", "combat.damageIndicator") + event.move(3,"slayer.endermanPhaseDisplay", "slayer.endermen.phaseDisplay") + event.move(3, "slayer.blazePhaseDisplay", "slayer.blazes.phaseDisplay") } fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCleanEnd.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCleanEnd.kt index 6d0afd651..31e8c611e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCleanEnd.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCleanEnd.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.dungeon import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.CheckRenderEntityEvent import at.hannibal2.skyhanni.events.DamageIndicatorFinalBossEvent import at.hannibal2.skyhanni.events.EntityHealthUpdateEvent @@ -18,6 +19,8 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class DungeonCleanEnd { + private val config get() = SkyHanniMod.feature.dungeon.cleanEnd + private var bossDone = false private var chestsSpawned = false private var lastBossId: Int = -1 @@ -25,7 +28,7 @@ class DungeonCleanEnd { @SubscribeEvent fun onChatMessage(event: LorenzChatEvent) { if (!LorenzUtils.inDungeons) return - if (!SkyHanniMod.feature.dungeon.cleanEndToggle) return + if (!config.toggle) return val message = event.message @@ -36,7 +39,7 @@ class DungeonCleanEnd { private fun shouldBlock(): Boolean { if (!LorenzUtils.inDungeons) return false - if (!SkyHanniMod.feature.dungeon.cleanEndToggle) return false + if (!config.toggle) return false if (!bossDone) return false @@ -63,7 +66,7 @@ class DungeonCleanEnd { @SubscribeEvent fun onEntityHealthUpdate(event: EntityHealthUpdateEvent) { if (!LorenzUtils.inDungeons) return - if (!SkyHanniMod.feature.dungeon.cleanEndToggle) return + if (!config.toggle) return if (bossDone) return if (lastBossId == -1) return if (event.entity.entityId != lastBossId) return @@ -83,7 +86,7 @@ class DungeonCleanEnd { if (entity == Minecraft.getMinecraft().thePlayer) return - if (SkyHanniMod.feature.dungeon.cleanEndF3IgnoreGuardians + if (config.F3IgnoreGuardians && DungeonAPI.isOneOf("F3", "M3") && entity is EntityGuardian && entity.entityId != lastBossId @@ -111,4 +114,11 @@ class DungeonCleanEnd { event.isCanceled = true } } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(3, "dungeon.cleanEndToggle", "dungeon.cleanEnd.toggle") + event.move(3, "dungeon.cleanEndF3IgnoreGuardians", "dungeon.cleanEnd.F3IgnoreGuardians") + } + } \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCopilot.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCopilot.kt index 7b423af28..ddfd622a7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCopilot.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCopilot.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.dungeon import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.CheckRenderEntityEvent import at.hannibal2.skyhanni.events.DungeonBossRoomEnterEvent import at.hannibal2.skyhanni.events.DungeonEnterEvent @@ -64,7 +65,7 @@ class DungeonCopilot { foundKeyOrDoor = true } - if (foundKeyOrDoor && SkyHanniMod.feature.dungeon.messageFilterKeysAndDoors) { + if (foundKeyOrDoor && SkyHanniMod.feature.dungeon.messageFilter.keysAndDoors) { event.blockedReason = "dungeon_keys_and_doors" } @@ -125,13 +126,20 @@ class DungeonCopilot { } private fun isEnabled(): Boolean { - return LorenzUtils.inDungeons && SkyHanniMod.feature.dungeon.copilotEnabled + return LorenzUtils.inDungeons && SkyHanniMod.feature.dungeon.dungeonCopilot.enabled } @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) { if (!isEnabled()) return - SkyHanniMod.feature.dungeon.copilotPos.renderString(nextStep, posLabel = "Dungeon Copilot") + SkyHanniMod.feature.dungeon.dungeonCopilot.pos.renderString(nextStep, posLabel = "Dungeon Copilot") + } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent){ + event.move(3, "dungeon.messageFilterKeysAndDoors", "dungeon.messageFilter.keysAndDoors") + event.move(3,"dungeon.copilotEnabled", "dungeon.dungeonCopilot.enabled") + event.move(3,"dungeon.copilotPos", "dungeon.dungeonCopilot.pos") } } \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt index 1428a120a..dd086cf2f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.dungeon import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.EntityMovementData import at.hannibal2.skyhanni.events.CheckRenderEntityEvent import at.hannibal2.skyhanni.events.EntityMoveEvent @@ -21,6 +22,8 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class DungeonHideItems { + private val config get() = SkyHanniMod.feature.dungeon.objectHider + private val hideParticles = mutableMapOf() private val movingSkeletonSkulls = mutableMapOf() @@ -61,18 +64,18 @@ class DungeonHideItems { if (entity is EntityItem) { val stack = entity.entityItem - if (SkyHanniMod.feature.dungeon.hideReviveStone && stack.cleanName() == "Revive Stone") { + if (config.hideReviveStone && stack.cleanName() == "Revive Stone") { event.isCanceled = true } - if (SkyHanniMod.feature.dungeon.hideJournalEntry && stack.cleanName() == "Journal Entry") { + if (config.hideJournalEntry && stack.cleanName() == "Journal Entry") { event.isCanceled = true } } if (entity !is EntityArmorStand) return - if (SkyHanniMod.feature.dungeon.hideSuperboomTNT) { + if (config.hideSuperboomTNT) { if (entity.name.startsWith("§9Superboom TNT")) { event.isCanceled = true } @@ -84,7 +87,7 @@ class DungeonHideItems { } } - if (SkyHanniMod.feature.dungeon.hideBlessing) { + if (config.hideBlessing) { if (entity.name.startsWith("§dBlessing of ")) { event.isCanceled = true } @@ -95,7 +98,7 @@ class DungeonHideItems { } } - if (SkyHanniMod.feature.dungeon.hideReviveStone) { + if (config.hideReviveStone) { if (entity.name == "§6Revive Stone") { event.isCanceled = true } @@ -107,7 +110,7 @@ class DungeonHideItems { } } - if (SkyHanniMod.feature.dungeon.hidePremiumFlesh) { + if (config.hidePremiumFlesh) { if (entity.name == "§9Premium Flesh") { event.isCanceled = true hideParticles[entity] = System.currentTimeMillis() @@ -121,7 +124,7 @@ class DungeonHideItems { if (isSkeletonSkull(entity)) { EntityMovementData.addToTrack(entity) - if (SkyHanniMod.feature.dungeon.hideSkeletonSkull) { + if (config.hideSkeletonSkull) { val lastMove = movingSkeletonSkulls.getOrDefault(entity, 0) if (lastMove + 100 > System.currentTimeMillis()) { return @@ -130,7 +133,7 @@ class DungeonHideItems { } } - if (SkyHanniMod.feature.dungeon.hideHealerOrbs) { + if (config.hideHealerOrbs) { when { entity.name.startsWith("§c§lDAMAGE §e") -> event.isCanceled = true entity.name.startsWith("§c§lABILITY DAMAGE §e") -> event.isCanceled = true @@ -152,7 +155,7 @@ class DungeonHideItems { } } - if (SkyHanniMod.feature.dungeon.hideHealerFairy) { + if (config.hideHealerFairy) { val itemStack = entity.inventory[0] if (itemStack != null && itemStack.getSkullTexture() == healerFairyTexture) { event.isCanceled = true @@ -164,7 +167,7 @@ class DungeonHideItems { @SubscribeEvent fun onReceivePacket(event: ReceiveParticleEvent) { if (!LorenzUtils.inDungeons) return - if (!SkyHanniMod.feature.dungeon.hideSuperboomTNT && !SkyHanniMod.feature.dungeon.hideReviveStone) return + if (!config.hideSuperboomTNT && !config.hideReviveStone) return val packetLocation = event.location for (armorStand in hideParticles.filter { it.value + 100 > System.currentTimeMillis() }.map { it.key }) { @@ -223,4 +226,16 @@ class DungeonHideItems { hideParticles.clear() movingSkeletonSkulls.clear() } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(3, "dungeon.hideSuperboomTNT", "dungeon.objectHider.hideSuperboomTNT") + event.move(3, "dungeon.hideBlessing", "dungeon.objectHider.hideBlessing") + event.move(3, "dungeon.hideReviveStone", "dungeon.objectHider.hideReviveStone") + event.move(3, "dungeon.hidePremiumFlesh", "dungeon.objectHider.hidePremiumFlesh") + event.move(3, "dungeon.hideJournalEntry", "dungeon.objectHider.hideJournalEntry") + event.move(3, "dungeon.hideSkeletonSkull", "dungeon.objectHider.hideSkeletonSkull") + event.move(3, "dungeon.hideHealerOrbs", "dungeon.objectHider.hideHealerOrbs") + event.move(3, "dungeon.hideHealerFairy", "dungeon.objectHider.hideHealerFairy") + } } \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLevelColor.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLevelColor.kt index 2a044adef..776a11a14 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLevelColor.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLevelColor.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.dungeon import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzUtils @@ -14,7 +15,7 @@ class DungeonLevelColor { @SubscribeEvent fun onItemTooltip(event: ItemTooltipEvent) { if (!LorenzUtils.inSkyBlock) return - if (!SkyHanniMod.feature.dungeon.partyFinderColoredClassLevel) return + if (!SkyHanniMod.feature.dungeon.partyFinder.coloredClassLevel) return if (event.toolTip == null) return val chestName = InventoryUtils.openInventoryName() @@ -34,6 +35,11 @@ class DungeonLevelColor { } } } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent){ + event.move(3, "dungeon.partyFinderColoredClassLevel", "dungeon.partyFinder.coloredClassLevel") + } } fun getColor(level: Int): String { diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingTimer.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingTimer.kt index c841eff38..1bb7cb1d5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingTimer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingTimer.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.fishing import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzTickEvent @@ -18,7 +19,7 @@ import net.minecraft.entity.item.EntityArmorStand import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class FishingTimer { - private val config get() = SkyHanniMod.feature.fishing + private val config get() = SkyHanniMod.feature.fishing.barnTimer private val barnLocation = LorenzVec(108, 89, -252) private var rightLocation = false @@ -29,7 +30,7 @@ class FishingTimer { @SubscribeEvent fun onTick(event: LorenzTickEvent) { if (!LorenzUtils.inSkyBlock) return - if (!config.barnTimer) return + if (!config.enabled) return if (event.repeatSeconds(3)) { rightLocation = isRightLocation() @@ -46,7 +47,7 @@ class FishingTimer { if (currentCount == 0) return val duration = System.currentTimeMillis() - startTime - val barnTimerAlertTime = config.barnTimerAlertTime * 1_000 + val barnTimerAlertTime = config.alertTime * 1_000 if (duration > barnTimerAlertTime && duration < barnTimerAlertTime + 3_000) { SoundUtils.playBeepSound() } @@ -82,9 +83,9 @@ class FishingTimer { private fun isRightLocation(): Boolean { inHollows = false - if (config.barnTimerForStranded && LorenzUtils.isStrandedProfile) return true + if (config.forStranded && LorenzUtils.isStrandedProfile) return true - if (config.barnTimerCrystalHollows && IslandType.CRYSTAL_HOLLOWS.isInIsland()) { + if (config.crystalHollows && IslandType.CRYSTAL_HOLLOWS.isInIsland()) { inHollows = true return true } @@ -99,17 +100,28 @@ class FishingTimer { @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) { if (!LorenzUtils.inSkyBlock) return - if (!config.barnTimer) return + if (!config.enabled) return if (!rightLocation) return if (currentCount == 0) return val duration = System.currentTimeMillis() - startTime - val barnTimerAlertTime = config.barnTimerAlertTime * 1_000 + val barnTimerAlertTime = config.alertTime * 1_000 val color = if (duration > barnTimerAlertTime) "§c" else "§e" val timeFormat = TimeUtils.formatDuration(duration, biggestUnit = TimeUnit.MINUTE) val name = if (currentCount == 1) "sea creature" else "sea creatures" val text = "$color$timeFormat §8(§e$currentCount §b$name§8)" - config.barnTimerPos.renderString(text, posLabel = "BarnTimer") + config.pos.renderString(text, posLabel = "BarnTimer") + } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent){ + event.move(3, "fishing.barnTimer", "fishing.barnTimer.enabled") + event.move(3, "fishing.barnTimerAlertTime", "fishing.barnTimer.alertTime") + event.move(3, "fishing.barnTimerCrystalHollows", "fishing.barnTimer.crystalHollows") + event.move(3, "fishing.barnTimerForStranded", "fishing.barnTimer.forStranded") + event.move(3, "fishing.wormLimitAlert", "fishing.barnTimer.wormLimitAlert") + event.move(3, "fishing.manualResetTimer", "fishing.barnTimer.manualResetTimer") + event.move(3, "fishing.barnTimerPos", "fishing.barnTimer.pos") } } \ No newline at end of file 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 c1af6224d..dca61807d 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,7 @@ 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 import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent @@ -21,7 +22,7 @@ import net.minecraft.item.ItemStack import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class AnitaMedalProfit { - private val config get() = SkyHanniMod.feature.garden + private val config get() = SkyHanniMod.feature.garden.anitaShop private var display = emptyList>() companion object { @@ -44,7 +45,7 @@ class AnitaMedalProfit { @SubscribeEvent fun onInventoryOpen(event: InventoryFullyOpenedEvent) { - if (!config.anitaMedalProfitEnabled) return + if (!config.medalProfitEnabled) return if (event.inventoryName != "Anita") return if (GardenVisitorFeatures.inVisitorInventory) return @@ -138,7 +139,7 @@ class AnitaMedalProfit { @SubscribeEvent fun onBackgroundDraw(event: GuiRenderEvent.ChestGuiOverlayRenderEvent) { if (inInventory) { - config.anitaMedalProfitPos.renderStringsAndItems( + config.medalProfitPos.renderStringsAndItems( display, extraSpace = 5, itemScale = 1.7, @@ -146,4 +147,10 @@ class AnitaMedalProfit { ) } } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent){ + event.move(3,"garden.anitaMedalProfitEnabled", "garden.anitaShop.medalProfitEnabled") + event.move(3,"garden.anitaMedalProfitPos", "garden.anitaShop.medalProfitPos") + } } \ 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 40a603b7c..789c0f352 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.garden import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.CropAccessoryData import at.hannibal2.skyhanni.data.GardenCropMilestones import at.hannibal2.skyhanni.data.GardenCropMilestones.getCounter @@ -80,7 +81,7 @@ class FarmingFortuneDisplay { @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) { if (!isEnabled()) return - config.farmingFortunePos.renderStringsAndItems(display, posLabel = "True Farming Fortune") + config.pos.renderStringsAndItems(display, posLabel = "True Farming Fortune") } @SubscribeEvent @@ -137,18 +138,18 @@ class FarmingFortuneDisplay { toolCounterFortune + getTurboCropFortune(tool, currentCrop) + getDedicationFortune(tool, currentCrop) } - private fun isEnabled(): Boolean = GardenAPI.inGarden() && config.farmingFortuneDisplay + private fun isEnabled(): Boolean = GardenAPI.inGarden() && config.display companion object { - private val config get() = SkyHanniMod.feature.garden + private val config get() = SkyHanniMod.feature.garden.farmingFortunes private val latestFF: MutableMap? get() = GardenAPI.config?.latestTrueFarmingFortune private val currentCrop get() = GardenAPI.getCurrentlyFarmedCrop() private var tabFortune: Double = 0.0 private var toolFortune: Double = 0.0 - private val baseFortune: Double get() = if (config.farmingFortuneDropMultiplier) 100.0 else 0.0 + private val baseFortune: Double get() = if (config.dropMultiplier) 100.0 else 0.0 private val upgradeFortune: Double? get() = currentCrop?.getUpgradeLevel()?.let { it * 5.0 } private val accessoryFortune: Double? get() = currentCrop?.let { @@ -281,4 +282,11 @@ class FarmingFortuneDisplay { fun CropType.getLatestTrueFarmingFortune() = latestFF?.get(this) } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent){ + event.move(3,"garden.farmingFortuneDisplay", "garden.farmingFortunes.display") + event.move(3,"garden.farmingFortuneDropMultiplier", "garden.farmingFortunes.dropMultiplier") + event.move(3,"garden.farmingFortunePos", "garden.farmingFortunes.pos") + } } \ No newline at end of file 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 da7636cd6..228f133e9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropTimeCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropTimeCommand.kt @@ -12,10 +12,10 @@ import at.hannibal2.skyhanni.utils.StringUtils.removeColor import at.hannibal2.skyhanni.utils.TimeUtils object GardenCropTimeCommand { - private val config get() = SkyHanniMod.feature.garden + private val config get() = SkyHanniMod.feature.garden.moneyPerHours fun onCommand(args: Array) { - if (!config.moneyPerHourDisplay) { + if (!config.display) { LorenzUtils.chat("§c[SkyHanni] §cshcroptime requires 'Show money per Hour' feature to be enabled to work!") return } 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 7e5d3321f..c10292032 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,7 @@ 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 import at.hannibal2.skyhanni.events.LorenzChatEvent @@ -17,7 +18,7 @@ import kotlin.math.roundToLong import kotlin.time.Duration.Companion.milliseconds class GardenLevelDisplay { - private val config get() = SkyHanniMod.feature.garden + private val config get() = SkyHanniMod.feature.garden.gardenLevels private val expToNextLevelPattern = ".* §e(?.*)§6/.*".toPattern() private val overflowPattern = ".*§r §6(?.*) XP".toPattern() private val namePattern = "Garden Level (?.*)".toPattern() @@ -106,8 +107,14 @@ class GardenLevelDisplay { fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) { if (!isEnabled()) return - config.gardenLevelPos.renderString(display, posLabel = "Garden Level") + config.pos.renderString(display, posLabel = "Garden Level") } - private fun isEnabled() = GardenAPI.inGarden() && config.gardenLevelDisplay + private fun isEnabled() = GardenAPI.inGarden() && config.display + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent){ + event.move(3, "garden.gardenLevelDisplay", "garden.gardenLevels.display") + event.move(3, "garden.gardenLevelPos", "garden.gardenLevels.pos") + } } \ No newline at end of file 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 1e904ea4f..26dc9e7dd 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.garden import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent @@ -98,7 +99,7 @@ object GardenNextJacobContest { @SubscribeEvent fun onInventoryOpen(event: InventoryFullyOpenedEvent) { - if (!config.nextJacobContestDisplay) return + if (!config.display) return val backItem = event.inventoryItems[48] ?: return val backName = backItem.name @@ -215,7 +216,7 @@ object GardenNextJacobContest { fun shareContestConfirmed(array: Array) { if (array.size == 1) { if (array[0] == "enable") { - config.nextJacobContestsShareAutomatically = 1 + config.shareAutomatically = 1 SkyHanniMod.feature.storage.contestSendingAsked = true LorenzUtils.chat("§e[SkyHanni] §2Enabled automatic sharing of future contests!") } @@ -224,7 +225,7 @@ object GardenNextJacobContest { if (contests.size == maxContestsPerYear) { sendContests() } - if (!SkyHanniMod.feature.storage.contestSendingAsked && config.nextJacobContestsShareAutomatically == 0) { + if (!SkyHanniMod.feature.storage.contestSendingAsked && config.shareAutomatically == 0) { LorenzUtils.clickableChat( "§e[SkyHanni] §2Click here to automatically share future contests!", "shsendcontests enable" @@ -311,8 +312,8 @@ object GardenNextJacobContest { } private fun warn(timeInMillis: Long, crops: List) { - if (!config.nextJacobContestWarn) return - if (config.nextJacobContestWarnTime <= timeInMillis / 1000) return + if (!config.warn) return + if (config.warnTime <= timeInMillis / 1000) return if (System.currentTimeMillis() < lastWarningTime) return lastWarningTime = System.currentTimeMillis() + 60_000 * 40 @@ -322,7 +323,7 @@ object GardenNextJacobContest { LorenzUtils.sendTitle("§eFarming Contest!", 5.seconds) SoundUtils.playBeepSound() - if (config.nextJacobContestWarnPopup && !Display.isActive()) { + if (config.warnPopup && !Display.isActive()) { SkyHanniMod.coroutineScope.launch { openPopupWindow( "Farming Contest soon!\n" + @@ -375,15 +376,15 @@ object GardenNextJacobContest { if (!isEnabled()) return if (display.isEmpty()) { - config.nextJacobContestPos.renderStrings(simpleDisplay, posLabel = "Garden Next Jacob Contest") + config.pos.renderStrings(simpleDisplay, posLabel = "Garden Next Jacob Contest") } else { - config.nextJacobContestPos.renderSingleLineWithItems(display, 1.7, posLabel = "Garden Next Jacob Contest") + config.pos.renderSingleLineWithItems(display, 1.7, posLabel = "Garden Next Jacob Contest") } } @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent.ChestGuiOverlayRenderEvent) { - if (!config.nextJacobContestDisplay) return + if (!config.display) return if (!inCalendar) return if (display.isNotEmpty()) { @@ -394,13 +395,13 @@ object GardenNextJacobContest { } } - private fun isEnabled() = LorenzUtils.inSkyBlock && config.nextJacobContestDisplay - && (GardenAPI.inGarden() || config.nextJacobContestEverywhere) + private fun isEnabled() = LorenzUtils.inSkyBlock && config.display + && (GardenAPI.inGarden() || config.everywhere) - private fun isFetchEnabled() = isEnabled() && config.nextJacobContestsFetchAutomatically - private fun isSendEnabled() = isFetchEnabled() && config.nextJacobContestsShareAutomatically != 2 // 2 = Disabled + private fun isFetchEnabled() = isEnabled() && config.fetchAutomatically + private fun isSendEnabled() = isFetchEnabled() && config.shareAutomatically != 2 // 2 = Disabled private fun askToSendContests() = - config.nextJacobContestsShareAutomatically == 0 // 0 = Ask, 1 = Send (Only call if isSendEnabled()) + config.shareAutomatically == 0 // 0 = Ask, 1 = Send (Only call if isSendEnabled()) private fun fetchContestsIfAble() { if (isFetchingContests || contests.size == maxContestsPerYear || !isFetchEnabled()) return @@ -494,8 +495,21 @@ object GardenNextJacobContest { null } - private val config get() = SkyHanniMod.feature.garden + private val config get() = SkyHanniMod.feature.garden.nextJacobContests private val nextContestCrops = mutableListOf() - fun isNextCrop(cropName: CropType) = nextContestCrops.contains(cropName) && config.nextJacobContestOtherGuis + fun isNextCrop(cropName: CropType) = nextContestCrops.contains(cropName) && config.otherGuis + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent){ + event.move(3, "garden.nextJacobContestDisplay", "garden.nextJacobContests.display") + event.move(3, "garden.nextJacobContestEverywhere", "garden.nextJacobContests.everywhere") + event.move(3, "garden.nextJacobContestOtherGuis", "garden.nextJacobContests.otherGuis") + event.move(3, "garden.nextJacobContestsFetchAutomatically", "garden.nextJacobContests.fetchAutomatically") + event.move(3, "garden.nextJacobContestsShareAutomatically", "garden.nextJacobContests.shareAutomatically") + event.move(3, "garden.nextJacobContestWarn", "garden.nextJacobContests.warn") + event.move(3, "garden.nextJacobContestWarnTime", "garden.nextJacobContests.warnTime") + event.move(3, "garden.nextJacobContestWarnPopup", "garden.nextJacobContests.warnPopup") + event.move(3, "garden.nextJacobContestPos", "garden.nextJacobContests.pos") + } } \ No newline at end of file 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 b5999eed2..7dc971a23 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,7 @@ 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 import at.hannibal2.skyhanni.events.TabListUpdateEvent @@ -18,8 +19,8 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.time.Duration.Companion.seconds class GardenOptimalSpeed { - private val config get() = SkyHanniMod.feature.garden - private val configCustomSpeed get() = config.optimalSpeedCustom + private val config get() = SkyHanniMod.feature.garden.optimalSpeeds + private val configCustomSpeed get() = config.customSpeed private var currentSpeed = 100 private var optimalSpeed = -1 private val currentSpeedPattern = " Speed: §r§f✦(?.*)".toPattern() @@ -51,7 +52,7 @@ class GardenOptimalSpeed { val gui = event.gui if (gui !is GuiEditSign) return if (!gui.isRancherSign()) return - config.optimalSpeedSignPosition.renderStringsAndItems( + config.signPosition.renderStringsAndItems( rancherOverlayList, posLabel = "Optimal Speed Rancher Overlay" ) @@ -86,15 +87,15 @@ class GardenOptimalSpeed { val text = "Optimal Speed: §f$optimalSpeed" if (optimalSpeed != currentSpeed) { - config.optimalSpeedPos.renderString("§c$text", posLabel = "Garden Optimal Speed") + config.pos.renderString("§c$text", posLabel = "Garden Optimal Speed") warn() } else { - config.optimalSpeedPos.renderString("§a$text", posLabel = "Garden Optimal Speed") + config.pos.renderString("§a$text", posLabel = "Garden Optimal Speed") } } private fun warn() { - if (!config.optimalSpeedWarning) return + if (!config.warning) return if (!Minecraft.getMinecraft().thePlayer.onGround) return if (GardenAPI.onBarnPlot) return if (System.currentTimeMillis() < lastWarnTime + 20_000) return @@ -106,6 +107,25 @@ class GardenOptimalSpeed { } } - private fun isRancherOverlayEnabled() = GardenAPI.inGarden() && config.optimalSpeedSignEnabled - private fun isEnabled() = GardenAPI.inGarden() && config.optimalSpeedEnabled + private fun isRancherOverlayEnabled() = GardenAPI.inGarden() && config.signEnabled + private fun isEnabled() = GardenAPI.inGarden() && config.enabled + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent){ + event.move(3,"garden.optimalSpeedEnabled", "garden.optimalSpeeds.enabled") + event.move(3,"garden.optimalSpeedWarning", "garden.optimalSpeeds.warning") + event.move(3,"garden.optimalSpeedSignEnabled", "garden.optimalSpeeds.signEnabled") + event.move(3,"garden.optimalSpeedSignPosition", "garden.optimalSpeeds.signPosition") + event.move(3,"garden.optimalSpeedPos", "garden.optimalSpeeds.pos") + event.move(3,"garden.optimalSpeedCustom.wheat", "garden.optimalSpeeds.customSpeed.wheat") + event.move(3,"garden.optimalSpeedCustom.carrot", "garden.optimalSpeeds.customSpeed.carrot") + event.move(3,"garden.optimalSpeedCustom.potato", "garden.optimalSpeeds.customSpeed.potato") + event.move(3,"garden.optimalSpeedCustom.netherWart", "garden.optimalSpeeds.customSpeed.netherWart") + event.move(3,"garden.optimalSpeedCustom.pumpkin", "garden.optimalSpeeds.customSpeed.pumpkin") + event.move(3,"garden.optimalSpeedCustom.melon", "garden.optimalSpeeds.customSpeed.melon") + event.move(3,"garden.optimalSpeedCustom.cocoaBeans", "garden.optimalSpeeds.customSpeed.cocoaBeans") + event.move(3,"garden.optimalSpeedCustom.sugarCane", "garden.optimalSpeeds.customSpeed.sugarCane") + event.move(3,"garden.optimalSpeedCustom.cactus", "garden.optimalSpeeds.customSpeed.cactus") + event.move(3,"garden.optimalSpeedCustom.mushroom", "garden.optimalSpeeds.customSpeed.mushroom") + } } \ 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 c0cc75670..017cd8580 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,7 @@ 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 import at.hannibal2.skyhanni.features.garden.GardenAPI.getCropType @@ -18,7 +19,7 @@ import java.text.DecimalFormat import kotlin.math.roundToInt class ToolTooltipTweaks { - private val config get() = SkyHanniMod.feature.garden + private val config get() = SkyHanniMod.feature.garden.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") @@ -152,4 +153,11 @@ class ToolTooltipTweaks { add("$description${value.formatStat()}") } } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent){ + event.move(3,"garden.compactToolTooltips", "garden.tooltipTweak.compactToolTooltips") + 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 dede1d708..0e3540061 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,7 @@ 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 import at.hannibal2.skyhanni.features.garden.GardenAPI @@ -18,7 +19,7 @@ import kotlin.time.Duration.Companion.seconds import kotlin.time.DurationUnit class ComposterDisplay { - private val config get() = SkyHanniMod.feature.garden + private val config get() = SkyHanniMod.feature.garden.composters private val hidden get() = GardenAPI.config private var display = emptyList>() private var composterEmptyTime: Duration? = null @@ -44,7 +45,7 @@ class ComposterDisplay { @SubscribeEvent fun onTabListUpdate(event: TabListUpdateEvent) { - if (!(config.composterDisplayEnabled && GardenAPI.inGarden())) return + if (!(config.displayEnabled && GardenAPI.inGarden())) return readData(event.tabList) @@ -137,21 +138,21 @@ class ComposterDisplay { } private fun sendNotify() { - if (!config.composterNotifyLowEnabled) return + if (!config.notifyLow.enabled) return val hidden = hidden ?: return - if (ComposterAPI.getOrganicMatter() <= config.composterNotifyLowOrganicMatter && System.currentTimeMillis() >= hidden.informedAboutLowMatter) { - if (config.composterNotifyLowTitle) { + if (ComposterAPI.getOrganicMatter() <= config.notifyLow.organicMatter && System.currentTimeMillis() >= hidden.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 } - if (ComposterAPI.getFuel() <= config.composterNotifyLowFuel && + if (ComposterAPI.getFuel() <= config.notifyLow.fuel && System.currentTimeMillis() >= hidden.informedAboutLowFuel ) { - if (config.composterNotifyLowTitle) { + if (config.notifyLow.title) { LorenzUtils.sendTitle("§cYour Fuel is low", 4.seconds) } LorenzUtils.chat("§e[SkyHanni] §cYour Fuel is low!") @@ -163,8 +164,8 @@ class ComposterDisplay { fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) { if (!LorenzUtils.inSkyBlock) return - if (GardenAPI.inGarden() && config.composterDisplayEnabled) { - config.composterDisplayPos.renderStringsAndItems(display, posLabel = "Composter Display") + if (GardenAPI.inGarden() && config.displayEnabled) { + config.displayPos.renderStringsAndItems(display, posLabel = "Composter Display") } checkWarningsAndOutsideGarden() @@ -186,14 +187,14 @@ class ComposterDisplay { } } else "?" - if (!GardenAPI.inGarden() && config.composterDisplayOutsideGarden) { + if (!GardenAPI.inGarden() && config.displayOutsideGarden) { val list = Collections.singletonList(listOf(NEUItems.getItemStack("BUCKET", true), "§b$format")) - config.composterOutsideGardenPos.renderStringsAndItems(list, posLabel = "Composter Outside Garden Display") + config.outsideGardenPos.renderStringsAndItems(list, posLabel = "Composter Outside Garden Display") } } private fun warn(warningMessage: String) { - if (!config.composterWarnAlmostClose) return + if (!config.warnAlmostClose) return val storage = GardenAPI.config ?: return if (LorenzUtils.inDungeons) return @@ -204,4 +205,18 @@ class ComposterDisplay { LorenzUtils.chat("§e[SkyHanni] $warningMessage") LorenzUtils.sendTitle("§eComposter Warning!", 3.seconds) } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent){ + event.move(3, "garden.composterDisplayEnabled", "garden.composters.displayEnabled") + event.move(3, "garden.composterDisplayOutsideGarden", "garden.composters.displayOutsideGarden") + event.move(3, "garden.composterWarnAlmostClose", "garden.composters.warnAlmostClose") + event.move(3, "garden.composterDisplayPos", "garden.composters.displayPos") + event.move(3, "garden.composterOutsideGardenPos", "garden.composters.outsideGardenPos") + event.move(3, "garden.composterNotifyLowEnabled", "garden.composters.notifyLow.enabled") + event.move(3, "garden.composterNotifyLowEnabled", "garden.composters.notifyLow.enabled") + event.move(3, "garden.composterNotifyLowTitle", "garden.composters.notifyLow.title") + event.move(3, "garden.composterNotifyLowOrganicMatter", "garden.composters.notifyLow.organicMatter") + event.move(3, "garden.composterNotifyLowFuel", "garden.composters.notifyLow.fuel") + } } \ No newline at end of file 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 11680d0a0..103f235c5 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,7 @@ 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 import at.hannibal2.skyhanni.utils.ItemUtils.getLore @@ -17,7 +18,7 @@ class ComposterInventoryNumbers { @SubscribeEvent fun onRenderItemTip(event: RenderInventoryItemTipEvent) { if (!GardenAPI.inGarden()) return - if (!SkyHanniMod.feature.garden.composterInventoryNumbers) return + if (!SkyHanniMod.feature.garden.composters.inventoryNumbers) return if (event.inventoryName != "Composter") return @@ -66,4 +67,9 @@ class ComposterInventoryNumbers { } } } + + @SubscribeEvent + 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 83da09fd5..aa1fc4d28 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,6 +1,7 @@ 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.model.ComposterUpgrade import at.hannibal2.skyhanni.events.GuiRenderEvent @@ -49,7 +50,7 @@ class ComposterOverlay { private var organicMatterFactors: Map = emptyMap() private var fuelFactors: Map = emptyMap() - private val config get() = SkyHanniMod.feature.garden + private val config get() = SkyHanniMod.feature.garden.composters private var organicMatterDisplay = emptyList>() private var fuelExtraDisplay = emptyList>() @@ -119,7 +120,7 @@ class ComposterOverlay { @SubscribeEvent fun onInventoryOpen(event: InventoryFullyOpenedEvent) { if (!GardenAPI.inGarden()) return - if (!config.composterOverlay) return + if (!config.overlay) return inComposter = event.inventoryName == "Composter" inComposterUpgrades = event.inventoryName == "Composter Upgrades" if (!inComposter && !inComposterUpgrades) return @@ -399,7 +400,7 @@ class ComposterOverlay { val item = NEUItems.getItemStack(internalName) val itemName = item.name!! val price = getPrice(internalName) - val itemsNeeded = if (config.composterRoundDown) { + val itemsNeeded = if (config.roundDown) { val amount = missing / factor if (amount > .75 && amount < 1.0) { 1.0 @@ -444,7 +445,7 @@ class ComposterOverlay { private fun retrieveMaterials(internalName: String, itemName: String, itemsNeeded: Int) { if (itemsNeeded == 0 || internalName == "BIOFUEL") return - if (config.composterOverlayRetrieveFrom == 0 && !LorenzUtils.noTradeMode) { + if (config.retrieveFrom == 0 && !LorenzUtils.noTradeMode) { BazaarApi.searchForBazaarItem(itemName, itemsNeeded) return } @@ -489,7 +490,7 @@ class ComposterOverlay { } private fun getPrice(internalName: String): Double { - val useSellPrice = config.composterOverlayPriceType == 1 + val useSellPrice = config.overlayPriceType == 1 val price = NEUItems.getPrice(internalName, useSellPrice) if (internalName == "BIOFUEL" && price > 20_000) return 20_000.0 @@ -549,11 +550,11 @@ class ComposterOverlay { @SubscribeEvent fun onBackgroundDraw(event: GuiRenderEvent.ChestGuiOverlayRenderEvent) { if (inInventory) { - config.composterOverlayOrganicMatterPos.renderStringsAndItems( + config.overlayOrganicMatterPos.renderStringsAndItems( organicMatterDisplay, posLabel = "Composter Overlay Organic Matter" ) - config.composterOverlayFuelExtrasPos.renderStringsAndItems( + config.overlayFuelExtrasPos.renderStringsAndItems( fuelExtraDisplay, posLabel = "Composter Overlay Fuel Extras" ) @@ -565,4 +566,14 @@ class ComposterOverlay { HOUR("Hour", 60 * 60), DAY("Day", 60 * 60 * 24), } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent){ + event.move(3, "garden.composterOverlay", "garden.composters.overlay") + event.move(3, "garden.composterOverlayPriceType", "garden.composters.overlayPriceType") + event.move(3, "garden.composterOverlayRetrieveFrom", "garden.composters.retrieveFrom") + event.move(3, "garden.composterOverlayOrganicMatterPos", "garden.composters.overlayOrganicMatterPos") + event.move(3, "garden.composterOverlayFuelExtrasPos", "garden.composters.overlayFuelExtrasPos") + event.move(3, "garden.composterRoundDown", "garden.composters.roundDown") + } } \ No newline at end of file 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 26b070935..cb74cfde5 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,7 @@ 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 import at.hannibal2.skyhanni.utils.InventoryUtils @@ -18,12 +19,12 @@ import net.minecraftforge.event.entity.player.ItemTooltipEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class GardenComposterInventoryFeatures { - private val config get() = SkyHanniMod.feature.garden + private val config get() = SkyHanniMod.feature.garden.composters @SubscribeEvent fun onTooltip(event: ItemTooltipEvent) { if (!GardenAPI.inGarden()) return - if (!config.composterUpgradePrice) return + if (!config.upgradePrice) return if (InventoryUtils.openInventoryName() != "Composter Upgrades") return @@ -77,7 +78,7 @@ class GardenComposterInventoryFeatures { @SubscribeEvent fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { if (!LorenzUtils.inSkyBlock) return - if (!config.composterHighLightUpgrade) return + if (!config.highlightUpgrade) return if (InventoryUtils.openInventoryName() == "Composter Upgrades") { if (event.gui !is GuiChest) return @@ -95,4 +96,10 @@ class GardenComposterInventoryFeatures { } } } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent){ + event.move(3, "garden.composterUpgradePrice", "garden.composters.upgradePrice") + event.move(3, "garden.composterHighLightUpgrade", "garden.composters.highlightUpgrade") + } } \ No newline at end of file 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 beb210cdc..e02b358b9 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 @@ -106,7 +106,7 @@ class JacobContestFFNeededDisplay { private fun formatFarmingFortune(farmingFortune: Double): String { var ff = farmingFortune - if (!config.farmingFortuneDropMultiplier) { + if (!config.farmingFortunes.dropMultiplier) { ff -= 100 if (ff < 100) { ff = 0.0 diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobFarmingContestsInventory.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobFarmingContestsInventory.kt index 55d8bd66e..bb4b36d3e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobFarmingContestsInventory.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobFarmingContestsInventory.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.garden.contest import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.GuiRenderItemEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent @@ -24,7 +25,7 @@ class JacobFarmingContestsInventory { private val formatDay = SimpleDateFormat("dd MMMM yyyy", Locale.US) private val formatTime = SimpleDateFormat("HH:mm", Locale.US) - private val config get() = SkyHanniMod.feature.inventory + private val config get() = SkyHanniMod.feature.inventory.jacobFarmingContests // Render the contests a tick delayed to feel smoother private var hideEverything = true @@ -55,7 +56,7 @@ class JacobFarmingContestsInventory { } val time = FarmingContestAPI.getSbTimeFor(name) ?: continue FarmingContestAPI.addContest(time, item) - if (config.jacobFarmingContestRealTime) { + if (config.realTime) { readRealTime(time, slot) } } @@ -73,7 +74,7 @@ class JacobFarmingContestsInventory { fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { if (!LorenzUtils.inSkyBlock) return if (!InventoryUtils.openInventoryName().contains("Your Contests")) return - if (!config.jacobFarmingContestHighlightRewards) return + if (!config.highlightRewards) return // hide green border for a tick if (hideEverything) return @@ -98,7 +99,7 @@ class JacobFarmingContestsInventory { if (!InventoryUtils.openInventoryName().contains("Your Contests")) return val slot = event.slot.slotNumber - if (config.jacobFarmingContestRealTime) { + if (config.realTime) { realTime[slot]?.let { val toolTip = event.toolTip if (toolTip.size > 1) { @@ -111,7 +112,7 @@ class JacobFarmingContestsInventory { @SubscribeEvent fun onRenderItemOverlayPost(event: GuiRenderItemEvent.RenderOverlayEvent.GuiRenderItemPost) { if (!LorenzUtils.inSkyBlock) return - if (!config.jacobFarmingContestMedalIcon) return + if (!config.medalIcon) return if (!InventoryUtils.openInventoryName().contains("Your Contests")) return val stack = event.stack ?: return @@ -129,7 +130,7 @@ class JacobFarmingContestsInventory { var y = event.y + 1 var scale = .7f - if (finneganContest && config.jacobFarmingContestFinneganIcon) { + if (finneganContest && config.finneganIcon) { stackTip = "§${medalEarned.color}▲" x = event.x + 5 y = event.y - 2 @@ -140,4 +141,12 @@ class JacobFarmingContestsInventory { } } } + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent){ + event.move(3,"inventory.jacobFarmingContestHighlightRewards","inventory.jacobFarmingContests.highlightRewards") + event.move(3,"inventory.jacobFarmingContestHideDuplicates","inventory.jacobFarmingContests.hideDuplicates") + event.move(3,"inventory.jacobFarmingContestRealTime","inventory.jacobFarmingContests.realTime") + event.move(3,"inventory.jacobFarmingContestFinneganIcon","inventory.jacobFarmingContests.finneganIcon") + event.move(3,"inventory.jacobFarmingContestMedalIcon","inventory.jacobFarmingContests.medalIcon") + } } \ No newline at end of file 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 12e9c2f80..cd9a3f555 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 @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.garden.farming import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GardenToolChangeEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzTickEvent @@ -49,7 +50,7 @@ object CropMoneyDisplay { } private var display = emptyList>() - private val config get() = SkyHanniMod.feature.garden + private val config get() = SkyHanniMod.feature.garden.moneyPerHours private var loaded = false private var ready = false private val cropNames = mutableMapOf() @@ -65,7 +66,7 @@ object CropMoneyDisplay { if (!isEnabled()) return if (!GardenAPI.hideExtraGuis()) { - config.moneyPerHourPos.renderStringsAndItems(display, posLabel = "Garden Crop Money Per Hour") + config.pos.renderStringsAndItems(display, posLabel = "Garden Crop Money Per Hour") } } @@ -79,7 +80,7 @@ object CropMoneyDisplay { if (!isEnabled()) return if (!event.repeatSeconds(5)) return - if (GardenAPI.getCurrentlyFarmedCrop() == null && !config.moneyPerHourAlwaysOn) return + if (GardenAPI.getCurrentlyFarmedCrop() == null && !config.alwaysOn) return update() } @@ -93,7 +94,7 @@ object CropMoneyDisplay { private fun drawDisplay(): List> { val newDisplay = mutableListOf>() - val title = if (config.moneyPerHourCompact) { + val title = if (config.compact) { "§7Money/Hour:" } else { "§7Money per Hour when selling:" @@ -105,11 +106,11 @@ object CropMoneyDisplay { return newDisplay } - if (GardenAPI.getCurrentlyFarmedCrop() == null && !config.moneyPerHourAlwaysOn) return newDisplay + if (GardenAPI.getCurrentlyFarmedCrop() == null && !config.alwaysOn) return newDisplay newDisplay.addAsSingletonList(fullTitle(title)) - if (!config.cropMilestoneProgress) { + if (!SkyHanniMod.feature.garden.cropMilestones.progress) { newDisplay.addAsSingletonList("§cCrop Milestone Progress Display is disabled!") return newDisplay } @@ -121,7 +122,7 @@ object CropMoneyDisplay { val reforgeName = InventoryUtils.getItemInHand()?.getReforgeName() toolHasBountiful?.put(it, reforgeName == "bountiful") - if (GardenAPI.mushroomCowPet && it != CropType.MUSHROOM && config.moneyPerHourMooshroom) { + if (GardenAPI.mushroomCowPet && it != CropType.MUSHROOM && config.mooshroom) { val redMushroom = "ENCHANTED_RED_MUSHROOM".asInternalName() val brownMushroom = "ENCHANTED_BROWN_MUSHROOM".asInternalName() val (redPrice, brownPrice) = if (LorenzUtils.noTradeMode) { @@ -139,7 +140,7 @@ object CropMoneyDisplay { extraMushroomCowPerkCoins = perSecond * 60 * 60 } - if (InventoryUtils.getItemInHand()?.getInternalName()?.contains("DICER") == true && config.moneyPerHourDicer) { + if (InventoryUtils.getItemInHand()?.getInternalName()?.contains("DICER") == true && config.dicer) { val (dicerDrops, internalName) = when (it) { CropType.MELON -> GardenCropSpeed.latestMelonDicer to "ENCHANTED_MELON".asInternalName() CropType.PUMPKIN -> GardenCropSpeed.latestPumpkinDicer to "ENCHANTED_PUMPKIN".asInternalName() @@ -152,7 +153,7 @@ object CropMoneyDisplay { extraDicerCoins = 60 * 60 * GardenCropSpeed.getRecentBPS() * dicerDrops * price } - if (config.moneyPerHourArmor) { + if (config.armor) { val amountPerHour = it.multiplier * GardenCropSpeed.getRecentBPS() * FarmingArmorDrops.getDropsPerHour(it) extraArmorCoins = amountPerHour * it.specialDropType.asInternalName().getNpcPrice() @@ -179,14 +180,14 @@ object CropMoneyDisplay { number++ val crop = cropNames[internalName]!! val isCurrent = crop == GardenAPI.getCurrentlyFarmedCrop() - if (number > config.moneyPerHourShowOnlyBest && (!config.moneyPerHourShowCurrent || !isCurrent)) continue + if (number > config.showOnlyBest && (!config.showCurrent || !isCurrent)) continue val debug = isCurrent && showCalculation if (debug) { newDisplay.addAsSingletonList("final calculation for: $internalName/$crop") } val list = mutableListOf() - if (!config.moneyPerHourCompact) { + if (!config.compact) { list.add("§7$number# ") } @@ -197,21 +198,21 @@ object CropMoneyDisplay { list.add(internalName.getItemStack()) } - if (cropNames[internalName] == CropType.WHEAT && config.moneyPerHourMergeSeeds) { + if (cropNames[internalName] == CropType.WHEAT && config.mergeSeeds) { list.add(getItemStack("BOX_OF_SEEDS", true)) } } catch (e: NullPointerException) { e.printStackTrace() } - if (!config.moneyPerHourCompact) { + if (!config.compact) { val itemName = internalName.getItemNameOrNull()?.removeColor() ?: continue val currentColor = if (isCurrent) "§e" else "§7" val contestFormat = if (GardenNextJacobContest.isNextCrop(crop)) "§n" else "" list.add("$currentColor$contestFormat$itemName§7: ") } - val coinsColor = if (isCurrent && config.moneyPerHourCompact) "§e" else "§6" + val coinsColor = if (isCurrent && config.compact) "§e" else "§6" val moneyArray = moneyPerHourData[internalName]!! for (price in moneyArray) { @@ -231,20 +232,20 @@ object CropMoneyDisplay { newDisplay.add(list) } - return if (config.moneyPerHourHideTitle) newDisplay.drop(1) else newDisplay + return if (config.hideTitle) newDisplay.drop(1) else newDisplay } private fun fullTitle(title: String): String { val titleText: String val nameList = mutableListOf() - if (config.moneyPerHourUseCustomFormat) { + if (config.useCustomFormat) { val map = mapOf( 0 to "Sell Offer", 1 to "Instant Sell", 2 to "NPC Price", ) val list = mutableListOf() - for (index in config.moneyPerHourCustomFormat) { + for (index in config.customFormat) { map[index]?.let { list.add(it) } @@ -261,7 +262,7 @@ object CropMoneyDisplay { return "$title §7($titleText§7)" } - private fun format(moneyPerHour: Double) = if (config.moneyPerHourCompactPrice) { + private fun format(moneyPerHour: Double) = if (config.compactPrice) { NumberUtil.format(moneyPerHour) } else { LorenzUtils.formatInteger(moneyPerHour.toLong()) @@ -274,9 +275,9 @@ object CropMoneyDisplay { var seedsPerHour = 0.0 val onlyNpcPrice = - (!config.moneyPerHourUseCustomFormat && LorenzUtils.noTradeMode) || - (config.moneyPerHourUseCustomFormat && config.moneyPerHourCustomFormat.size == 1 && - config.moneyPerHourCustomFormat[0] == 2) + (!config.useCustomFormat && LorenzUtils.noTradeMode) || + (config.useCustomFormat && config.customFormat.size == 1 && + config.customFormat[0] == 2) for ((internalName, amount) in multipliers.moveEntryToTop { isSeeds(it.key) }) { val crop = cropNames[internalName]!! @@ -331,7 +332,7 @@ object CropMoneyDisplay { debugList.addAsSingletonList(" instantSell: ${instantSell.addSeparators()}") } - if (crop == CropType.WHEAT && config.moneyPerHourMergeSeeds) { + if (crop == CropType.WHEAT && config.mergeSeeds) { if (isSeeds) { seedsPrice = bazaarData seedsPerHour = cropsPerHour @@ -350,7 +351,7 @@ object CropMoneyDisplay { } val bountifulMoney = - if (toolHasBountiful?.get(crop) == true && config.moneyPerHourBountiful) speedPerHour * 0.2 else 0.0 + if (toolHasBountiful?.get(crop) == true && config.bountiful) speedPerHour * 0.2 else 0.0 if (debug && bountifulMoney > 0.0) { debugList.addAsSingletonList(" bountifulCoins: ${bountifulMoney.addSeparators()}") } @@ -364,14 +365,14 @@ object CropMoneyDisplay { internalName.equals("ENCHANTED_SEEDS") || internalName.equals("SEEDS") private fun formatNumbers(sellOffer: Double, instantSell: Double, npcPrice: Double): Array { - return if (config.moneyPerHourUseCustomFormat) { + return if (config.useCustomFormat) { val map = mapOf( 0 to sellOffer, 1 to instantSell, 2 to npcPrice, ) val newList = mutableListOf() - for (index in config.moneyPerHourCustomFormat) { + for (index in config.customFormat) { map[index]?.let { newList.add(it) } @@ -416,5 +417,24 @@ object CropMoneyDisplay { } } - private fun isEnabled() = GardenAPI.inGarden() && config.moneyPerHourDisplay + private fun isEnabled() = GardenAPI.inGarden() && config.display + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent){ + event.move(3, "garden.moneyPerHourDisplay", "garden.moneyPerHours.display") + event.move(3, "garden.moneyPerHourShowOnlyBest", "garden.moneyPerHours.showOnlyBest") + event.move(3, "garden.moneyPerHourShowCurrent", "garden.moneyPerHours.showCurrent") + event.move(3, "garden.moneyPerHourAlwaysOn", "garden.moneyPerHours.alwaysOn") + event.move(3, "garden.moneyPerHourCompact", "garden.moneyPerHours.compact") + event.move(3, "garden.moneyPerHourCompactPrice", "garden.moneyPerHours.compactPrice") + event.move(3, "garden.moneyPerHourUseCustomFormat", "garden.moneyPerHours.useCustomFormat") + event.move(3, "garden.moneyPerHourCustomFormat", "garden.moneyPerHours.customFormat") + event.move(3, "garden.moneyPerHourMergeSeeds", "garden.moneyPerHours.mergeSeeds") + event.move(3, "garden.moneyPerHourBountiful", "garden.moneyPerHours.bountiful") + event.move(3, "garden.moneyPerHourMooshroom", "garden.moneyPerHours.mooshroom") + event.move(3, "garden.moneyPerHourArmor", "garden.moneyPerHours.armor") + event.move(3, "garden.moneyPerHourDicer", "garden.moneyPerHours.dicer") + event.move(3, "garden.moneyPerHourHideTitle", "garden.moneyPerHours.hideTitle") + event.move(3, "garden.moneyPerHourPos", "garden.moneyPerHours.pos") + } } 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 35fb5eaa5..4282e5e8f 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 @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.garden.farming import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.GardenToolChangeEvent import at.hannibal2.skyhanni.events.GuiRenderEvent @@ -18,7 +19,7 @@ class DicerRngDropCounter { private var display = emptyList() private val drops = mutableMapOf>() private val itemDrops = mutableListOf() - private val config get() = SkyHanniMod.feature.garden + private val config get() = SkyHanniMod.feature.garden.dicerCounters init { initDrops() @@ -55,7 +56,7 @@ class DicerRngDropCounter { @SubscribeEvent fun onChat(event: LorenzChatEvent) { if (!GardenAPI.inGarden()) return - if (!config.dicerCounterHideChat && !config.dicerCounterDisplay) return + if (!config.hideChat && !config.display) return val message = event.message for (drop in itemDrops) { @@ -63,7 +64,7 @@ class DicerRngDropCounter { addDrop(drop.crop, drop.rarity) saveConfig() update() - if (config.dicerCounterHideChat) { + if (config.hideChat) { event.blockedReason = "dicer_rng_drop_counter" } return @@ -109,7 +110,7 @@ class DicerRngDropCounter { @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) { if (isEnabled()) { - config.dicerCounterPos.renderStrings(display, posLabel = "Dicer Counter") + config.pos.renderStrings(display, posLabel = "Dicer Counter") } } @@ -138,5 +139,12 @@ class DicerRngDropCounter { } } - fun isEnabled() = GardenAPI.inGarden() && config.dicerCounterDisplay + fun isEnabled() = GardenAPI.inGarden() && config.display + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent){ + event.move(3, "garden.dicerCounterDisplay", "garden.dicerCounters.display") + 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 375398098..db232600a 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 @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.garden.farming import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzChatEvent @@ -26,7 +27,7 @@ class FarmingArmorDrops { private var hasArmor = false private val armorPattern = "(FERMENTO|CROPIE|SQUASH|MELON)_(LEGGINGS|CHESTPLATE|BOOTS|HELMET)".toPattern() - private val config get() = SkyHanniMod.feature.garden + private val config get() = SkyHanniMod.feature.garden.farmingArmorDrop enum class ArmorDropType(val dropName: String, val chatMessage: String) { CROPIE("§9Cropie", "§6§lRARE CROP! §r§f§r§9Cropie §r§b(Armor Set Bonus)"), @@ -45,7 +46,7 @@ class FarmingArmorDrops { for (dropType in ArmorDropType.entries) { if (dropType.chatMessage == event.message) { addDrop(dropType) - if (config.farmingArmorDropsHideChat) { + if (config.hideChat) { event.blockedReason = "farming_armor_drops" } } @@ -81,16 +82,16 @@ class FarmingArmorDrops { @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) { if (!GardenAPI.inGarden()) return - if (!config.farmingArmorDropsEnabled) return + if (!config.enabled) return if (!hasArmor) return - config.farmingArmorDropsPos.renderStrings(display, posLabel = "Farming Armor Drops") + config.pos.renderStrings(display, posLabel = "Farming Armor Drops") } @SubscribeEvent fun onTick(event: LorenzTickEvent) { if (!GardenAPI.inGarden()) return - if (!config.farmingArmorDropsEnabled) return + if (!config.enabled) return if (event.isMod(30)) { checkArmor() @@ -142,4 +143,11 @@ class FarmingArmorDrops { return currentArmorDropChance } } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent){ + event.move(3,"garden.farmingArmorDropsEnabled", "garden.farmingArmorDrop.enabled") + event.move(3,"garden.farmingArmorDropsHideChat", "garden.farmingArmorDrop.hideChat") + event.move(3,"garden.farmingArmorDropsPos", "garden.farmingArmorDrop.pos") + } } \ No newline at end of file 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 474f0e814..f7d9659dc 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 @@ -29,9 +29,9 @@ class FarmingWeightDisplay { @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent) { - val shouldShow = apiError || (config.eliteFarmingWeightIgnoreLow || weight >= 200) + val shouldShow = apiError || (config.ignoreLow || weight >= 200) if (isEnabled() && shouldShow) { - config.eliteFarmingWeightPos.renderRenderables(display, posLabel = "Farming Weight Display") + config.pos.renderRenderables(display, posLabel = "Farming Weight Display") } } @@ -72,10 +72,18 @@ class FarmingWeightDisplay { @SubscribeEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(1, "garden.eliteFarmingWeightoffScreenDropMessage", "garden.eliteFarmingWeightOffScreenDropMessage") + event.move(3, "garden.eliteFarmingWeightDisplay","garden.eliteFarmingWeights.display") + event.move(3, "garden.eliteFarmingWeightPos","garden.eliteFarmingWeights.pos") + event.move(3, "garden.eliteFarmingWeightLeaderboard","garden.eliteFarmingWeights.leaderboard") + event.move(3, "garden.eliteFarmingWeightOvertakeETA","garden.eliteFarmingWeights.overtakeETA") + event.move(3, "garden.eliteFarmingWeightOffScreenDropMessage","garden.eliteFarmingWeights.offScreenDropMessage") + event.move(3, "garden.eliteFarmingWeightOvertakeETAAlways","garden.eliteFarmingWeights.overtakeETAAlways") + event.move(3, "garden.eliteFarmingWeightETAGoalRank","garden.eliteFarmingWeights.ETAGoalRank") + event.move(3, "garden.eliteFarmingWeightIgnoreLow","garden.eliteFarmingWeights.ignoreLow") } companion object { - private val config get() = SkyHanniMod.feature.garden + private val config get() = SkyHanniMod.feature.garden.eliteFarmingWeights private val localCounter = mutableMapOf() private var display = emptyList() @@ -166,7 +174,7 @@ class FarmingWeightDisplay { openWebsite(LorenzUtils.getPlayerName()) }) - if (isEtaEnabled() && (weightPerSecond != -1.0 || config.eliteFarmingWeightOvertakeETAAlways)) { + if (isEtaEnabled() && (weightPerSecond != -1.0 || config.overtakeETAAlways)) { getETA()?.let { list.add(it) } @@ -175,7 +183,7 @@ class FarmingWeightDisplay { } private fun getLeaderboard(): String { - if (!config.eliteFarmingWeightLeaderboard) return "" + if (!config.leaderboard) return "" // Fetching new leaderboard position every 10.5 minutes if (System.currentTimeMillis() > lastLeaderboardUpdate + 630_000) { @@ -204,7 +212,7 @@ class FarmingWeightDisplay { } private fun getRankGoal(): Int { - val value = config.eliteFarmingWeightETAGoalRank + val value = config.ETAGoalRank var goal = 10000 // Check that the provided string is valid @@ -212,7 +220,7 @@ class FarmingWeightDisplay { if (parsed < 1 || parsed > goal) { LorenzUtils.error("[SkyHanni] Invalid Farming Weight Overtake Goal!") LorenzUtils.chat("§eEdit the Overtake Goal config value with a valid number [1-10000] to use this feature!") - config.eliteFarmingWeightETAGoalRank = goal.toString() + config.ETAGoalRank = goal.toString() } else { goal = parsed } @@ -312,8 +320,8 @@ class FarmingWeightDisplay { ) } - private fun isEnabled() = GardenAPI.inGarden() && config.eliteFarmingWeightDisplay - private fun isEtaEnabled() = config.eliteFarmingWeightOvertakeETA + private fun isEnabled() = GardenAPI.inGarden() && config.display + private fun isEtaEnabled() = config.overtakeETA fun addCrop(crop: CropType, addedCounter: Int) { val before = getExactWeight() @@ -345,7 +353,7 @@ class FarmingWeightDisplay { SkyHanniMod.coroutineScope.launch { val wasNotLoaded = leaderboardPosition == -1 leaderboardPosition = loadLeaderboardPosition() - if (wasNotLoaded && config.eliteFarmingWeightOffScreenDropMessage) { + if (wasNotLoaded && config.offScreenDropMessage) { checkOffScreenLeaderboardChanges() } ProfileStorageData.profileSpecific?.garden?.farmingWeight?.lastFarmingWeightLeaderboard = 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 30afb0418..ba5945762 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,6 +1,7 @@ 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 @@ -12,12 +13,13 @@ import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList import at.hannibal2.skyhanni.utils.LorenzUtils.sorted import at.hannibal2.skyhanni.utils.TimeUnit import at.hannibal2.skyhanni.utils.TimeUtils +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class GardenBestCropTime { var display = emptyList>() companion object { - private val config get() = SkyHanniMod.feature.garden + private val config get() = SkyHanniMod.feature.garden.cropMilestones val timeTillNextCrop = mutableMapOf() fun reset() { @@ -34,7 +36,7 @@ class GardenBestCropTime { val currentTier = GardenCropMilestones.getTierForCropCount(counter, crop) val cropsForCurrentTier = GardenCropMilestones.getCropsForTier(currentTier, crop) - val nextTier = if (config.cropMilestoneBestShowMaxedNeeded.get()) 46 else currentTier + 1 + val nextTier = if (config.bestShowMaxedNeeded.get()) 46 else currentTier + 1 val cropsForNextTier = GardenCropMilestones.getCropsForTier(nextTier, crop) val have = counter - cropsForCurrentTier @@ -54,7 +56,7 @@ class GardenBestCropTime { updateTimeTillNextCrop() } - val gardenExp = config.cropMilestoneBestType == 0 + val gardenExp = config.next.bestType == 0 val sorted = if (gardenExp) { val helpMap = mutableMapOf() for ((crop, time) in timeTillNextCrop) { @@ -70,16 +72,16 @@ class GardenBestCropTime { } - if (!config.cropMilestoneBestHideTitle) { + if (!config.next.bestHideTitle) { val title = if (gardenExp) "§2Garden Experience" else "§bSkyBlock Level" - if (config.cropMilestoneBestCompact) { + if (config.next.bestCompact) { newList.addAsSingletonList("§eBest Crop Time") } else { newList.addAsSingletonList("§eBest Crop Time §7($title§7)") } } - if (!config.cropMilestoneProgress) { + if (!config.progress) { newList.addAsSingletonList("§cCrop Milestone Progress Display is disabled!") return newList } @@ -93,14 +95,14 @@ class GardenBestCropTime { for (crop in sorted.keys) { if (crop.isMaxed()) continue val millis = timeTillNextCrop[crop]!! - val biggestUnit = TimeUnit.entries[config.cropMilestoneHighestTimeFormat.get()] + val biggestUnit = TimeUnit.entries[config.highestTimeFormat.get()] val duration = TimeUtils.formatDuration(millis, biggestUnit, maxUnits = 2) val isCurrent = crop == currentCrop number++ - if (number > config.cropMilestoneShowOnlyBest && (!config.cropMilestoneShowCurrent || !isCurrent)) continue + if (number > config.next.showOnlyBest && (!config.next.showCurrent || !isCurrent)) continue val list = mutableListOf() - if (!config.cropMilestoneBestCompact) { + if (!config.next.bestCompact) { list.add("§7$number# ") } list.addCropIcon(crop) @@ -108,14 +110,14 @@ class GardenBestCropTime { val color = if (isCurrent) "§e" else "§7" val contestFormat = if (GardenNextJacobContest.isNextCrop(crop)) "§n" else "" val currentTier = GardenCropMilestones.getTierForCropCount(crop.getCounter(), crop) - val nextTier = if (config.cropMilestoneBestShowMaxedNeeded.get()) 46 else currentTier + 1 + val nextTier = if (config.bestShowMaxedNeeded.get()) 46 else currentTier + 1 - val cropName = if (!config.cropMilestoneBestCompact) crop.cropName + " " else "" - val tier = if (!config.cropMilestoneBestCompact) "$currentTier➜$nextTier§r " else "" + val cropName = if (!config.next.bestCompact) crop.cropName + " " else "" + val tier = if (!config.next.bestCompact) "$currentTier➜$nextTier§r " else "" list.add("$color$contestFormat$cropName$tier§b$duration") - if (gardenExp && !config.cropMilestoneBestCompact) { + if (gardenExp && !config.next.bestCompact) { val gardenExpForTier = getGardenExpForTier(nextTier) list.add(" §7(§2$gardenExpForTier §7Exp)") } @@ -125,4 +127,13 @@ class GardenBestCropTime { } private fun getGardenExpForTier(gardenLevel: Int) = if (gardenLevel > 30) 300 else gardenLevel * 10 + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent){ + event.move(3, "garden.cropMilestoneBestType", "garden.cropMilestones.next.bestType") + event.move(3, "garden.cropMilestoneShowOnlyBest", "garden.cropMilestones.next.showOnlyBest") + event.move(3, "garden.cropMilestoneShowCurrent", "garden.cropMilestones.next.showCurrent") + 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/GardenCropMilestoneDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt index 52b5f7f3c..a26365bcd 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,7 @@ 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 @@ -32,7 +33,7 @@ object GardenCropMilestoneDisplay { private var progressDisplay = emptyList>() private var mushroomCowPerkDisplay = emptyList>() private val cultivatingData = mutableMapOf() - private val config get() = SkyHanniMod.feature.garden + private val config get() = SkyHanniMod.feature.garden.cropMilestones private val bestCropTime = GardenBestCropTime() private var lastPlaySoundTime = 0L @@ -41,8 +42,8 @@ object GardenCropMilestoneDisplay { @SubscribeEvent fun onConfigLoad(event: ConfigLoadEvent) { LorenzUtils.onToggle( - config.cropMilestoneBestShowMaxedNeeded, - config.cropMilestoneHighestTimeFormat, + config.bestShowMaxedNeeded, + config.highestTimeFormat, ) { GardenBestCropTime.updateTimeTillNextCrop() update() @@ -54,18 +55,18 @@ object GardenCropMilestoneDisplay { if (!isEnabled()) return if (GardenAPI.hideExtraGuis()) return - config.cropMilestoneProgressDisplayPos.renderStringsAndItems( + config.progressDisplayPos.renderStringsAndItems( progressDisplay, posLabel = "Crop Milestone Progress" ) - if (config.cropMilestoneMushroomPetPerkEnabled) { - config.cropMilestoneMushroomPetPerkPos.renderStringsAndItems( + if (config.mushroomPetPerk.enabled) { + config.mushroomPetPerk.pos.renderStringsAndItems( mushroomCowPerkDisplay, posLabel = "Mushroom Cow Perk" ) } - if (config.cropMilestoneBestDisplay) { - config.cropMilestoneNextDisplayPos.renderStringsAndItems(bestCropTime.display, posLabel = "Best Crop Time") + if (config.next.bestDisplay) { + config.next.displayPos.renderStringsAndItems(bestCropTime.display, posLabel = "Best Crop Time") } } @@ -121,7 +122,7 @@ object GardenCropMilestoneDisplay { progressDisplay = drawProgressDisplay(it) } - if (config.cropMilestoneBestDisplay && config.cropMilestoneBestAlwaysOn || currentCrop != null) { + if (config.next.bestDisplay && config.next.bestAlwaysOn || currentCrop != null) { bestCropTime.display = bestCropTime.drawBestDisplay(currentCrop) } } @@ -132,7 +133,7 @@ object GardenCropMilestoneDisplay { lineMap[0] = Collections.singletonList("§6Crop Milestones") val currentTier = GardenCropMilestones.getTierForCropCount(counter, crop) - val nextTier = if (config.cropMilestoneBestShowMaxedNeeded.get()) 46 else currentTier + 1 + val nextTier = if (config.bestShowMaxedNeeded.get()) 46 else currentTier + 1 val list = mutableListOf() list.addCropIcon(crop) @@ -144,7 +145,7 @@ object GardenCropMilestoneDisplay { lineMap[1] = list val cropsForNextTier = GardenCropMilestones.getCropsForTier(nextTier, crop) - val (have, need) = if (config.cropMilestoneBestShowMaxedNeeded.get()) { + val (have, need) = if (config.bestShowMaxedNeeded.get()) { Pair(counter, cropsForNextTier) } else { val cropsForCurrentTier = GardenCropMilestones.getCropsForTier(currentTier, crop) @@ -175,7 +176,7 @@ object GardenCropMilestoneDisplay { val missingTimeSeconds = missing / farmingFortuneSpeed val millis = missingTimeSeconds * 1000 GardenBestCropTime.timeTillNextCrop[crop] = millis - val biggestUnit = TimeUnit.entries[config.cropMilestoneHighestTimeFormat.get()] + val biggestUnit = TimeUnit.entries[config.highestTimeFormat.get()] val duration = TimeUtils.formatDuration(millis, biggestUnit) tryWarn(millis, "§b${crop.cropName} $nextTier in $duration") val speedText = "§7In §b$duration" @@ -208,7 +209,7 @@ object GardenCropMilestoneDisplay { } private fun tryWarn(millis: Long, title: String) { - if (!config.cropMilestoneWarnClose) return + if (!config.warnClose) return if (GardenCropSpeed.lastBrokenTime + 500 <= System.currentTimeMillis()) return if (millis > 5_900) return @@ -223,7 +224,7 @@ object GardenCropMilestoneDisplay { private fun formatDisplay(lineMap: HashMap>): MutableList> { val newList = mutableListOf>() - for (index in config.cropMilestoneText) { + for (index in config.text) { lineMap[index]?.let { newList.add(it) } @@ -269,7 +270,7 @@ object GardenCropMilestoneDisplay { val missingTimeSeconds = missing / blocksPerSecond val millis = missingTimeSeconds * 1000 - val biggestUnit = TimeUnit.entries[config.cropMilestoneHighestTimeFormat.get()] + val biggestUnit = TimeUnit.entries[config.highestTimeFormat.get()] val duration = TimeUtils.formatDuration(millis.toLong(), biggestUnit) lineMap[3] = Collections.singletonList("§7In §b$duration") } @@ -278,7 +279,7 @@ object GardenCropMilestoneDisplay { lineMap[4] = Collections.singletonList("§7Percentage: §e$percentageFormat") val newList = mutableListOf>() - for (index in config.cropMilestoneMushroomPetPerkText) { + for (index in config.mushroomPetPerk.text) { lineMap[index]?.let { newList.add(it) } @@ -286,5 +287,22 @@ object GardenCropMilestoneDisplay { mushroomCowPerkDisplay = newList } - private fun isEnabled() = GardenAPI.inGarden() && config.cropMilestoneProgress + private fun isEnabled() = GardenAPI.inGarden() && config.progress + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent){ + event.move(3,"garden.cropMilestoneProgress", "garden.cropMilestones.progress") + event.move(3, "garden.cropMilestoneWarnClose", "garden.cropMilestones.warnClose") + event.move(3, "garden.cropMilestoneHighestTimeFormat","garden.cropMilestones.highestTimeFormat") + event.move(3,"garden.cropMilestoneBestShowMaxedNeeded","garden.cropMilestones.bestShowMaxedNeeded") + event.move(3,"garden.cropMilestoneText","garden.cropMilestones.text") + event.move(3,"garden.blocksBrokenPrecision", "garden.cropMilestones.blocksBrokenPrecision") + event.move(3, "garden.cropMilestoneProgressDisplayPos", "garden.cropMilestones.progressDisplayPos") + event.move(3, "garden.cropMilestoneBestDisplay", "garden.cropMilestones.next.bestDisplay") + event.move(3, "garden.cropMilestoneBestAlwaysOn", "garden.cropMilestones.next.bestAlwaysOn") + event.move(3, "garden.cropMilestoneNextDisplayPos", "garden.cropMilestones.next.displayPos") + event.move(3,"garden.cropMilestoneMushroomPetPerkEnabled","garden.cropMilestones.mushroomPetPerk.enabled") + event.move(3,"garden.cropMilestoneMushroomPetPerkText","garden.cropMilestones.mushroomPetPerk.text") + event.move(3,"garden.cropMilestoneMushroomPetPerkPos","garden.cropMilestones.mushroomPetPerk.pos") + } } 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 d557d89d9..0ac20c8bc 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,6 +1,7 @@ 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 @@ -85,7 +86,7 @@ object GardenCropSpeed { if (blocksSpeedList.isEmpty()) return secondsStopped++ } else { - if (secondsStopped >= config.blocksBrokenResetTime) { + if (secondsStopped >= config.cropMilestones.blocksBrokenResetTime) { resetSpeed() } blocksSpeedList = blocksSpeedList.editCopy { @@ -194,4 +195,10 @@ object GardenCropSpeed { fun CropType.getLatestBlocksPerSecond() = latestBlocksPerSecond?.get(this) fun isSpeedDataEmpty() = cropsPerSecond?.values?.sum()?.let { it == 0 } ?: true + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent){ + event.move(3,"garden.blocksBrokenResetTime", "garden.cropMilestones.blocksBrokenResetTime") + + } } \ No newline at end of file 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 16393cbab..7c93f3b99 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,35 +1,37 @@ 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 import at.hannibal2.skyhanni.utils.KeyboardManager.isKeyHeld import net.minecraft.client.Minecraft import net.minecraft.client.gui.inventory.GuiEditSign import net.minecraft.client.settings.KeyBinding +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import org.spongepowered.asm.mixin.injection.callback.CallbackInfo import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable import java.util.IdentityHashMap object GardenCustomKeybinds { - private val shConfig get() = SkyHanniMod.feature.garden + private val shConfig get() = SkyHanniMod.feature.garden.keyBind private val mcSettings get() = Minecraft.getMinecraft().gameSettings private val map: MutableMap Int> = IdentityHashMap() private var lastWindowOpenTime = 0L init { - map[mcSettings.keyBindAttack] = { shConfig.keyBindAttack } - map[mcSettings.keyBindUseItem] = { shConfig.keyBindUseItem } - map[mcSettings.keyBindLeft] = { shConfig.keyBindLeft } - map[mcSettings.keyBindRight] = { shConfig.keyBindRight } - map[mcSettings.keyBindForward] = { shConfig.keyBindForward } - map[mcSettings.keyBindBack] = { shConfig.keyBindBack } - map[mcSettings.keyBindJump] = { shConfig.keyBindJump } - map[mcSettings.keyBindSneak] = { shConfig.keyBindSneak } + 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 } } - private fun isEnabled() = GardenAPI.inGarden() && shConfig.keyBindEnabled + private fun isEnabled() = GardenAPI.inGarden() && shConfig.enabled private fun isActive(): Boolean { if (!isEnabled()) return false @@ -65,4 +67,17 @@ object GardenCustomKeybinds { keyBinding as AccessorKeyBinding keyBinding.pressTime_skyhanni++ } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent){ + event.move(3, "garden.keyBindEnabled", "garden.keyBind.enabled") + event.move(3, "garden.keyBindAttack", "garden.keyBind.attack") + event.move(3, "garden.keyBindUseItem", "garden.keyBind.useItem") + event.move(3, "garden.keyBindLeft", "garden.keyBind.left") + event.move(3, "garden.keyBindRight", "garden.keyBind.right") + event.move(3, "garden.keyBindForward", "garden.keyBind.forward") + event.move(3, "garden.keyBindBack", "garden.keyBind.back") + 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/inventory/AnitaExtraFarmingFortune.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/AnitaExtraFarmingFortune.kt index e0e7da8e2..01381e80a 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,6 +1,7 @@ package at.hannibal2.skyhanni.features.garden.inventory import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.utils.InventoryUtils @@ -16,7 +17,7 @@ import net.minecraftforge.event.entity.player.ItemTooltipEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class AnitaExtraFarmingFortune { - private val config get() = SkyHanniMod.feature.garden + private val config get() = SkyHanniMod.feature.garden.anitaShop private var levelPrice = emptyMap() @SubscribeEvent @@ -79,4 +80,9 @@ class AnitaExtraFarmingFortune { levelPrice = map } } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent){ + event.move(3,"garden.extraFarmingFortune", "garden.anitaShop.extraFarmingFortune") + } } 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 2c545983c..db3803c09 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,7 @@ 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 import at.hannibal2.skyhanni.events.CropMilestoneUpdateEvent @@ -22,7 +23,7 @@ class GardenCropMilestoneInventory { @SubscribeEvent fun onCropMilestoneUpdate(event: CropMilestoneUpdateEvent) { - if (!config.numberAverageCropMilestone) return + if (!config.number.averageCropMilestone) return val tiers = mutableListOf() for (cropType in CropType.entries) { @@ -53,7 +54,7 @@ class GardenCropMilestoneInventory { @SubscribeEvent fun onItemTooltipLow(event: ItemTooltipEvent) { if (!LorenzUtils.inSkyBlock) return - if (!config.cropMilestoneTotalProgress) return + if (!config.tooltipTweak.cropMilestoneTotalProgress) return val itemStack = event.itemStack ?: return val crop = GardenCropMilestones.getCropTypeByLore(itemStack) ?: return @@ -74,4 +75,10 @@ class GardenCropMilestoneInventory { event.toolTip.add(index, "$progressBar §e${counter.addSeparators()}§6/§e${NumberUtil.format(maxCounter)}") event.toolTip.add(index, "§7Progress to Tier $maxTier: §e$percentageFormat") } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent){ + event.move(3,"garden.numberAverageCropMilestone", "garden.number.averageCropMilestone") + event.move(3, "garden.cropMilestoneTotalProgress", "garden.tooltipTweak.cropMilestoneTotalProgress") + } } \ No newline at end of file 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 c62b0c84d..87b496912 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,7 @@ package at.hannibal2.skyhanni.features.garden.inventory import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.model.ComposterUpgrade import at.hannibal2.skyhanni.events.RenderItemTipEvent import at.hannibal2.skyhanni.features.garden.GardenAPI @@ -12,7 +13,7 @@ import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class GardenInventoryNumbers { - private val config get() = SkyHanniMod.feature.garden + private val config get() = SkyHanniMod.feature.garden.number private var patternTierProgress = "§7Progress to Tier (?.*): §e(?:.*)".toPattern() private var patternUpgradeTier = "§7Current Tier: §[ea](?.*)§7/§a.*".toPattern() @@ -22,7 +23,7 @@ class GardenInventoryNumbers { if (!GardenAPI.inGarden()) return if (InventoryUtils.openInventoryName() == "Crop Milestones") { - if (!config.numberCropMilestone) return + if (!config.cropMilestone) return event.stack.getLore() .map { patternTierProgress.matcher(it) } @@ -32,7 +33,7 @@ class GardenInventoryNumbers { } if (InventoryUtils.openInventoryName() == "Crop Upgrades") { - if (!config.numberCropUpgrades) return + if (!config.cropUpgrades) return event.stack.getLore() .map { patternUpgradeTier.matcher(it) } @@ -42,7 +43,7 @@ class GardenInventoryNumbers { } if (InventoryUtils.openInventoryName() == "Composter Upgrades") { - if (!config.numberComposterUpgrades) return + if (!config.composterUpgrades) return event.stack.name?.let { ComposterUpgrade.regex.matchMatcher(it) { @@ -52,4 +53,12 @@ class GardenInventoryNumbers { } } } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent){ + event.move(3,"garden.numberCropMilestone", "garden.number.cropMilestone") + event.move(3,"garden.numberCropUpgrades", "garden.number.cropUpgrades") + event.move(3,"garden.numberComposterUpgrades", "garden.number.composterUpgrades") + } + } \ No newline at end of file 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 fbcbdc131..b9d73689c 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,7 @@ 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 import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent @@ -20,7 +21,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class SkyMartCopperPrice { private val pattern = "§c(?.*) Copper".toPattern() private var display = emptyList>() - private val config get() = SkyHanniMod.feature.garden + private val config get() = SkyHanniMod.feature.garden.skyMart companion object { var inInventory = false @@ -46,7 +47,7 @@ class SkyMartCopperPrice { val amountFormat = NumberUtil.format(amount) val name = stack.nameWithEnchantment!! - val advancedStats = if (config.skyMartCopperPriceAdvancedStats) { + val advancedStats = if (config.copperPriceAdvancedStats) { " §7(§6$priceFormat §7/ §c$amountFormat Copper§7)" } else "" val pair = Pair("$name§f:", "§6§l$perFormat$advancedStats") @@ -69,7 +70,7 @@ class SkyMartCopperPrice { @SubscribeEvent fun onBackgroundDraw(event: GuiRenderEvent.ChestGuiOverlayRenderEvent) { if (inInventory) { - config.skyMartCopperPricePos.renderStringsAndItems( + config.copperPricePos.renderStringsAndItems( display, extraSpace = 5, itemScale = 1.7, @@ -78,5 +79,12 @@ class SkyMartCopperPrice { } } - private fun isEnabled() = GardenAPI.inGarden() && config.skyMartCopperPrice + private fun isEnabled() = GardenAPI.inGarden() && config.copperPrice + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent){ + event.move(3, "garden.skyMartCopperPrice", "garden.skyMart.copperPrice") + event.move(3, "garden.skyMartCopperPriceAdvancedStats", "garden.skyMart.copperPriceAdvancedStats") + event.move(3, "garden.skyMartCopperPricePos", "garden.skyMart.copperPricePos") + } } 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 84bbf4a4b..49a1e8c56 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 @@ -35,7 +35,7 @@ class GardenVisitorColorNames { var visitorItems = mapOf>() fun getColoredName(name: String): String { - if (!SkyHanniMod.feature.garden.visitorColoredName) return name + if (!SkyHanniMod.feature.garden.visitors.coloredName) return name val cleanName = name.removeColor() val color = visitorColor[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 7391bbdd6..788023d1e 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,7 @@ 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 import at.hannibal2.skyhanni.events.ConfigLoadEvent @@ -22,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.visitorDropsStatistics + private val config get() = SkyHanniMod.feature.garden.visitors.dropsStatistics private var display = emptyList>() private var acceptedVisitors = 0 @@ -226,7 +227,17 @@ object GardenVisitorDropStatistics { if (!GardenAPI.inGarden()) return if (GardenAPI.hideExtraGuis()) return if (config.onlyOnBarn && !GardenAPI.onBarnPlot) return - config.visitorDropPos.renderStringsAndItems(display, posLabel = "Visitor Stats") + config.pos.renderStringsAndItems(display, posLabel = "Visitor Stats") + } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent){ + event.move(3, "garden.visitorDropsStatistics.enabled", "garden.visitors.dropsStatistics.enabled") + event.move(3, "garden.visitorDropsStatistics.textFormat", "garden.visitors.dropsStatistics.textFormat") + event.move(3, "garden.visitorDropsStatistics.displayNumbersFirst", "garden.visitors.dropsStatistics.displayNumbersFirst") + event.move(3, "garden.visitorDropsStatistics.displayIcons", "garden.visitors.dropsStatistics.displayIcons") + event.move(3, "garden.visitorDropsStatistics.onlyOnBarn", "garden.visitors.dropsStatistics.onlyOnBarn") + event.move(3, "garden.visitorDropsStatistics.visitorDropPos", "garden.visitors.dropsStatistics.pos") } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt index a276348e8..8c7ceba3a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.garden.visitor import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.CheckRenderEntityEvent import at.hannibal2.skyhanni.events.GuiRenderEvent @@ -71,7 +72,7 @@ import org.lwjgl.input.Keyboard import kotlin.math.round import kotlin.time.Duration.Companion.seconds -private val config get() = SkyHanniMod.feature.garden +private val config get() = SkyHanniMod.feature.garden.visitors class GardenVisitorFeatures { private var visitors = mapOf() @@ -114,7 +115,7 @@ class GardenVisitorFeatures { inVisitorInventory = true - if (!config.visitorNeedsDisplay && config.visitorHighlightStatus == 3) return + if (!config.needs.display && config.highlightStatus == 3) return var name = npcItem.name ?: return if (name.length == name.removeColor().length + 4) { @@ -191,7 +192,7 @@ class GardenVisitorFeatures { private fun drawDisplay(): List> { val newDisplay = mutableListOf>() - if (!config.visitorNeedsDisplay) return newDisplay + if (!config.needs.display) return newDisplay val requiredItems = mutableMapOf() val newVisitors = mutableListOf() @@ -226,7 +227,7 @@ class GardenVisitorFeatures { } }) { GardenAPI.inGarden() && !NEUItems.neuHasFocus() }) - if (config.visitorNeedsShowPrice) { + if (config.needs.showPrice) { val price = internalName.getPrice() * amount totalPrice += price val format = NumberUtil.format(price) @@ -253,7 +254,7 @@ class GardenVisitorFeatures { val list = mutableListOf() list.add(" §7- $displayName") - if (config.visitorItemPreview) { + if (config.needs.itemPreview) { val items = GardenVisitorColorNames.visitorItems[visitor.removeColor()] if (items == null) { val text = "Visitor '$visitor' has no items in repo!" @@ -304,14 +305,14 @@ class GardenVisitorFeatures { if (event.slot.stack?.name != "§cRefuse Offer") return visitor.hasReward()?.let { - if (config.visitorRewardWarning.preventRefusing) { - if (config.visitorRewardWarning.bypassKey.isKeyHeld()) { + if (config.rewardWarning.preventRefusing) { + if (config.rewardWarning.bypassKey.isKeyHeld()) { LorenzUtils.chat("§e[SkyHanni] §cBypassed blocking refusal of visitor ${visitor.visitorName} §7(${it.displayName}§7)") return } event.isCanceled = true LorenzUtils.chat("§e[SkyHanni] §cBlocked refusing visitor ${visitor.visitorName} §7(${it.displayName}§7)") - if (config.visitorRewardWarning.bypassKey == Keyboard.KEY_NONE) { + if (config.rewardWarning.bypassKey == Keyboard.KEY_NONE) { LorenzUtils.clickableChat( "§eIf you want to deny this visitor, set a keybind in §e/sh bypass", "sh bypass" @@ -348,7 +349,7 @@ class GardenVisitorFeatures { fun onCheckRender(event: CheckRenderEntityEvent<*>) { if (!GardenAPI.inGarden()) return if (!GardenAPI.onBarnPlot) return - if (config.visitorHighlightStatus != 1 && config.visitorHighlightStatus != 2) return + if (config.highlightStatus != 1 && config.highlightStatus != 2) return val entity = event.entity if (entity is EntityArmorStand && entity.name == "§e§lCLICK") { @@ -360,7 +361,7 @@ class GardenVisitorFeatures { fun onRenderWorld(event: LorenzRenderWorldEvent) { if (!GardenAPI.inGarden()) return if (!GardenAPI.onBarnPlot) return - if (config.visitorHighlightStatus != 1 && config.visitorHighlightStatus != 2) return + if (config.highlightStatus != 1 && config.highlightStatus != 2) return for (visitor in visitors.values) { visitor.getNameTagEntity()?.let { @@ -368,7 +369,7 @@ class GardenVisitorFeatures { if (it.distanceToPlayer() < 15) { val text = visitor.status.displayName event.drawString(location.add(0.0, 2.23, 0.0), text) - if (config.visitorRewardWarning.showOverName) { + if (config.rewardWarning.showOverName) { visitor.hasReward()?.let { reward -> val name = reward.displayName @@ -433,7 +434,7 @@ class GardenVisitorFeatures { visitor.allRewards = foundRewards if (wasEmpty) { visitor.hasReward()?.let { reward -> - if (config.visitorRewardWarning.notifyInChat) { + if (config.rewardWarning.notifyInChat) { LorenzUtils.chat("§e[SkyHanni] Found Visitor Reward ${reward.displayName}§e!") } } @@ -445,7 +446,7 @@ class GardenVisitorFeatures { var offset = 0 for ((i, formattedLine) in finalList.toMutableList().withIndex()) { val index = i + offset - if (config.visitorExperiencePrice) { + if (config.inventory.experiencePrice) { gardenExperiencePattern.matchMatcher(formattedLine) { val gardenExp = group("amount").replace(",", "").toInt() val pricePerCopper = NumberUtil.format((totalPrice / gardenExp).toInt()) @@ -458,8 +459,8 @@ class GardenVisitorFeatures { val pricePerCopper = NumberUtil.format((totalPrice / copper).toInt()) val timePerCopper = TimeUtils.formatDuration((timeRequired / copper) * 1000) var copperLine = formattedLine - if (config.visitorCopperPrice) copperLine += " §7(§6$pricePerCopper §7per)" - if (config.visitorCopperTime) { + if (config.inventory.copperPrice) copperLine += " §7(§6$pricePerCopper §7per)" + if (config.inventory.copperTime) { copperLine += if (timeRequired != -1L) " §7(§b$timePerCopper §7per)" else " §7(§cno speed data!§7)" } finalList.set(index, copperLine) @@ -473,7 +474,7 @@ class GardenVisitorFeatures { val internalName = NEUItems.getInternalNameOrNull(itemName)?.replace("◆_", "") ?: continue val price = internalName.getPrice() * amount - if (config.visitorShowPrice) { + if (config.inventory.showPrice) { val format = NumberUtil.format(price) finalList[index] = "$formattedLine §7(§6$format§7)" } @@ -491,7 +492,7 @@ class GardenVisitorFeatures { val duration = TimeUtils.formatDuration(timeRequired * 1000) "in §b$duration" } ?: "§cno speed data!" - if (config.visitorExactAmountAndTime) { + if (config.inventory.exactAmountAndTime) { finalList.add(index + 1, "§7- $formattedName($formattedSpeed§7)") offset++ } @@ -502,10 +503,10 @@ class GardenVisitorFeatures { @SubscribeEvent fun onTick(event: LorenzTickEvent) { if (!GardenAPI.inGarden()) return - if (!config.visitorNeedsDisplay && config.visitorHighlightStatus == 3) return + if (!config.needs.display && config.highlightStatus == 3) return if (!event.isMod(10)) return - if (GardenAPI.onBarnPlot && config.visitorHighlightStatus != 3) { + if (GardenAPI.onBarnPlot && config.highlightStatus != 3) { checkVisitorsReady() } } @@ -582,10 +583,10 @@ class GardenVisitorFeatures { logger.log("New visitor detected: '$name'") - if (config.visitorNotificationTitle && System.currentTimeMillis() > LorenzUtils.lastWorldSwitch + 2_000) { + if (config.notificationTitle && System.currentTimeMillis() > LorenzUtils.lastWorldSwitch + 2_000) { LorenzUtils.sendTitle("§eNew Visitor", 5.seconds) } - if (config.visitorNotificationChat) { + if (config.notificationChat) { val displayName = GardenVisitorColorNames.getColoredName(name) LorenzUtils.chat("§e[SkyHanni] $displayName §eis visiting your garden!") } @@ -613,7 +614,7 @@ class GardenVisitorFeatures { @SubscribeEvent fun onTabListText(event: TabListLineRenderEvent) { if (!GardenAPI.inGarden()) return - if (!SkyHanniMod.feature.garden.visitorColoredName) return + if (!config.coloredName) return val text = event.text val replace = fromHypixelName(text) val visitor = visitors[replace] @@ -624,11 +625,11 @@ class GardenVisitorFeatures { @SubscribeEvent fun onChatMessage(event: LorenzChatEvent) { - if (config.visitorHypixelArrivedMessage && newVisitorArrivedMessage.matcher(event.message).matches()) { + if (config.hypixelArrivedMessage && newVisitorArrivedMessage.matcher(event.message).matches()) { event.blockedReason = "new_visitor_arrived" } - if (GardenAPI.inGarden() && config.visitorHideChat && hideVisitorMessage(event.message)) { + if (GardenAPI.inGarden() && config.hideChat && hideVisitorMessage(event.message)) { event.blockedReason = "garden_visitor_message" } } @@ -663,13 +664,13 @@ class GardenVisitorFeatures { } } - if ((config.visitorHighlightStatus == 0 || config.visitorHighlightStatus == 2) && entity is EntityLivingBase) { + if ((config.highlightStatus == 0 || config.highlightStatus == 2) && entity is EntityLivingBase) { val color = visitor.status.color if (color != -1) { RenderLivingEntityHelper.setEntityColor( entity, color - ) { config.visitorHighlightStatus == 0 || config.visitorHighlightStatus == 2 } + ) { config.highlightStatus == 0 || config.highlightStatus == 2 } } // Haven't gotten either of the known effected visitors (Vex and Leo) so can't test for sure if (color == -1 || !GardenAPI.inGarden()) RenderLivingEntityHelper.removeEntityColor(entity) @@ -748,42 +749,42 @@ class GardenVisitorFeatures { @SubscribeEvent fun onRenderInSigns(event: DrawScreenEvent.Post) { if (!GardenAPI.inGarden()) return - if (!config.visitorNeedsDisplay) return + if (!config.needs.display) return val gui = event.gui if (gui !is GuiEditSign) return - if (config.visitorNeedsOnlyWhenClose && !GardenAPI.onBarnPlot) return + if (config.needs.onlyWhenClose && !GardenAPI.onBarnPlot) return if (!GardenAPI.hideExtraGuis()) { - config.visitorNeedsPos.renderStringsAndItems(display, posLabel = "Visitor Items Needed") + config.needs.pos.renderStringsAndItems(display, posLabel = "Visitor Items Needed") } } @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent) { - if (!config.visitorNeedsDisplay) return + if (!config.needs.display) return if (showGui()) { - config.visitorNeedsPos.renderStringsAndItems(display, posLabel = "Visitor Items Needed") + config.needs.pos.renderStringsAndItems(display, posLabel = "Visitor Items Needed") } } private fun showGui(): Boolean { - if (config.visitorNeedsInBazaarAlley && LorenzUtils.skyBlockIsland == IslandType.HUB && LorenzUtils.skyBlockArea == "Bazaar Alley") { + if (config.needs.inBazaarAlley && LorenzUtils.skyBlockIsland == IslandType.HUB && LorenzUtils.skyBlockArea == "Bazaar Alley") { return true } if (GardenAPI.hideExtraGuis()) return false if (GardenAPI.inGarden()) { if (GardenAPI.onBarnPlot) return true - if (!config.visitorNeedsOnlyWhenClose) return true + if (!config.needs.onlyWhenClose) return true } return false } @SubscribeEvent(priority = EventPriority.HIGH) fun onRenderLiving(event: RenderLivingEvent.Specials.Pre) { - if (!SkyHanniMod.feature.garden.visitorColoredName) return + if (!config.coloredName) return val entity = event.entity val entityId = entity.entityId for (visitor in visitors.values) { @@ -812,7 +813,7 @@ class GardenVisitorFeatures { for (internalName in allRewards) { val reward = VisitorReward.getByInternalName(internalName) ?: continue - if (config.visitorRewardWarning.drops.contains(reward.ordinal)) { + if (config.rewardWarning.drops.contains(reward.ordinal)) { return reward } } @@ -828,5 +829,32 @@ class GardenVisitorFeatures { ACCEPTED("§7Accepted", LorenzColor.DARK_GRAY.toColor().withAlpha(80)), REFUSED("§cRefused", LorenzColor.RED.toColor().withAlpha(60)), } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(3, "garden.visitorNeedsDisplay", "garden.visitors.needs.display") + event.move(3, "garden.visitorNeedsPos", "garden.visitors.needs.pos") + event.move(3, "garden.visitorNeedsOnlyWhenClose", "garden.visitors.needs.onlyWhenClose") + event.move(3, "garden.visitorNeedsInBazaarAlley", "garden.visitors.needs.inBazaarAlley") + event.move(3,"garden.visitorNeedsShowPrice", "garden.visitors.needs.showPrice") + event.move(3,"garden.visitorItemPreview", "garden.visitors.needs.itemPreview") + event.move(3, "garden.visitorShowPrice", "garden.visitors.inventory.showPrice") + event.move(3, "garden.visitorExactAmountAndTime", "garden.visitors.inventory.exactAmountAndTime") + event.move(3, "garden.visitorCopperPrice", "garden.visitors.inventory.copperPrice") + event.move(3, "garden.visitorCopperTime", "garden.visitors.inventory.copperTime") + event.move(3, "garden.visitorExperiencePrice", "garden.visitors.inventory.experiencePrice") + event.move(3,"garden.visitorRewardWarning.notifyInChat","garden.visitors.rewardWarning.notifyInChat") + event.move(3,"garden.visitorRewardWarning.showOverName","garden.visitors.rewardWarning.showOverName") + event.move(3,"garden.visitorRewardWarning.preventRefusing","garden.visitors.rewardWarning.preventRefusing") + event.move(3,"garden.visitorRewardWarning.bypassKey","garden.visitors.rewardWarning.bypassKey") + event.move(3,"garden.visitorRewardWarning.drops","garden.visitors.rewardWarning.drops") + event.move(3, "garden.visitorNotificationChat", "garden.visitors.notificationChat") + event.move(3, "garden.visitorNotificationTitle", "garden.visitors.notificationTitle") + event.move(3, "garden.visitorHighlightStatus", "garden.visitors.highlightStatus") + event.move(3, "garden.visitorColoredName", "garden.visitors.coloredName") + event.move(3,"garden.visitorHypixelArrivedMessage","garden.visitors.hypixelArrivedMessage") + event.move(3, "garden.visitorHideChat", "garden.visitors.hideChat") + } + } 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 2bdbdb091..dedd034fa 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,7 @@ 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 import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent @@ -20,7 +21,7 @@ import kotlin.math.roundToLong import kotlin.time.Duration.Companion.seconds class GardenVisitorTimer { - private val config get() = SkyHanniMod.feature.garden + private val config get() = SkyHanniMod.feature.garden.visitors.timer private val patternNextVisitor = " Next Visitor: §r§b(?