diff options
Diffstat (limited to 'src/main/java/at')
18 files changed, 261 insertions, 243 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt index 8343a2a48..50559af9d 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt @@ -21,7 +21,6 @@ import at.hannibal2.skyhanni.features.commands.WikiCommand import at.hannibal2.skyhanni.features.cosmetics.CosmeticFollowingLine import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager import at.hannibal2.skyhanni.features.dungeon.* -import at.hannibal2.skyhanni.features.event.anniversary.ActivePlayerTimer import at.hannibal2.skyhanni.features.event.diana.* import at.hannibal2.skyhanni.features.fame.AccountUpgradeReminder import at.hannibal2.skyhanni.features.fame.CityProjectFeatures @@ -151,7 +150,7 @@ class SkyHanniMod { loadModule(EntityMovementData()) loadModule(TestExportTools) loadModule(ItemClickData()) - loadModule(ActivePlayerTimer) +// loadModule(Year300RaffleEvent) loadModule(MinecraftData()) loadModule(TitleUtils()) loadModule(ItemTipHelper()) diff --git a/src/main/java/at/hannibal2/skyhanni/config/Features.java b/src/main/java/at/hannibal2/skyhanni/config/Features.java index a680efab7..2339b1925 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/Features.java +++ b/src/main/java/at/hannibal2/skyhanni/config/Features.java @@ -88,10 +88,6 @@ public class Features extends Config { public SlayerConfig slayer = new SlayerConfig(); @Expose - @Category(name = "Diana", desc = "Diana's mythological event.") - public DianaConfig diana = new DianaConfig(); - - @Expose @Category(name = "Mining", desc = "Features that help you break blocks.") public MiningConfig mining = new MiningConfig(); @@ -104,8 +100,8 @@ public class Features extends Config { public MarkedPlayerConfig markedPlayers = new MarkedPlayerConfig(); @Expose - @Category(name = "Bingo", desc = "Features for the Bingo mode.") - public BingoConfig bingo = new BingoConfig(); + @Category(name = "Events", desc = "Stuff that is not avaliable all the time.") + public EventConfig event = new EventConfig(); @Expose @Category(name = "Garden", desc = "Features on the Garden island.") diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/BingoConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/BingoConfig.java deleted file mode 100644 index 733b3a5a3..000000000 --- a/src/main/java/at/hannibal2/skyhanni/config/features/BingoConfig.java +++ /dev/null @@ -1,89 +0,0 @@ -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.ConfigOption; -import io.github.moulberry.moulconfig.observer.Property; - -public class BingoConfig { - - @Expose - @ConfigOption(name = "Bingo Card", desc = "") - @Accordion - public BingoCard bingoCard = new BingoCard(); - - public static class BingoCard { - @Expose - @ConfigOption(name = "Enable", desc = "Displays the Bingo Card.") - @ConfigEditorBoolean - @FeatureToggle - public boolean enabled = true; - @Expose - @ConfigOption(name = "Quick Toggle", desc = "Quickly toggle the Bingo Card or the step helper by sneaking with SkyBlock Menu in hand.") - @ConfigEditorBoolean - public boolean quickToggle = true; - - @Expose - @ConfigOption(name = "Bingo Steps", desc = "Show help with the next step in Bingo instead of the Bingo Card. " + - "§cThis feature is in early development. Expect bugs and missing goals.") - @ConfigEditorBoolean - public boolean stepHelper = false; - - @Expose - @ConfigOption(name = "Hide Community Goals", desc = "Hide Community Goals from the Bingo Card display.") - @ConfigEditorBoolean - public Property<Boolean> hideCommunityGoals = Property.of(false); - - @Expose - @ConfigOption( - name = "Show Guide", - desc = "Show tips and difficulty for bingo goals inside the Bingo Card inventory.\n" + - "These tips are made from inspirations and guides from the community,\n"+ - "aiming to help you to complete the bingo card." - ) - @ConfigEditorBoolean - @FeatureToggle - public boolean bingoSplashGuide = true; - - @Expose - public Position bingoCardPos = new Position(10, 10, false, true); - } - - @Expose - @ConfigOption(name = "Compact Chat Messages", desc = "") - @Accordion - public CompactChat compactChat = new CompactChat(); - - public static class CompactChat { - - @Expose - @ConfigOption(name = "Enable", desc = "Shortens chat messages about skill level ups, collection gains, " + - "new area discoveries and SkyBlock level up messages while on Bingo.") - @ConfigEditorBoolean - @FeatureToggle - public boolean enabled = true; - - @Expose - @ConfigOption(name = "Hide Border", desc = "Hide the border messages before and after the compact level up messages.") - @ConfigEditorBoolean - @FeatureToggle - public boolean hideBorder = true; - - @Expose - @ConfigOption(name = "Outside Bingo", desc = "Compact the level up chat messages outside of an Bingo profile as well.") - @ConfigEditorBoolean - public boolean outsideBingo = false; - } - - @Expose - @ConfigOption(name = "Minion Craft Helper", desc = "Show how many more items you need to upgrade the minion in your inventory. Especially useful for Bingo.") - @ConfigEditorBoolean - @FeatureToggle - public boolean minionCraftHelperEnabled = true; - - @Expose - public Position minionCraftHelperPos = new Position(10, 10, false, true); -} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/DianaConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/DianaConfig.java deleted file mode 100644 index 990f29d17..000000000 --- a/src/main/java/at/hannibal2/skyhanni/config/features/DianaConfig.java +++ /dev/null @@ -1,96 +0,0 @@ -package at.hannibal2.skyhanni.config.features; - -import at.hannibal2.skyhanni.config.FeatureToggle; -import com.google.gson.annotations.Expose; -import io.github.moulberry.moulconfig.annotations.*; -import org.lwjgl.input.Keyboard; - -public class DianaConfig { - - @Expose - @ConfigOption(name = "Soopy Guess", desc = "Uses §eSoopy's Guess Logic §7to find the next burrow. Does not require SoopyV2 or ChatTriggers to be installed.") - @ConfigEditorBoolean - @FeatureToggle - public boolean burrowsSoopyGuess = false; - - @Expose - @ConfigOption(name = "Nearby Detection", desc = "Show burrows near you.") - @ConfigEditorBoolean - @FeatureToggle - public boolean burrowsNearbyDetection = false; - - @Expose - @ConfigOption(name = "Smooth Transition", desc = "Show the way from one burrow to another smoothly.") - @ConfigEditorBoolean - public boolean burrowSmoothTransition = false; - - @Expose - @ConfigOption(name = "Nearest Warp", desc = "Warps to the nearest warp point on the hub, if closer to the next burrow.") - @ConfigEditorBoolean - public boolean burrowNearestWarp = false; - - @Expose - @ConfigOption(name = "Warp Key", desc = "Press this key to warp to nearest burrow waypoint.") - @ConfigEditorKeybind(defaultKey = Keyboard.KEY_NONE) - public int keyBindWarp = Keyboard.KEY_NONE; - - @Expose - @ConfigOption(name = "Ignored Warps", desc = "") - @Accordion - public IgnoredWarpsConfig ignoredWarps = new IgnoredWarpsConfig(); - - public static class IgnoredWarpsConfig { - - @Expose - @ConfigOption(name = "Crypt", desc = "Ignore the Crypt warp point (Because it takes a long time to leave).") - @ConfigEditorBoolean - public boolean crypt = false; - - @Expose - @ConfigOption(name = "Wizard", desc = "Ignore the Wizard Tower warp point (Because it is easy to fall into the rift).") - @ConfigEditorBoolean - public boolean wizard = false; - - } - - @Expose - @ConfigOption(name = "Inquisitor Waypoint Sharing", desc = "") - @Accordion - @ConfigAccordionId(id = 9) - public InquisitorSharing inquisitorSharing = new InquisitorSharing(); - - public static class InquisitorSharing { - - @Expose - @ConfigOption(name = "Enabled", desc = "Shares your Inquisitor and receiving other Inquisitors via Party Chat.") - @ConfigEditorBoolean - @FeatureToggle - public boolean enabled = true; - - @Expose - @ConfigOption(name = "Focus", desc = "Hide other waypoints when your Party finds a Inquisitor.") - @ConfigEditorBoolean - public boolean focusInquisitor = false; - - @Expose - @ConfigOption(name = "Instant Share", desc = "Share the waypoint as soon as you find a Inquisitor. As alternative, you can share it only via key press") - @ConfigEditorBoolean - public boolean instantShare = true; - - @Expose - @ConfigOption(name = "Share Key", desc = "Press this key to share your Inquisitor Waypoint.") - @ConfigEditorKeybind(defaultKey = Keyboard.KEY_Y) - public int keyBindShare = Keyboard.KEY_Y; - - @Expose - @ConfigOption(name = "Show Despawn Time", desc = "Show the time until the shared Inquisitor will despawn.") - @ConfigEditorBoolean - public boolean showDespawnTime = true; - } - - @Expose - @ConfigOption(name = "Griffin Pet Warning", desc = "Warn when holding an Ancestral Spade if a Griffin pet is not equipped.") - @ConfigEditorBoolean - @FeatureToggle - public boolean petWarning = true; -} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/EventConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/EventConfig.java new file mode 100644 index 000000000..f8b5d0e43 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/EventConfig.java @@ -0,0 +1,218 @@ +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.*; +import io.github.moulberry.moulconfig.observer.Property; +import org.lwjgl.input.Keyboard; + +public class EventConfig { + + @ConfigOption(name = "Monthly Bingo", desc = "") + @Accordion + @Expose + public BingoConfig bingo = new BingoConfig(); + + public static class BingoConfig { + + @Expose + @ConfigOption(name = "Bingo Card", desc = "") + @Accordion + public BingoCard bingoCard = new BingoCard(); + + public static class BingoCard { + @Expose + @ConfigOption(name = "Enable", desc = "Displays the Bingo Card.") + @ConfigEditorBoolean + @FeatureToggle + public boolean enabled = true; + @Expose + @ConfigOption(name = "Quick Toggle", desc = "Quickly toggle the Bingo Card or the step helper by sneaking with SkyBlock Menu in hand.") + @ConfigEditorBoolean + public boolean quickToggle = true; + + @Expose + @ConfigOption(name = "Bingo Steps", desc = "Show help with the next step in Bingo instead of the Bingo Card. " + + "§cThis feature is in early development. Expect bugs and missing goals.") + @ConfigEditorBoolean + public boolean stepHelper = false; + + @Expose + @ConfigOption(name = "Hide Community Goals", desc = "Hide Community Goals from the Bingo Card display.") + @ConfigEditorBoolean + public Property<Boolean> hideCommunityGoals = Property.of(false); + + @Expose + @ConfigOption( + name = "Show Guide", + desc = "Show tips and difficulty for bingo goals inside the Bingo Card inventory.\n" + + "These tips are made from inspirations and guides from the community,\n"+ + "aiming to help you to complete the bingo card." + ) + @ConfigEditorBoolean + @FeatureToggle + public boolean bingoSplashGuide = true; + + @Expose + public Position bingoCardPos = new Position(10, 10, false, true); + } + + @Expose + @ConfigOption(name = "Compact Chat Messages", desc = "") + @Accordion + public CompactChat compactChat = new CompactChat(); + + public static class CompactChat { + + @Expose + @ConfigOption(name = "Enable", desc = "Shortens chat messages about skill level ups, collection gains, " + + "new area discoveries and SkyBlock level up messages while on Bingo.") + @ConfigEditorBoolean + @FeatureToggle + public boolean enabled = true; + + @Expose + @ConfigOption(name = "Hide Border", desc = "Hide the border messages before and after the compact level up messages.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hideBorder = true; + + @Expose + @ConfigOption(name = "Outside Bingo", desc = "Compact the level up chat messages outside of an Bingo profile as well.") + @ConfigEditorBoolean + public boolean outsideBingo = false; + } + + @Expose + @ConfigOption(name = "Minion Craft Helper", desc = "Show how many more items you need to upgrade the minion in your inventory. Especially useful for Bingo.") + @ConfigEditorBoolean + @FeatureToggle + public boolean minionCraftHelperEnabled = true; + + @Expose + public Position minionCraftHelperPos = new Position(10, 10, false, true); + } + + @ConfigOption(name = "Diana's Mythological Burrows", desc = "") + @Accordion + @Expose + public DianaConfig diana = new DianaConfig(); + + public static class DianaConfig { + + + @Expose + @ConfigOption(name = "Soopy Guess", desc = "Uses §eSoopy's Guess Logic §7to find the next burrow. Does not require SoopyV2 or ChatTriggers to be installed.") + @ConfigEditorBoolean + @FeatureToggle + public boolean burrowsSoopyGuess = false; + + @Expose + @ConfigOption(name = "Nearby Detection", desc = "Show burrows near you.") + @ConfigEditorBoolean + @FeatureToggle + public boolean burrowsNearbyDetection = false; + + @Expose + @ConfigOption(name = "Smooth Transition", desc = "Show the way from one burrow to another smoothly.") + @ConfigEditorBoolean + public boolean burrowSmoothTransition = false; + + @Expose + @ConfigOption(name = "Nearest Warp", desc = "Warps to the nearest warp point on the hub, if closer to the next burrow.") + @ConfigEditorBoolean + public boolean burrowNearestWarp = false; + + @Expose + @ConfigOption(name = "Warp Key", desc = "Press this key to warp to nearest burrow waypoint.") + @ConfigEditorKeybind(defaultKey = Keyboard.KEY_NONE) + public int keyBindWarp = Keyboard.KEY_NONE; + + @Expose + @ConfigOption(name = "Ignored Warps", desc = "") + @Accordion + public IgnoredWarpsConfig ignoredWarps = new IgnoredWarpsConfig(); + + public static class IgnoredWarpsConfig { + + @Expose + @ConfigOption(name = "Crypt", desc = "Ignore the Crypt warp point (Because it takes a long time to leave).") + @ConfigEditorBoolean + public boolean crypt = false; + + @Expose + @ConfigOption(name = "Wizard", desc = "Ignore the Wizard Tower warp point (Because it is easy to fall into the rift).") + @ConfigEditorBoolean + public boolean wizard = false; + + } + + @Expose + @ConfigOption(name = "Inquisitor Waypoint Sharing", desc = "") + @Accordion + @ConfigAccordionId(id = 9) + public InquisitorSharing inquisitorSharing = new InquisitorSharing(); + + public static class InquisitorSharing { + + @Expose + @ConfigOption(name = "Enabled", desc = "Shares your Inquisitor and receiving other Inquisitors via Party Chat.") + @ConfigEditorBoolean + @FeatureToggle + public boolean enabled = true; + + @Expose + @ConfigOption(name = "Focus", desc = "Hide other waypoints when your Party finds a Inquisitor.") + @ConfigEditorBoolean + public boolean focusInquisitor = false; + + @Expose + @ConfigOption(name = "Instant Share", desc = "Share the waypoint as soon as you find a Inquisitor. As alternative, you can share it only via key press") + @ConfigEditorBoolean + public boolean instantShare = true; + + @Expose + @ConfigOption(name = "Share Key", desc = "Press this key to share your Inquisitor Waypoint.") + @ConfigEditorKeybind(defaultKey = Keyboard.KEY_Y) + public int keyBindShare = Keyboard.KEY_Y; + + @Expose + @ConfigOption(name = "Show Despawn Time", desc = "Show the time until the shared Inquisitor will despawn.") + @ConfigEditorBoolean + public boolean showDespawnTime = true; + } + + @Expose + @ConfigOption(name = "Griffin Pet Warning", desc = "Warn when holding an Ancestral Spade if a Griffin pet is not equipped.") + @ConfigEditorBoolean + @FeatureToggle + public boolean petWarning = true; + } + + + // comment in if the event is needed again +// @ConfigOption(name = "300þ Anniversary Celebration", desc = "Features for the 300þ year of SkyBlock") + @Accordion + @Expose + public Century century = new Century(); + + public static class Century { + + @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 + @ConfigEditorBoolean + @FeatureToggle + public boolean enableActiveTimer = true; + + @Expose + public Position activeTimerPosition = new Position(100, 100, false, true); + + @ConfigOption(name = "Enable Active Player Alert", desc = "Loudly proclaim when it is time to break some wheat") + @Expose + @ConfigEditorBoolean + public boolean enableActiveAlert = 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 ccd444b69..c597abb6e 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java @@ -892,27 +892,4 @@ public class MiscConfig { public Position inventoryLoadPos = new Position(394, 124, false, true); - @ConfigOption(name = "300þ Anniversary Celebration", desc = "Features for the 300þ year of SkyBlock") - @Accordion - @Expose - public Century century = new Century(); - - public static class Century { - - @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 - @ConfigEditorBoolean - @FeatureToggle - public boolean enableActiveTimer = true; - - @Expose - public Position activeTimerPosition = new Position(100, 100, false, true); - - @ConfigOption(name = "Enable Active Player Alert", desc = "Loudly proclaim when it is time to break some wheat") - @Expose - @ConfigEditorBoolean - public boolean enableActiveAlert = false; - } - - } diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt index c2610d930..fcbc46e45 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.bingo 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.InventoryFullyOpenedEvent @@ -33,7 +34,7 @@ class BingoCardDisplay { private const val MAX_PERSONAL_GOALS = 20 private const val MAX_COMMUNITY_GOALS = 5 - private val config get() = SkyHanniMod.feature.bingo.bingoCard + private val config get() = SkyHanniMod.feature.event.bingo.bingoCard private var displayMode = 0 val personalGoals = mutableListOf<PersonalGoal>() private val communityGoals = mutableListOf<CommunityGoal>() @@ -182,4 +183,9 @@ class BingoCardDisplay { fun onConfigLoad(event: ConfigLoadEvent) { config.hideCommunityGoals.onToggle { update() } } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(2, "bingo", "event.bingo") + } }
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardTips.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardTips.kt index 769872409..a112616a3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardTips.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardTips.kt @@ -66,7 +66,7 @@ class BingoCardTips { } } - fun isEnabled() = LorenzUtils.inSkyBlock && SkyHanniMod.feature.bingo.bingoCard.bingoSplashGuide + fun isEnabled() = LorenzUtils.inSkyBlock && SkyHanniMod.feature.event.bingo.bingoCard.bingoSplashGuide enum class Difficulty(rawName: String, val color: LorenzColor) { EASY("Easy", LorenzColor.GREEN), diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt index 53a240128..357763e2c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt @@ -17,7 +17,7 @@ import at.hannibal2.skyhanni.utils.StringUtils.removeColor import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class BingoNextStepHelper { - private val config get() = SkyHanniMod.feature.bingo.bingoCard + private val config get() = SkyHanniMod.feature.event.bingo.bingoCard private var dirty = true private val crystalObtainedPattern = " *§r§e(?<crystalName>Topaz|Sapphire|Jade|Amethyst|Amber) Crystal".toPattern() diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/CompactBingoChat.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/CompactBingoChat.kt index be4838ee9..7beff8920 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/CompactBingoChat.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/CompactBingoChat.kt @@ -8,7 +8,7 @@ import at.hannibal2.skyhanni.utils.StringUtils.removeColor import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class CompactBingoChat { - private val config get() = SkyHanniMod.feature.bingo.compactChat + private val config get() = SkyHanniMod.feature.event.bingo.compactChat private var inSkillLevelUp = false private var inSkyBlockLevelUp = false diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt index 4ebdc1ffa..bb324a984 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt @@ -19,6 +19,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.time.Duration.Companion.seconds class MinionCraftHelper { + private val config get() = SkyHanniMod.feature.event.bingo private var minionNamePattern = "(?<name>.*) Minion (?<number>.*)".toPattern() private var display = emptyList<String>() private var hasMinionInInventory = false @@ -36,7 +37,7 @@ class MinionCraftHelper { @SubscribeEvent fun onTick(event: LorenzTickEvent) { if (!LorenzUtils.isBingoProfile) return - if (!SkyHanniMod.feature.bingo.minionCraftHelperEnabled) return + if (!config.minionCraftHelperEnabled) return if (event.isMod(10)) { val mainInventory = Minecraft.getMinecraft()?.thePlayer?.inventory?.mainInventory ?: return @@ -241,9 +242,9 @@ class MinionCraftHelper { @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { if (!LorenzUtils.isBingoProfile) return - if (!SkyHanniMod.feature.bingo.minionCraftHelperEnabled) return + if (!config.minionCraftHelperEnabled) return - SkyHanniMod.feature.bingo.minionCraftHelperPos.renderStrings(display, posLabel = "Minion Craft Helper") + config.minionCraftHelperPos.renderStrings(display, posLabel = "Minion Craft Helper") } private fun notify(minionName: String) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/anniversary/ActivePlayerTimer.kt b/src/main/java/at/hannibal2/skyhanni/features/event/anniversary/Year300RaffleEvent.kt index a83def532..948d04269 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/anniversary/ActivePlayerTimer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/anniversary/Year300RaffleEvent.kt @@ -20,7 +20,8 @@ import java.time.Instant import kotlin.time.Duration.Companion.minutes import kotlin.time.Duration.Companion.seconds -object ActivePlayerTimer { +object Year300RaffleEvent { + private val config get() = SkyHanniMod.feature.event.century val displayItem by lazy { NEUItems.getItemStackOrNull("EPOCH_CAKE_ORANGE") ?: ItemStack(Items.clock) } private var lastTimerReceived = TimeMark.never() @@ -35,16 +36,14 @@ object ActivePlayerTimer { } } - fun isEnabled(): Boolean { - return SkyHanniMod.feature.misc.century.enableActiveTimer && - Instant.now().isBefore(SkyBlockTime(301).toInstant()) && - LorenzUtils.inSkyBlock - } + fun isEnabled() = config.enableActiveTimer && + Instant.now().isBefore(SkyBlockTime(301).toInstant()) && + LorenzUtils.inSkyBlock @SubscribeEvent fun onRender(event: GuiRenderEvent.GameOverlayRenderEvent) { - SkyHanniMod.feature.misc.century.activeTimerPosition.renderSingleLineWithItems( + config.activeTimerPosition.renderSingleLineWithItems( overlay ?: return, posLabel = "300þ Anniversary Active Timer" ) @@ -62,7 +61,7 @@ object ActivePlayerTimer { } else { 20.minutes - p } - if (p.isFinite() && timeLeft < 1.seconds && lastTimeAlerted.passedTime() > 5.minutes && SkyHanniMod.feature.misc.century.enableActiveAlert) { + if (p.isFinite() && timeLeft < 1.seconds && lastTimeAlerted.passedTime() > 5.minutes && config.enableActiveAlert) { SoundUtils.centuryActiveTimerAlert.playSound() lastTimeAlerted = TimeMark.now() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt index fe9efd09a..f96c6d260 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt @@ -12,7 +12,6 @@ import net.minecraftforge.fml.common.gameevent.InputEvent.KeyInputEvent import org.lwjgl.input.Keyboard class BurrowWarpHelper { - private val config get() = SkyHanniMod.feature.diana private var lastWarpTime = 0L private var lastWarp: WarpPoint? = null @@ -58,6 +57,7 @@ class BurrowWarpHelper { } companion object { + private val config get() = SkyHanniMod.feature.event.diana var currentWarp: WarpPoint? = null fun shouldUseWarps(target: LorenzVec) { @@ -93,10 +93,10 @@ class BurrowWarpHelper { ) { HUB("Hub", LorenzVec(-3, 70, -70), 2), CASTLE("Castle", LorenzVec(-250, 130, 45), 10), - CRYPT("Crypt", LorenzVec(-190, 74, -88), 15, { SkyHanniMod.feature.diana.ignoredWarps.crypt }), + CRYPT("Crypt", LorenzVec(-190, 74, -88), 15, { config.ignoredWarps.crypt }), DA("Dark Auction", LorenzVec(91, 74, 173), 2), MUSEUM("Museum", LorenzVec(-75, 76, 81), 2), - WIZARD("Wizard", LorenzVec(42.5, 122.0, 69.0), 5, { SkyHanniMod.feature.diana.ignoredWarps.wizard }), + WIZARD("Wizard", LorenzVec(42.5, 122.0, 69.0), 5, { config.ignoredWarps.wizard }), ; fun distance(other: LorenzVec): Double = other.distance(location) + extraBlocks diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt index d3c6038f2..1a6750d85 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.event.diana import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.EntityMovementData import at.hannibal2.skyhanni.events.* import at.hannibal2.skyhanni.utils.* @@ -18,7 +19,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.time.Duration.Companion.seconds object GriffinBurrowHelper { - private val config get() = SkyHanniMod.feature.diana + private val config get() = SkyHanniMod.feature.event.diana private var guessLocation: LorenzVec? = null private var targetLocation: LorenzVec? = null @@ -137,7 +138,7 @@ object GriffinBurrowHelper { sendTip(event) val playerLocation = LocationUtils.playerLocation() - if (SkyHanniMod.feature.diana.inquisitorSharing.enabled) { + if (config.inquisitorSharing.enabled) { for (inquis in InquisitorWaypointShare.waypoints.values) { val playerName = inquis.fromPlayer val location = inquis.location @@ -163,7 +164,7 @@ object GriffinBurrowHelper { } if (InquisitorWaypointShare.waypoints.isNotEmpty()) { - if (SkyHanniMod.feature.diana.inquisitorSharing.focusInquisitor) { + if (config.inquisitorSharing.focusInquisitor) { return } } @@ -192,6 +193,11 @@ object GriffinBurrowHelper { } } + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(2, "diana", "event.diana") + } + private fun sendTip(event: RenderWorldLastEvent) { teleportedLocation?.let { teleportedLocation = null diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowParticleFinder.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowParticleFinder.kt index 31571b30b..b16df2c70 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowParticleFinder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowParticleFinder.kt @@ -15,6 +15,7 @@ import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class GriffinBurrowParticleFinder { + private val config get() = SkyHanniMod.feature.event.diana private val recentlyDugParticleBurrows = mutableListOf<LorenzVec>() private val burrows = mutableMapOf<LorenzVec, Burrow>() @@ -78,7 +79,7 @@ class GriffinBurrowParticleFinder { @SubscribeEvent(priority = EventPriority.LOW, receiveCanceled = true) fun onChatPacket(event: PacketEvent.ReceiveEvent) { if (!LorenzUtils.inSkyBlock) return - if (!SkyHanniMod.feature.diana.burrowsSoopyGuess) return + if (!config.burrowsSoopyGuess) return if (LorenzUtils.skyBlockIsland != IslandType.HUB) return val packet = event.packet @@ -149,7 +150,7 @@ class GriffinBurrowParticleFinder { @SubscribeEvent fun onChatMessage(event: LorenzChatEvent) { - if (!SkyHanniMod.feature.diana.burrowsSoopyGuess) return + if (!config.burrowsSoopyGuess) return if (LorenzUtils.skyBlockIsland != IslandType.HUB) return val message = event.message if (message.startsWith("§eYou dug out a Griffin Burrow!") || @@ -171,7 +172,7 @@ class GriffinBurrowParticleFinder { @SubscribeEvent fun onBlockClick(event: BlockClickEvent) { if (!LorenzUtils.inSkyBlock) return - if (!SkyHanniMod.feature.diana.burrowsSoopyGuess) return + if (!config.burrowsSoopyGuess) return if (LorenzUtils.skyBlockIsland != IslandType.HUB) return val pos = event.position diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinPetWarning.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinPetWarning.kt index 5a578590f..679c493ca 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinPetWarning.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinPetWarning.kt @@ -17,7 +17,7 @@ class GriffinPetWarning { fun onTick(event: LorenzTickEvent) { if (!event.isMod(20)) return if (!IslandType.HUB.isInIsland()) return - if (!SkyHanniMod.feature.diana.petWarning) return + if (!SkyHanniMod.feature.event.diana.petWarning) return if (!DianaAPI.isRitualActive()) return if (!DianaAPI.hasSpadeInHand()) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt index 7a8ea5d2b..14f4305ab 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt @@ -20,7 +20,7 @@ import org.lwjgl.input.Keyboard import kotlin.time.Duration.Companion.seconds object InquisitorWaypointShare { - private val config get() = SkyHanniMod.feature.diana.inquisitorSharing + private val config get() = SkyHanniMod.feature.event.diana.inquisitorSharing private val partyPattern = "§9Party §8> (?<playerName>.*)§f: §rx: (?<x>-?[0-9]{1,4}), y: (?<y>-?[0-9]{1,4}), z: (?<z>-?[0-9]{1,4})\\b".toPattern() private val diedPattern = "§9Party §8> (?<playerName>.*)§f: §rInquisitor dead!".toPattern() diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/SoopyGuessBurrow.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/SoopyGuessBurrow.kt index 079d6cecf..0ca67ad8e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/SoopyGuessBurrow.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/SoopyGuessBurrow.kt @@ -276,6 +276,6 @@ class SoopyGuessBurrow { } private fun isEnabled(): Boolean { - return LorenzUtils.inSkyBlock && LorenzUtils.skyBlockIsland == IslandType.HUB && SkyHanniMod.feature.diana.burrowsSoopyGuess + return LorenzUtils.inSkyBlock && LorenzUtils.skyBlockIsland == IslandType.HUB && SkyHanniMod.feature.event.diana.burrowsSoopyGuess } }
\ No newline at end of file |