diff options
Diffstat (limited to 'src/main/java/at/hannibal2')
7 files changed, 132 insertions, 107 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/Features.java b/src/main/java/at/hannibal2/skyhanni/config/Features.java index 1acc0a393..a680efab7 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/Features.java +++ b/src/main/java/at/hannibal2/skyhanni/config/Features.java @@ -92,6 +92,10 @@ public class Features extends Config { public DianaConfig diana = new DianaConfig(); @Expose + @Category(name = "Mining", desc = "Features that help you break blocks.") + public MiningConfig mining = new MiningConfig(); + + @Expose @Category(name = "Commands", desc = "Enable or disable commands.") public CommandsConfig commands = new CommandsConfig(); diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/MiningConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/MiningConfig.java new file mode 100644 index 000000000..c93068248 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/MiningConfig.java @@ -0,0 +1,111 @@ +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.Accordion; +import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; +import io.github.moulberry.moulconfig.annotations.ConfigEditorDraggableList; +import io.github.moulberry.moulconfig.annotations.ConfigOption; +import io.github.moulberry.moulconfig.observer.Property; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class MiningConfig { + + @Expose + @ConfigOption(name = "Powder Tracker", desc = "") + @Accordion + public PowderTrackerConfig powderTracker = new PowderTrackerConfig(); + + public static class PowderTrackerConfig { + + @Expose + @ConfigOption(name = "Enabled", desc = "Enable the Powder Tracker overlay for mining.") + @ConfigEditorBoolean + @FeatureToggle + public boolean enabled = false; + + @Expose + @ConfigOption(name = "Only when Grinding", desc = "Only show the overlay when powder grinding.") + @ConfigEditorBoolean + public boolean onlyWhenPowderGrinding = false; + + @Expose + @ConfigOption(name = "Great Explorer", desc = "Enable this if your Great Explorer perk is maxed.") + @ConfigEditorBoolean + public boolean greatExplorerMaxed = false; + + @Expose + @ConfigOption( + name = "Text Format", + desc = "Drag text to change the appearance of the overlay." + ) + @ConfigEditorDraggableList( + exampleText = { + "§b§lPowder Tracker", + "§7Display Mode: §a[Total] §e[This Session]", + "§d852 Total chests Picked §7(950/h)", + "§bx2 Powder: §aActive!", + "§b250,420 §aMithril Powder §7(350,000/h)", + "§b250,420 §dGemstone Powder §7(350,000/h)", + "", + "§50§7-§90§7-§a0§f-0 §cRuby Gemstone", + "§50§7-§90§7-§a0§f-0 §bSapphire Gemstone", + "§50§7-§90§7-§a0§f-0 §6Amber Gemstone", + "§50§7-§90§7-§a0§f-0 §5Amethyst Gemstone", + "§50§7-§90§7-§a0§f-0 §aJade Gemstone", + "§50§7-§90§7-§a0§f-0 §eTopaz Gemstone", + + "§b14 §9FTX 3070", + "§b14 §9Electron Transmitter", + "§b14 §9Robotron Reflector", + "§b14 §9Superlite Motor", + "§b14 §9Control Switch", + "§b14 §9Synthetic Heart", + "§b14 §9Total Robot Parts", + + "§90§7-§a0§7-§c0§f-§e0§f-§30 §fGoblin Egg", + + "§b12 §aWishing Compass", + + "§b320 §aSludge Juice", + "§b2 §9Ascension Rope", + "§b6 §5Treasurite", + "§b4 §6Jungle Heart", + "§b1 §5Pickonimbus 2000", + "§b14 §aYoggie", + "§b9 §fPrehistoric Egg", + "§b25 §aOil Barrel" + } + ) + public Property<List<Integer>> textFormat = Property.of(new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18))); + + @Expose + public Position position = new Position(-274, 0, false, true); + + } + + @Expose + @ConfigOption(name = "Highlight Commission Mobs", desc = "Highlight Mobs that are part of active commissions.") + @ConfigEditorBoolean + @FeatureToggle + public boolean highlightCommissionMobs = false; + + @Expose + @ConfigOption(name = "King Talisman Helper", desc = "Show kings you have not talked to yet, and when the next missing king will appear.") + @ConfigEditorBoolean + @FeatureToggle + public boolean kingTalismanHelper = false; + + @Expose + public Position kingTalismanHelperPos = new Position(-400, 220, false, true); + + @Expose + @ConfigOption(name = "Names in Core", desc = "Show the names of the 4 areas while in the center of Crystal Hollows.") + @ConfigEditorBoolean + @FeatureToggle + public boolean crystalHollowsNamesInCore = false; +} 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 5e089dfd8..b4e405526 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java @@ -755,108 +755,6 @@ public class MiscConfig { } @Expose - @ConfigOption(name = "Mining", desc = "") - @Accordion - public MiningConfig mining = new MiningConfig(); - - public static class MiningConfig { - - @Expose - @ConfigOption(name = "Highlight Commission Mobs", desc = "Highlight Mobs that are part of active commissions.") - @ConfigEditorBoolean - @FeatureToggle - public boolean highlightCommissionMobs = false; - - @Expose - @ConfigOption(name = "King Talisman Helper", desc = "Show kings you have not talked to yet, and when the next missing king will appear.") - @ConfigEditorBoolean - @FeatureToggle - public boolean kingTalismanHelper = false; - - @Expose - public Position kingTalismanHelperPos = new Position(-400, 220, false, true); - - @Expose - @ConfigOption(name = "Names in Core", desc = "Show the names of the 4 areas while in the center of Crystal Hollows.") - @ConfigEditorBoolean - @FeatureToggle - public boolean crystalHollowsNamesInCore = false; - } - - @Expose - @ConfigOption(name = "Powder Tracker", desc = "") - @Accordion - public PowderTrackerConfig powderTrackerConfig = new PowderTrackerConfig(); - - public static class PowderTrackerConfig { - - @Expose - @ConfigOption(name = "Enabled", desc = "Enable the Powder Tracker overlay for mining.") - @ConfigEditorBoolean - @FeatureToggle - public boolean enabled = false; - - @Expose - @ConfigOption(name = "Only when Grinding", desc = "Only show the overlay when powder grinding.") - @ConfigEditorBoolean - public boolean onlyWhenPowderGrinding = false; - - @Expose - @ConfigOption(name = "Great Explorer", desc = "Enable this if your Great Explorer perk is maxed.") - @ConfigEditorBoolean - public boolean greatExplorerMaxed = false; - - @Expose - @ConfigOption( - name = "Text Format", - desc = "Drag text to change the appearance of the overlay." - ) - @ConfigEditorDraggableList( - exampleText = { - "§b§lPowder Tracker", - "§7Display Mode: §a[Total] §e[This Session]", - "§d852 Total chests Picked §7(950/h)", - "§bx2 Powder: §aActive!", - "§b250,420 §aMithril Powder §7(350,000/h)", - "§b250,420 §dGemstone Powder §7(350,000/h)", - "", - "§50§7-§90§7-§a0§f-0 §cRuby Gemstone", - "§50§7-§90§7-§a0§f-0 §bSapphire Gemstone", - "§50§7-§90§7-§a0§f-0 §6Amber Gemstone", - "§50§7-§90§7-§a0§f-0 §5Amethyst Gemstone", - "§50§7-§90§7-§a0§f-0 §aJade Gemstone", - "§50§7-§90§7-§a0§f-0 §eTopaz Gemstone", - - "§b14 §9FTX 3070", - "§b14 §9Electron Transmitter", - "§b14 §9Robotron Reflector", - "§b14 §9Superlite Motor", - "§b14 §9Control Switch", - "§b14 §9Synthetic Heart", - "§b14 §9Total Robot Parts", - - "§90§7-§a0§7-§c0§f-§e0§f-§30 §fGoblin Egg", - - "§b12 §aWishing Compass", - - "§b320 §aSludge Juice", - "§b2 §9Ascension Rope", - "§b6 §5Treasurite", - "§b4 §6Jungle Heart", - "§b1 §5Pickonimbus 2000", - "§b14 §aYoggie", - "§b9 §fPrehistoric Egg", - "§b25 §aOil Barrel" - } - ) - public Property<List<Integer>> textFormat = Property.of(new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18))); - - @Expose - public Position position = new Position(-274, 0, false, true); - - } - - @Expose @ConfigOption(name = "Cosmetic", desc = "") @Accordion public CosmeticConfig cosmeticConfig = new CosmeticConfig(); diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt index 46e96f0c5..70d105a26 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.mining import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.EntityMaxHealthUpdateEvent import at.hannibal2.skyhanni.events.LorenzTickEvent @@ -19,7 +20,7 @@ import net.minecraft.entity.monster.EntitySlime import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class HighlightMiningCommissionMobs { - private val config get() = SkyHanniMod.feature.misc.mining + private val config get() = SkyHanniMod.feature.mining private var active = listOf<MobType>() enum class MobType(val commissionName: String, val isMob: (EntityLivingBase) -> Boolean) { @@ -83,6 +84,11 @@ class HighlightMiningCommissionMobs { } } + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(2, "misc.mining", "mining") + } + fun isEnabled() = config.highlightCommissionMobs && (IslandType.DWARVEN_MINES.isInIsland() || IslandType.CRYSTAL_HOLLOWS.isInIsland()) } diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/KingTalismanHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/KingTalismanHelper.kt index 3031e021e..0bc239c34 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/KingTalismanHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/KingTalismanHelper.kt @@ -19,7 +19,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.util.* class KingTalismanHelper { - private val config get() = SkyHanniMod.feature.misc.mining + private val config get() = SkyHanniMod.feature.mining private val kingLocation = LorenzVec(129.6, 196.5, 194.1) private val kingCircles = listOf( diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/crystalhollows/CrystalHollowsNamesInCore.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/crystalhollows/CrystalHollowsNamesInCore.kt index f8b8618d7..8a2e67741 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/crystalhollows/CrystalHollowsNamesInCore.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/crystalhollows/CrystalHollowsNamesInCore.kt @@ -12,8 +12,8 @@ import net.minecraftforge.client.event.RenderWorldLastEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class CrystalHollowsNamesInCore { - val config get() = SkyHanniMod.feature.misc.mining - val coreLocations = mapOf( + val config get() = SkyHanniMod.feature.mining + private val coreLocations = mapOf( LorenzVec(550, 116, 550) to "§8Precursor City", LorenzVec(552, 116, 474) to "§bMithril Deposits", LorenzVec(477, 116, 476) to "§aJungle", diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/powdertracker/PowderTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/powdertracker/PowderTracker.kt index ce3d4a1c1..e16470b9b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/powdertracker/PowderTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/powdertracker/PowderTracker.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.misc.powdertracker 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 @@ -21,7 +22,7 @@ import kotlin.concurrent.fixedRateTimer class PowderTracker { - private val config get() = SkyHanniMod.feature.misc.powderTrackerConfig + private val config get() = SkyHanniMod.feature.mining.powderTracker private var display = emptyList<List<Any>>() private val picked = "§6You have successfully picked the lock on this chest!".toPattern() private val uncovered = "§aYou uncovered a treasure chest!".toPattern() @@ -153,6 +154,11 @@ class PowderTracker { saveAndUpdate() } + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(2, "misc.powderTrackerConfig", "mining.powderTracker") + } + private fun saveAndUpdate() { calculateGemstone() calculateMithril() |