From 6114bfe2dfca96e48d19df2725b2912a165bcd58 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 17 Sep 2023 13:14:52 +0200 Subject: migrate Ender Node Tracker config into combat --- .../skyhanni/config/features/CombatConfig.java | 57 ++++++++++++++++++++ .../skyhanni/config/features/EventConfig.java | 3 +- .../skyhanni/config/features/MiscConfig.java | 60 ---------------------- .../skyhanni/features/misc/EnderNodeTracker.kt | 8 ++- 4 files changed, 65 insertions(+), 63 deletions(-) (limited to 'src/main/java') 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 61ceee900..ad4240504 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/CombatConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/CombatConfig.java @@ -6,6 +6,7 @@ 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.*; +import io.github.moulberry.moulconfig.observer.Property; import java.util.ArrayList; import java.util.Arrays; @@ -639,6 +640,62 @@ public class CombatConfig { public Position position = new Position(100, 100, false, true); } + @Expose + @ConfigOption(name = "Ender Node Tracker", desc = "") + @Accordion + public EnderNodeConfig enderNodeTracker = new EnderNodeConfig(); + + public static class EnderNodeConfig { + @Expose + @ConfigOption( + name = "Enabled", + desc = "Tracks all of your drops from mining Ender Nodes in the End.\n" + + "Also tracks drops from Endermen." + ) + @ConfigEditorBoolean + @FeatureToggle + public boolean enabled = false; + + @Expose + @ConfigOption( + name = "Text Format", + desc = "Drag text to change the appearance of the overlay." + ) + @ConfigEditorDraggableList( + exampleText = { + "§5§lEnder Node Tracker", + "§d1,303 Ender Nodes Mined", + "§615.3M Coins Made", + " ", + "§b123 §cEndermite Nest", + "§b832 §aEnchanted End Stone", + "§b230 §aEnchanted Obsidian", + "§b1630 §aEnchanted Ender Pearl", + "§b85 §aGrand Experience Bottle", + "§b4 §9Titanic Experience Bottle", + "§b15 §9End Stone Shulker", + "§b53 §9End Stone Geode", + "§b10 §d◆ Magical Rune I", + "§b24 §5Ender Gauntlet", + "§b357 §5Mite Gel", + "§b2 §cShrimp The Fish", + " ", + "§b200 §5Ender Armor", + "§b24 §5Ender Helmet", + "§b24 §5Ender Chestplate", + "§b24 §5Ender Leggings", + "§b24 §5Ender Boots", + "§b24 §5Ender Necklace", + "§f10§7-§a8§7-§93§7-§52§7-§61 §fEnderman Pet", + " " + } + ) + public Property> textFormat = Property.of(new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 14, 15, 16, 17, 23))); + + @Expose + public Position position = new Position(10, 80, false, true); + } + @Expose @ConfigOption(name = "Hide Damage Splash", desc = "Hide all damage splashes anywhere in SkyBlock.") @ConfigEditorBoolean 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 79224ce80..bbeae513e 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/EventConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/EventConfig.java @@ -329,5 +329,4 @@ public class EventConfig { public boolean enableActiveAlert = false; } - -} +} \ No newline at end of file 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 d29b14f9b..e717003df 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java @@ -7,10 +7,6 @@ import io.github.moulberry.moulconfig.annotations.*; import io.github.moulberry.moulconfig.observer.Property; import org.lwjgl.input.Keyboard; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - public class MiscConfig { @Expose @@ -392,62 +388,6 @@ public class MiscConfig { public Position pos = new Position(-178, 143, false, true); } - @Expose - @ConfigOption(name = "Ender Node Tracker", desc = "") - @Accordion - public EnderNodeTracker enderNodeTracker = new EnderNodeTracker(); - - public static class EnderNodeTracker { - @Expose - @ConfigOption( - name = "Enabled", - desc = "Tracks all of your drops from mining Ender Nodes in the End.\n" + - "Also tracks drops from Endermen." - ) - @ConfigEditorBoolean - @FeatureToggle - public boolean enabled = false; - - @Expose - @ConfigOption( - name = "Text Format", - desc = "Drag text to change the appearance of the overlay." - ) - @ConfigEditorDraggableList( - exampleText = { - "§5§lEnder Node Tracker", - "§d1,303 Ender Nodes Mined", - "§615.3M Coins Made", - " ", - "§b123 §cEndermite Nest", - "§b832 §aEnchanted End Stone", - "§b230 §aEnchanted Obsidian", - "§b1630 §aEnchanted Ender Pearl", - "§b85 §aGrand Experience Bottle", - "§b4 §9Titanic Experience Bottle", - "§b15 §9End Stone Shulker", - "§b53 §9End Stone Geode", - "§b10 §d◆ Magical Rune I", - "§b24 §5Ender Gauntlet", - "§b357 §5Mite Gel", - "§b2 §cShrimp The Fish", - " ", - "§b200 §5Ender Armor", - "§b24 §5Ender Helmet", - "§b24 §5Ender Chestplate", - "§b24 §5Ender Leggings", - "§b24 §5Ender Boots", - "§b24 §5Ender Necklace", - "§f10§7-§a8§7-§93§7-§52§7-§61 §fEnderman Pet", - " " - } - ) - public Property> textFormat = Property.of(new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 14, 15, 16, 17, 23))); - - @Expose - public Position position = new Position(10, 80, false, true); - } - @Expose @ConfigOption(name = "Cosmetic", desc = "") @Accordion diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/EnderNodeTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/EnderNodeTracker.kt index 133e12ab4..c6fbf9e70 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/EnderNodeTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/EnderNodeTracker.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.Storage import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.ProfileStorageData @@ -20,7 +21,7 @@ import net.minecraft.client.Minecraft import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class EnderNodeTracker { - private val config get() = SkyHanniMod.feature.misc.enderNodeTracker + private val config get() = SkyHanniMod.feature.combat.enderNodeTracker private val storage get() = ProfileStorageData.profileSpecific?.enderNodeTracker private var totalEnderArmor = 0 @@ -140,6 +141,11 @@ class EnderNodeTracker { update() } + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(2, "misc.enderNodeTracker", "combat.enderNodeTracker") + } + private fun calculateProfit(storage: Storage.ProfileSpecific.EnderNodeTracker): Map { if (!ProfileStorageData.loaded) return emptyMap() -- cgit