diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2308e1611d50..7a8efec088a7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -116,7 +116,8 @@ format like "- #821" to illustrate the dependency. - Mods that have reached their end of life. (Rip SBA, Dulkir and Soopy). - The mod has, according to Hypixel rules, illegal features ("cheat mod/client"). - If you can improve the existing feature in a meaningful way. -- All new classes should be written in Kotlin, with one exception: +- All new classes should be written in Kotlin, with a few exceptions: + - Config files in `at.hannibal2.skyhanni.config.features` - Mixin classes in `at.hannibal2.skyhanni.mixins.transformers` - New features should be made in Kotlin objects unless there is a specific reason for it not to. - If the feature needs to use forge events or a repo pattern, annotate it with `@SkyHanniModule` @@ -124,7 +125,9 @@ format like "- #821" to illustrate the dependency. - Avoid using deprecated functions. - These functions are marked for removal in future versions. - If you're unsure why a function is deprecated or how to replace it, please ask for guidance. -- JSON data objects are made in kotlin and put into the directory `at.hannibal2.skyhanni.data.jsonobjects` +- Future JSON data objects should be made in kotlin and placed in the directory `at.hannibal2.skyhanni.data.jsonobjects` +- Config files should be made in **Kotlin**. + - There may be legacy config files left as Java files, however they will all be ported eventually. - Please use the existing event system, or expand on it. Do not use Forge events. - (We inject the calls with Mixin) - Please use existing utils methods. diff --git a/src/main/java/at/hannibal2/skyhanni/api/enoughupdates/EnoughUpdatesManager.kt b/src/main/java/at/hannibal2/skyhanni/api/enoughupdates/EnoughUpdatesManager.kt index abda58152f10..a7abdf1d4db6 100644 --- a/src/main/java/at/hannibal2/skyhanni/api/enoughupdates/EnoughUpdatesManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/api/enoughupdates/EnoughUpdatesManager.kt @@ -6,6 +6,7 @@ import at.hannibal2.skyhanni.config.ConfigManager import at.hannibal2.skyhanni.config.commands.CommandCategory import at.hannibal2.skyhanni.config.commands.CommandRegistrationEvent import at.hannibal2.skyhanni.data.jsonobjects.repo.neu.NeuPetsJson +import at.hannibal2.skyhanni.events.HypixelJoinEvent import at.hannibal2.skyhanni.events.NeuRepositoryReloadEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.test.command.ErrorManager @@ -363,6 +364,19 @@ object EnoughUpdatesManager { } } + private fun itemCountInRepoFolder(): Int { + val itemsFolder = File(repoLocation, "items") + return itemsFolder.listFiles()?.size ?: 0 + } + + @HandleEvent + fun onHypixelJoin(event: HypixelJoinEvent) { + if (itemMap.isEmpty() && itemCountInRepoFolder() > 0) { + reloadRepo() + println("No loaded items in NEU repo, attempting to reload the repo.") + } + } + @HandleEvent fun onNeuRepoReload(event: NeuRepositoryReloadEvent) { neuPetsJson = event.readConstant("pets") @@ -385,5 +399,23 @@ object EnoughUpdatesManager { callback { downloadRepo() } } } + + event.register("shneurepostatus") { + description = "Get the status of the NEU repo" + category = CommandCategory.DEVELOPER_TEST + callback { + val loadedItems = itemMap.size + val directorySize = itemCountInRepoFolder() + + ChatUtils.chat("NEU Repo Status:") + when { + directorySize == 0 -> ChatUtils.chat("§cNo items directory found!", prefix = false) + loadedItems == 0 -> ChatUtils.chat("§cNo items loaded!", prefix = false) + loadedItems < directorySize -> ChatUtils.chat("§eLoaded $loadedItems/$directorySize items", prefix = false) + loadedItems > directorySize -> ChatUtils.chat("§eLoaded Items: $loadedItems (more than directory size)", prefix = false) + else -> ChatUtils.chat("§aLoaded all $loadedItems items!", prefix = false) + } + } + } } } diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/ItemProfitTrackerConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/ItemProfitTrackerConfig.java deleted file mode 100644 index 55223fd462c0..000000000000 --- a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/ItemProfitTrackerConfig.java +++ /dev/null @@ -1,23 +0,0 @@ -package at.hannibal2.skyhanni.config.features.slayer; - -import at.hannibal2.skyhanni.config.FeatureToggle; -import at.hannibal2.skyhanni.config.core.config.Position; -import com.google.gson.annotations.Expose; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; -import io.github.notenoughupdates.moulconfig.annotations.ConfigLink; -import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; - -public class ItemProfitTrackerConfig { - - @Expose - @ConfigOption(name = "Enabled", desc = "Count all items you pick up while doing slayer, " + - "keeping track of how much you pay for starting slayers and calculating the overall profit.") - @ConfigEditorBoolean - @FeatureToggle - public boolean enabled = true; - - @Expose - @ConfigLink(owner = ItemProfitTrackerConfig.class, field = "enabled") - public Position pos = new Position(20, 20, false, true); - -} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/ItemsOnGroundConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/ItemsOnGroundConfig.java deleted file mode 100644 index ca3ba9eb466b..000000000000 --- a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/ItemsOnGroundConfig.java +++ /dev/null @@ -1,21 +0,0 @@ -package at.hannibal2.skyhanni.config.features.slayer; - -import at.hannibal2.skyhanni.config.FeatureToggle; -import com.google.gson.annotations.Expose; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorSlider; -import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; - -public class ItemsOnGroundConfig { - - @Expose - @ConfigOption(name = "Enabled", desc = "Show the name and price of items laying on the ground. §cOnly in slayer areas!") - @ConfigEditorBoolean - @FeatureToggle - public boolean enabled = true; - - @Expose - @ConfigOption(name = "Minimum Price", desc = "Items below this price will be ignored.") - @ConfigEditorSlider(minValue = 1, maxValue = 1_000_000, minStep = 1) - public int minimumPrice = 50_000; -} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/ItemsOnGroundConfig.kt b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/ItemsOnGroundConfig.kt new file mode 100644 index 000000000000..f5dbab0831cb --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/ItemsOnGroundConfig.kt @@ -0,0 +1,23 @@ +package at.hannibal2.skyhanni.config.features.slayer + +import at.hannibal2.skyhanni.config.FeatureToggle +import com.google.gson.annotations.Expose +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorSlider +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption + +class ItemsOnGroundConfig { + @Expose + @ConfigOption( + name = "Enabled", + desc = "Show the name and price of items laying on the ground. §cOnly in slayer areas!" + ) + @ConfigEditorBoolean + @FeatureToggle + var enabled: Boolean = true + + @Expose + @ConfigOption(name = "Minimum Price", desc = "Items below this price will be ignored.") + @ConfigEditorSlider(minValue = 1f, maxValue = 1000000f, minStep = 1f) + var minimumPrice: Int = 50000 +} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/RngMeterDisplayConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/RngMeterDisplayConfig.kt similarity index 55% rename from src/main/java/at/hannibal2/skyhanni/config/features/slayer/RngMeterDisplayConfig.java rename to src/main/java/at/hannibal2/skyhanni/config/features/slayer/RngMeterDisplayConfig.kt index da95fc53276a..47764a55ab55 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/RngMeterDisplayConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/RngMeterDisplayConfig.kt @@ -1,32 +1,30 @@ -package at.hannibal2.skyhanni.config.features.slayer; +package at.hannibal2.skyhanni.config.features.slayer -import at.hannibal2.skyhanni.config.FeatureToggle; -import at.hannibal2.skyhanni.config.core.config.Position; -import com.google.gson.annotations.Expose; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; -import io.github.notenoughupdates.moulconfig.annotations.ConfigLink; -import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; - -public class RngMeterDisplayConfig { +import at.hannibal2.skyhanni.config.FeatureToggle +import at.hannibal2.skyhanni.config.core.config.Position +import com.google.gson.annotations.Expose +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean +import io.github.notenoughupdates.moulconfig.annotations.ConfigLink +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption +class RngMeterDisplayConfig { @Expose @ConfigOption(name = "Enabled", desc = "Display amount of bosses needed until next RNG meter drop.") @ConfigEditorBoolean @FeatureToggle - public boolean enabled = true; + var enabled: Boolean = true @Expose @ConfigOption(name = "Warn Empty", desc = "Warn when no item is set in the RNG Meter.") @ConfigEditorBoolean - public boolean warnEmpty = false; + var warnEmpty: Boolean = false @Expose @ConfigOption(name = "Hide Chat", desc = "Hide the RNG meter message from chat if current item is selected.") @ConfigEditorBoolean - public boolean hideChat = true; + var hideChat: Boolean = true @Expose - @ConfigLink(owner = RngMeterDisplayConfig.class, field = "enabled") - public Position pos = new Position(410, 110, false, true); - + @ConfigLink(owner = RngMeterDisplayConfig::class, field = "enabled") + var pos: Position = Position(410, 110, false, true) } diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/SlayerBossWarningConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/SlayerBossWarningConfig.java deleted file mode 100644 index d6391d9f20b9..000000000000 --- a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/SlayerBossWarningConfig.java +++ /dev/null @@ -1,26 +0,0 @@ -package at.hannibal2.skyhanni.config.features.slayer; - -import at.hannibal2.skyhanni.config.FeatureToggle; -import com.google.gson.annotations.Expose; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorSlider; -import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; - -public class SlayerBossWarningConfig { - - @Expose - @ConfigOption(name = "Enabled", desc = "Send a title when your boss is about to spawn.") - @ConfigEditorBoolean - @FeatureToggle - public boolean enabled = false; - - @Expose - @ConfigOption(name = "Percent", desc = "The percentage at which the title and sound should be sent.") - @ConfigEditorSlider(minStep = 1, minValue = 50, maxValue = 90) - public int percent = 80; - - @Expose - @ConfigOption(name = "Repeat", desc = "Resend the title and sound on every kill after reaching the configured percent value.") - @ConfigEditorBoolean - public boolean repeat = false; -} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/SlayerBossWarningConfig.kt b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/SlayerBossWarningConfig.kt new file mode 100644 index 000000000000..b94ee133e0a3 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/SlayerBossWarningConfig.kt @@ -0,0 +1,28 @@ +package at.hannibal2.skyhanni.config.features.slayer + +import at.hannibal2.skyhanni.config.FeatureToggle +import com.google.gson.annotations.Expose +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorSlider +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption + +class SlayerBossWarningConfig { + @Expose + @ConfigOption(name = "Enabled", desc = "Send a title when your boss is about to spawn.") + @ConfigEditorBoolean + @FeatureToggle + var enabled: Boolean = false + + @Expose + @ConfigOption(name = "Percent", desc = "The percentage at which the title and sound should be sent.") + @ConfigEditorSlider(minStep = 1f, minValue = 50f, maxValue = 90f) + var percent: Int = 80 + + @Expose + @ConfigOption( + name = "Repeat", + desc = "Resend the title and sound on every kill after reaching the configured percent value." + ) + @ConfigEditorBoolean + var repeat: Boolean = false +} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/SlayerConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/SlayerConfig.kt similarity index 53% rename from src/main/java/at/hannibal2/skyhanni/config/features/slayer/SlayerConfig.java rename to src/main/java/at/hannibal2/skyhanni/config/features/slayer/SlayerConfig.kt index fedace9995e3..533f903ddaee 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/SlayerConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/SlayerConfig.kt @@ -1,85 +1,94 @@ -package at.hannibal2.skyhanni.config.features.slayer; +package at.hannibal2.skyhanni.config.features.slayer -import at.hannibal2.skyhanni.config.FeatureToggle; -import at.hannibal2.skyhanni.config.features.slayer.blaze.BlazeConfig; -import at.hannibal2.skyhanni.config.features.slayer.endermen.EndermanConfig; -import at.hannibal2.skyhanni.config.features.slayer.vampire.VampireConfig; -import com.google.gson.annotations.Expose; -import io.github.notenoughupdates.moulconfig.annotations.Accordion; -import io.github.notenoughupdates.moulconfig.annotations.Category; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorSlider; -import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; - -public class SlayerConfig { +import at.hannibal2.skyhanni.config.FeatureToggle +import at.hannibal2.skyhanni.config.features.slayer.blaze.BlazeConfig +import at.hannibal2.skyhanni.config.features.slayer.endermen.EndermanConfig +import at.hannibal2.skyhanni.config.features.slayer.vampire.VampireConfig +import com.google.gson.annotations.Expose +import io.github.notenoughupdates.moulconfig.annotations.Accordion +import io.github.notenoughupdates.moulconfig.annotations.Category +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorSlider +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption +class SlayerConfig { + // TODO rename to "enderman" @Expose @Category(name = "Enderman", desc = "Enderman Slayer Feature") @Accordion - // TODO rename to "enderman" - public EndermanConfig endermen = new EndermanConfig(); + var endermen: EndermanConfig = EndermanConfig() + // TODO rename to "blaze" @Expose @Category(name = "Blaze", desc = "Blaze Slayer Features") - // TODO rename to "blaze" - public BlazeConfig blazes = new BlazeConfig(); + var blazes: BlazeConfig = BlazeConfig() @Expose @Category(name = "Vampire", desc = "Vampire Slayer Features") - public VampireConfig vampire = new VampireConfig(); + var vampire: VampireConfig = VampireConfig() @Expose @ConfigOption(name = "Item Profit Tracker", desc = "") @Accordion - public ItemProfitTrackerConfig itemProfitTracker = new ItemProfitTrackerConfig(); + var itemProfitTracker: SlayerProfitTrackerConfig = SlayerProfitTrackerConfig() @Expose @ConfigOption(name = "Items on Ground", desc = "") @Accordion - public ItemsOnGroundConfig itemsOnGround = new ItemsOnGroundConfig(); + var itemsOnGround: ItemsOnGroundConfig = ItemsOnGroundConfig() @Expose @ConfigOption(name = "RNG Meter Display", desc = "") @Accordion - public RngMeterDisplayConfig rngMeterDisplay = new RngMeterDisplayConfig(); + var rngMeterDisplay: RngMeterDisplayConfig = RngMeterDisplayConfig() @Expose @ConfigOption(name = "Boss Spawn Warning", desc = "") @Accordion - public SlayerBossWarningConfig slayerBossWarning = new SlayerBossWarningConfig(); + var slayerBossWarning: SlayerBossWarningConfig = SlayerBossWarningConfig() @Expose @ConfigOption(name = "Miniboss Highlight", desc = "Highlight Slayer Mini-Boss in blue color.") @ConfigEditorBoolean @FeatureToggle - public boolean slayerMinibossHighlight = false; + var slayerMinibossHighlight: Boolean = false @Expose @ConfigOption(name = "Line to Miniboss", desc = "Add a line to every Slayer Mini-Boss around you.") @ConfigEditorBoolean @FeatureToggle - public boolean slayerMinibossLine = false; + var slayerMinibossLine: Boolean = false @Expose - @ConfigOption(name = "Line to Miniboss Width", desc = "The width of the line pointing to every Slayer Mini-Boss around you.") - @ConfigEditorSlider(minStep = 1, minValue = 1, maxValue = 10) - public int slayerMinibossLineWidth = 3; + @ConfigOption( + name = "Line to Miniboss Width", + desc = "The width of the line pointing to every Slayer Mini-Boss around you." + ) + @ConfigEditorSlider(minStep = 1f, minValue = 1f, maxValue = 10f) + var slayerMinibossLineWidth: Int = 3 @Expose - @ConfigOption(name = "Hide Mob Names", desc = "Hide the name of the mobs you need to kill in order for the Slayer boss to spawn. Exclude mobs that are damaged, corrupted, runic or semi rare.") + @ConfigOption( + name = "Hide Mob Names", + desc = "Hide the name of the mobs you need to kill in order for the Slayer boss to spawn. " + + "Exclude mobs that are damaged, corrupted, runic or semi rare." + ) @ConfigEditorBoolean @FeatureToggle - public boolean hideMobNames = false; + var hideMobNames: Boolean = false @Expose - @ConfigOption(name = "Quest Warning", desc = "Warn when wrong Slayer quest is selected, or killing mobs for the wrong Slayer.") + @ConfigOption( + name = "Quest Warning", + desc = "Warn when wrong Slayer quest is selected, or killing mobs for the wrong Slayer." + ) @ConfigEditorBoolean @FeatureToggle - public boolean questWarning = true; + var questWarning: Boolean = true @Expose @ConfigOption(name = "Quest Warning Title", desc = "Send a title when warning.") @ConfigEditorBoolean @FeatureToggle - public boolean questWarningTitle = true; + var questWarningTitle: Boolean = true } diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/SlayerProfitTrackerConfig.kt b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/SlayerProfitTrackerConfig.kt new file mode 100644 index 000000000000..012bab10b5ae --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/SlayerProfitTrackerConfig.kt @@ -0,0 +1,24 @@ +package at.hannibal2.skyhanni.config.features.slayer + +import at.hannibal2.skyhanni.config.FeatureToggle +import at.hannibal2.skyhanni.config.core.config.Position +import com.google.gson.annotations.Expose +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean +import io.github.notenoughupdates.moulconfig.annotations.ConfigLink +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption + +class SlayerProfitTrackerConfig { + @Expose + @ConfigOption( + name = "Enabled", + desc = "Count all items you pick up while doing slayer, " + + "keeping track of how much you pay for starting slayers and calculating the overall profit." + ) + @ConfigEditorBoolean + @FeatureToggle + var enabled: Boolean = true + + @Expose + @ConfigLink(owner = SlayerProfitTrackerConfig::class, field = "enabled") + var pos: Position = Position(20, 20, false, true) +} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/blaze/BlazeConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/blaze/BlazeConfig.kt similarity index 56% rename from src/main/java/at/hannibal2/skyhanni/config/features/slayer/blaze/BlazeConfig.java rename to src/main/java/at/hannibal2/skyhanni/config/features/slayer/blaze/BlazeConfig.kt index 56830551e7f4..d40f792a39d4 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/blaze/BlazeConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/blaze/BlazeConfig.kt @@ -1,35 +1,38 @@ -package at.hannibal2.skyhanni.config.features.slayer.blaze; +package at.hannibal2.skyhanni.config.features.slayer.blaze -import at.hannibal2.skyhanni.config.FeatureToggle; -import at.hannibal2.skyhanni.config.core.config.Position; -import com.google.gson.annotations.Expose; -import io.github.notenoughupdates.moulconfig.annotations.Accordion; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; -import io.github.notenoughupdates.moulconfig.annotations.ConfigLink; -import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; +import at.hannibal2.skyhanni.config.FeatureToggle +import at.hannibal2.skyhanni.config.core.config.Position +import com.google.gson.annotations.Expose +import io.github.notenoughupdates.moulconfig.annotations.Accordion +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean +import io.github.notenoughupdates.moulconfig.annotations.ConfigLink +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption -public class BlazeConfig { +class BlazeConfig { @Expose @ConfigOption(name = "Hellion Shields", desc = "") @Accordion - public BlazeHellionConfig hellion = new BlazeHellionConfig(); + var hellion: BlazeHellionConfig = BlazeHellionConfig() @Expose - @ConfigOption(name = "Fire Pits", desc = "Warning when the fire pit phase starts for the Blaze Slayer tier 3 and 4.") + @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; + var firePitsWarning: Boolean = false @Expose @ConfigOption(name = "Phase Display", desc = "Show the current phase of the Blaze Slayer boss.") @ConfigEditorBoolean - public boolean phaseDisplay = false; + var phaseDisplay: Boolean = false @Expose @ConfigOption(name = "Clear View", desc = "Hide particles and fireballs near Blaze Slayer bosses and demons.") @ConfigEditorBoolean @FeatureToggle - public boolean clearView = false; + var clearView: Boolean = false @Expose @ConfigOption( @@ -39,9 +42,9 @@ public class BlazeConfig { ) @ConfigEditorBoolean @FeatureToggle - public boolean firePillarDisplay = false; + var firePillarDisplay: Boolean = false @Expose - @ConfigLink(owner = BlazeConfig.class, field = "firePillarDisplay") - public Position firePillarDisplayPosition = new Position(400, -150, 3f); + @ConfigLink(owner = BlazeConfig::class, field = "firePillarDisplay") + var firePillarDisplayPosition: Position = Position(400, -150, 3f) } diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/blaze/BlazeHellionConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/blaze/BlazeHellionConfig.java deleted file mode 100644 index a42d915dfb09..000000000000 --- a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/blaze/BlazeHellionConfig.java +++ /dev/null @@ -1,77 +0,0 @@ -package at.hannibal2.skyhanni.config.features.slayer.blaze; - -import at.hannibal2.skyhanni.config.FeatureToggle; -import at.hannibal2.skyhanni.config.HasLegacyId; -import at.hannibal2.skyhanni.config.core.config.Position; -import com.google.gson.annotations.Expose; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDropdown; -import io.github.notenoughupdates.moulconfig.annotations.ConfigLink; -import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; - -public 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 = "Blaze Daggers", desc = "Faster and permanent display for the Blaze Slayer daggers.") - @ConfigEditorBoolean - @FeatureToggle - public boolean daggers = 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 = "First Dagger", desc = "Select the first, left sided dagger for the display.") - @ConfigEditorDropdown - public FirstDaggerEntry firstDagger = FirstDaggerEntry.SPIRIT_OR_CRYSTAL; - - public enum FirstDaggerEntry implements HasLegacyId { - SPIRIT_OR_CRYSTAL("Spirit/Crystal", 0), - ASHEN_OR_AURIC("Ashen/Auric", 1), - ; - private final String str; - private final int legacyId; - - FirstDaggerEntry(String str, int legacyId) { - this.str = str; - this.legacyId = legacyId; - } - - // Constructor if new enum elements are added post-migration - FirstDaggerEntry(String str) { - this(str, -1); - } - - @Override - public int getLegacyId() { - return legacyId; - } - - @Override - public String toString() { - return str; - } - } - - @Expose - @ConfigOption(name = "Hide Chat", desc = "Remove the wrong Blaze Slayer dagger messages from chat.") - @ConfigEditorBoolean - @FeatureToggle - public boolean hideDaggerWarning = false; - - @Expose - @ConfigLink(owner = BlazeHellionConfig.class, field = "daggers") - public Position positionTop = new Position(-475, 173, 4.4f, true); - - @Expose - @ConfigLink(owner = BlazeHellionConfig.class, field = "daggers") - public Position positionBottom = new Position(-475, 230, 3.2f, true); -} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/blaze/BlazeHellionConfig.kt b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/blaze/BlazeHellionConfig.kt new file mode 100644 index 000000000000..99d941780fba --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/blaze/BlazeHellionConfig.kt @@ -0,0 +1,63 @@ +package at.hannibal2.skyhanni.config.features.slayer.blaze + +import at.hannibal2.skyhanni.config.FeatureToggle +import at.hannibal2.skyhanni.config.HasLegacyId +import at.hannibal2.skyhanni.config.core.config.Position +import com.google.gson.annotations.Expose +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDropdown +import io.github.notenoughupdates.moulconfig.annotations.ConfigLink +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption + +class BlazeHellionConfig { + @Expose + @ConfigOption( + name = "Colored Mobs", + desc = "Color the Blaze Slayer boss and the demons in the right hellion shield color." + ) + @ConfigEditorBoolean + @FeatureToggle + var coloredMobs: Boolean = false + + @Expose + @ConfigOption(name = "Blaze Daggers", desc = "Faster and permanent display for the Blaze Slayer daggers.") + @ConfigEditorBoolean + @FeatureToggle + var daggers: Boolean = false + + @Expose + @ConfigOption(name = "Right Dagger", desc = "Mark the right dagger to use for Blaze Slayer in the dagger overlay.") + @ConfigEditorBoolean + @FeatureToggle + var markRightHellionShield: Boolean = false + + @Expose + @ConfigOption(name = "First Dagger", desc = "Select the first, left sided dagger for the display.") + @ConfigEditorDropdown + var firstDagger: FirstDaggerEntry = FirstDaggerEntry.SPIRIT_OR_CRYSTAL + + enum class FirstDaggerEntry(private val displayName: String, private val legacyId: Int) : HasLegacyId { + SPIRIT_OR_CRYSTAL("Spirit/Crystal", 0), + ASHEN_OR_AURIC("Ashen/Auric", 1), + ; + + // Constructor if new enum elements are added post-migration + constructor(str: String) : this(str, -1) + override fun getLegacyId() = legacyId + override fun toString() = displayName + } + + @Expose + @ConfigOption(name = "Hide Chat", desc = "Remove the wrong Blaze Slayer dagger messages from chat.") + @ConfigEditorBoolean + @FeatureToggle + var hideDaggerWarning: Boolean = false + + @Expose + @ConfigLink(owner = BlazeHellionConfig::class, field = "daggers") + var positionTop: Position = Position(-475, 173, 4.4f, true) + + @Expose + @ConfigLink(owner = BlazeHellionConfig::class, field = "daggers") + var positionBottom: Position = Position(-475, 230, 3.2f, true) +} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/endermen/EndermanBeaconConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/endermen/EndermanBeaconConfig.kt similarity index 54% rename from src/main/java/at/hannibal2/skyhanni/config/features/slayer/endermen/EndermanBeaconConfig.java rename to src/main/java/at/hannibal2/skyhanni/config/features/slayer/endermen/EndermanBeaconConfig.kt index 882492a2fede..cf41885dfcc5 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/endermen/EndermanBeaconConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/endermen/EndermanBeaconConfig.kt @@ -1,46 +1,50 @@ -package at.hannibal2.skyhanni.config.features.slayer.endermen; +package at.hannibal2.skyhanni.config.features.slayer.endermen -import at.hannibal2.skyhanni.config.FeatureToggle; -import com.google.gson.annotations.Expose; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorColour; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorSlider; -import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; - -public class EndermanBeaconConfig { +import at.hannibal2.skyhanni.config.FeatureToggle +import com.google.gson.annotations.Expose +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorColour +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorSlider +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption +class EndermanBeaconConfig { @Expose - @ConfigOption(name = "Highlight Beacon", + @ConfigOption( + name = "Highlight Beacon", desc = "Highlight the Enderman Slayer Yang Glyph (beacon) in red color and added a timer for when he explodes.\n" + - "Supports beacon in hand and beacon flying.") + "Supports beacon in hand and beacon flying." + ) @ConfigEditorBoolean @FeatureToggle - public boolean highlightBeacon = true; + var highlightBeacon: Boolean = true @Expose @ConfigOption(name = "Beacon Color", desc = "Color of the beacon.") @ConfigEditorColour - public String beaconColor = "0:255:255:0:88"; + var beaconColor: String = "0:255:255:0:88" @Expose - @ConfigOption(name = "Show Warning", desc = "Display a warning mid-screen when the Enderman Slayer throws a Yang Glyph (beacon).") + @ConfigOption( + name = "Show Warning", + desc = "Display a warning mid-screen when the Enderman Slayer throws a Yang Glyph (beacon)." + ) @ConfigEditorBoolean @FeatureToggle - public boolean showWarning = false; + var showWarning: Boolean = false @Expose @ConfigOption(name = "Show Line", desc = "Draw a line starting at your crosshair to the beacon.") @ConfigEditorBoolean @FeatureToggle - public boolean showLine = false; + var showLine: Boolean = false @Expose @ConfigOption(name = "Line Color", desc = "Color of the line.") @ConfigEditorColour - public String lineColor = "0:255:255:0:88"; + var lineColor: String = "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; + @ConfigEditorSlider(minStep = 1f, minValue = 1f, maxValue = 10f) + var lineWidth: Int = 3 } diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/endermen/EndermanConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/endermen/EndermanConfig.kt similarity index 67% rename from src/main/java/at/hannibal2/skyhanni/config/features/slayer/endermen/EndermanConfig.java rename to src/main/java/at/hannibal2/skyhanni/config/features/slayer/endermen/EndermanConfig.kt index 1ff8b49d73d9..789a50c2df4b 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/endermen/EndermanConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/endermen/EndermanConfig.kt @@ -1,37 +1,37 @@ -package at.hannibal2.skyhanni.config.features.slayer.endermen; +package at.hannibal2.skyhanni.config.features.slayer.endermen -import at.hannibal2.skyhanni.config.FeatureToggle; -import com.google.gson.annotations.Expose; -import io.github.notenoughupdates.moulconfig.annotations.Accordion; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; -import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; +import at.hannibal2.skyhanni.config.FeatureToggle +import com.google.gson.annotations.Expose +import io.github.notenoughupdates.moulconfig.annotations.Accordion +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption -public class EndermanConfig { +class EndermanConfig { @Expose @ConfigOption(name = "Yang Glyph (Beacon)", desc = "") @Accordion - public EndermanBeaconConfig beacon = new EndermanBeaconConfig(); + var beacon: EndermanBeaconConfig = EndermanBeaconConfig() @Expose @ConfigOption(name = "Highlight Nukekubi Skulls", desc = "Highlight the Enderman Slayer Nukekubi Skulls (Eyes).") @ConfigEditorBoolean @FeatureToggle - public boolean highlightNukekebi = false; + var highlightNukekebi: Boolean = false @Expose @ConfigOption(name = "Line to Nukekubi Skulls", desc = "Draw a line to the Enderman Slayer Nukekubi Skulls.") @ConfigEditorBoolean @FeatureToggle - public boolean drawLineToNukekebi = false; + var drawLineToNukekebi: Boolean = false @Expose @ConfigOption(name = "Phase Display", desc = "Show the current phase of the Enderman Slayer in damage indicator.") @ConfigEditorBoolean - public boolean phaseDisplay = false; + var phaseDisplay: Boolean = false @Expose @ConfigOption(name = "Hide Particles", desc = "Hide particles around Enderman Slayer bosses and Mini-Bosses.") @ConfigEditorBoolean @FeatureToggle - public boolean hideParticles = false; + var hideParticles: Boolean = false } diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/BloodIchorConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/BloodIchorConfig.kt similarity index 58% rename from src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/BloodIchorConfig.java rename to src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/BloodIchorConfig.kt index 5acefb24c0a8..c1a71a02f3b2 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/BloodIchorConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/BloodIchorConfig.kt @@ -1,38 +1,40 @@ -package at.hannibal2.skyhanni.config.features.slayer.vampire; +package at.hannibal2.skyhanni.config.features.slayer.vampire -import at.hannibal2.skyhanni.config.FeatureToggle; -import com.google.gson.annotations.Expose; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorColour; -import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; +import at.hannibal2.skyhanni.config.FeatureToggle +import com.google.gson.annotations.Expose +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorColour +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption -public class BloodIchorConfig { +class BloodIchorConfig { @Expose @ConfigOption(name = "Highlight Blood Ichor", desc = "Highlight the Blood Ichor.") @ConfigEditorBoolean @FeatureToggle - public boolean highlight = false; + var highlight: Boolean = false @Expose @ConfigOption(name = "Beacon Beam", desc = "Render a beacon beam where the Blood Ichor is.") @ConfigEditorBoolean @FeatureToggle - public boolean renderBeam = true; + var renderBeam: Boolean = true @Expose @ConfigOption(name = "Color", desc = "Highlight color.") @ConfigEditorColour - public String color = "0:199:100:0:88"; + var color: String = "0:199:100:0:88" @Expose - @ConfigOption(name = "Show Lines", desc = "Draw lines that start from the head of the boss and end on the Blood Ichor.") + @ConfigOption( + name = "Show Lines", + desc = "Draw lines that start from the head of the boss and end on the Blood Ichor." + ) @ConfigEditorBoolean @FeatureToggle - public boolean showLines = false; + var showLines: Boolean = false @Expose @ConfigOption(name = "Lines Start Color", desc = "Starting color of the lines.") @ConfigEditorColour - public String linesColor = "0:255:255:13:0"; - + var linesColor: String = "0:255:255:13:0" } diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/CoopBossHighlightConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/CoopBossHighlightConfig.kt similarity index 69% rename from src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/CoopBossHighlightConfig.java rename to src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/CoopBossHighlightConfig.kt index f3358c00c029..160d5c48e3d0 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/CoopBossHighlightConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/CoopBossHighlightConfig.kt @@ -1,38 +1,38 @@ -package at.hannibal2.skyhanni.config.features.slayer.vampire; +package at.hannibal2.skyhanni.config.features.slayer.vampire -import at.hannibal2.skyhanni.config.FeatureToggle; -import com.google.gson.annotations.Expose; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorColour; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorText; -import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; +import at.hannibal2.skyhanni.config.FeatureToggle +import com.google.gson.annotations.Expose +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorColour +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorText +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption -public class CoopBossHighlightConfig { +class CoopBossHighlightConfig { @Expose @ConfigOption(name = "Highlight Co-op Boss", desc = "Highlight boss of your co-op member.") @ConfigEditorBoolean @FeatureToggle - public boolean highlight = true; + var highlight: Boolean = true @Expose @ConfigOption(name = "Highlight Color", desc = "What color to highlight the boss in.") @ConfigEditorColour - public String highlightColor = "0:249:0:255:88"; + var highlightColor: String = "0:249:0:255:88" @Expose @ConfigOption(name = "Co-op Members", desc = "Add your co-op member here.\n§eFormat: §7Name1,Name2,Name3") @ConfigEditorText - public String coopMembers = ""; + var coopMembers: String = "" @Expose @ConfigOption(name = "Steak Alert", desc = "Show a title when you can steak the boss.") @ConfigEditorBoolean @FeatureToggle - public boolean steakAlert = true; + var steakAlert: Boolean = true @Expose @ConfigOption(name = "Twinclaws Title", desc = "Send a title when Twinclaws is about to happen.") @ConfigEditorBoolean @FeatureToggle - public boolean twinClawsTitle = true; + var twinClawsTitle: Boolean = true } diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/KillerSpringConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/KillerSpringConfig.kt similarity index 54% rename from src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/KillerSpringConfig.java rename to src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/KillerSpringConfig.kt index 4478e22d1a4e..7741c867d5ff 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/KillerSpringConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/KillerSpringConfig.kt @@ -1,31 +1,34 @@ -package at.hannibal2.skyhanni.config.features.slayer.vampire; +package at.hannibal2.skyhanni.config.features.slayer.vampire -import at.hannibal2.skyhanni.config.FeatureToggle; -import com.google.gson.annotations.Expose; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorColour; -import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; +import at.hannibal2.skyhanni.config.FeatureToggle +import com.google.gson.annotations.Expose +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorColour +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption -public class KillerSpringConfig { +class KillerSpringConfig { @Expose @ConfigOption(name = "Highlight Killer Spring", desc = "Highlight the Killer Spring tower.") @ConfigEditorBoolean @FeatureToggle - public boolean highlight = false; + var highlight: Boolean = false @Expose @ConfigOption(name = "Color", desc = "Highlight color.") @ConfigEditorColour - public String color = "0:199:100:0:88"; + var color: String = "0:199:100:0:88" @Expose - @ConfigOption(name = "Show Lines", desc = "Draw lines that start from the head of the boss and end on the Killer Spring tower.") + @ConfigOption( + name = "Show Lines", + desc = "Draw lines that start from the head of the boss and end on the Killer Spring tower." + ) @ConfigEditorBoolean @FeatureToggle - public boolean showLines = false; + var showLines: Boolean = false @Expose @ConfigOption(name = "Lines Start Color", desc = "Starting color of the lines.") @ConfigEditorColour - public String linesColor = "0:255:255:13:0"; + var linesColor: String = "0:255:255:13:0" } diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/OthersBossConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/OthersBossConfig.kt similarity index 67% rename from src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/OthersBossConfig.java rename to src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/OthersBossConfig.kt index 7f96a2d7be6b..f617ca0227c4 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/OthersBossConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/OthersBossConfig.kt @@ -1,33 +1,32 @@ -package at.hannibal2.skyhanni.config.features.slayer.vampire; +package at.hannibal2.skyhanni.config.features.slayer.vampire -import at.hannibal2.skyhanni.config.FeatureToggle; -import com.google.gson.annotations.Expose; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorColour; -import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; - -public class OthersBossConfig { +import at.hannibal2.skyhanni.config.FeatureToggle +import com.google.gson.annotations.Expose +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorColour +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption +class OthersBossConfig { @Expose @ConfigOption(name = "Highlight Others Boss", desc = "Highlight others players boss.\nYou need to hit them first.") @ConfigEditorBoolean @FeatureToggle - public boolean highlight = true; + var highlight: Boolean = true @Expose @ConfigOption(name = "Highlight Color", desc = "What color to highlight the boss in.") @ConfigEditorColour - public String highlightColor = "0:249:0:255:88"; + var highlightColor: String = "0:249:0:255:88" @Expose @ConfigOption(name = "Steak Alert", desc = "Show a title when you can steak the boss.") @ConfigEditorBoolean @FeatureToggle - public boolean steakAlert = true; + var steakAlert: Boolean = true @Expose @ConfigOption(name = "Twinclaws Title", desc = "Send a title when Twinclaws is about to happen.") @ConfigEditorBoolean @FeatureToggle - public boolean twinClawsTitle = true; + var twinClawsTitle: Boolean = true } diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/OwnBossConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/OwnBossConfig.kt similarity index 55% rename from src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/OwnBossConfig.java rename to src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/OwnBossConfig.kt index 44834b46e80a..ed7dda869ae5 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/OwnBossConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/OwnBossConfig.kt @@ -1,34 +1,35 @@ -package at.hannibal2.skyhanni.config.features.slayer.vampire; +package at.hannibal2.skyhanni.config.features.slayer.vampire -import at.hannibal2.skyhanni.config.FeatureToggle; -import com.google.gson.annotations.Expose; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorColour; -import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; - -public class OwnBossConfig { +import at.hannibal2.skyhanni.config.FeatureToggle +import com.google.gson.annotations.Expose +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorColour +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption +class OwnBossConfig { @Expose @ConfigOption(name = "Highlight Your Boss", desc = "Highlight your own Vampire Slayer boss.") @ConfigEditorBoolean @FeatureToggle - public boolean highlight = true; + var highlight: Boolean = true @Expose @ConfigOption(name = "Highlight Color", desc = "What color to highlight the boss in.") @ConfigEditorColour - public String highlightColor = "0:249:0:255:88"; + var highlightColor: String = "0:249:0:255:88" @Expose @ConfigOption(name = "Steak Alert", desc = "Show a title when you can steak your boss.") @ConfigEditorBoolean @FeatureToggle - public boolean steakAlert = true; + var steakAlert: Boolean = true @Expose - @ConfigOption(name = "Twinclaws Title", desc = "Send a title when Twinclaws is about to happen.\n" + - "Works on others highlighted people boss.") + @ConfigOption( + name = "Twinclaws Title", + desc = "Send a title when Twinclaws is about to happen.\nWorks on others highlighted people boss." + ) @ConfigEditorBoolean @FeatureToggle - public boolean twinClawsTitle = true; + var twinClawsTitle: Boolean = true } diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/VampireConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/VampireConfig.kt similarity index 61% rename from src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/VampireConfig.java rename to src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/VampireConfig.kt index 8bc908c6fe61..15e36e88b848 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/VampireConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/slayer/vampire/VampireConfig.kt @@ -1,80 +1,79 @@ -package at.hannibal2.skyhanni.config.features.slayer.vampire; +package at.hannibal2.skyhanni.config.features.slayer.vampire -import at.hannibal2.skyhanni.config.FeatureToggle; -import com.google.gson.annotations.Expose; -import io.github.notenoughupdates.moulconfig.annotations.Accordion; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorColour; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorSlider; -import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; - -public class VampireConfig { +import at.hannibal2.skyhanni.config.FeatureToggle +import com.google.gson.annotations.Expose +import io.github.notenoughupdates.moulconfig.annotations.Accordion +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorColour +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorSlider +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption +class VampireConfig { @Expose @ConfigOption(name = "Your Boss", desc = "") @Accordion - public OwnBossConfig ownBoss = new OwnBossConfig(); + var ownBoss: OwnBossConfig = OwnBossConfig() @Expose @ConfigOption(name = "Others Boss", desc = "") @Accordion - public OthersBossConfig othersBoss = new OthersBossConfig(); + var othersBoss: OthersBossConfig = OthersBossConfig() @Expose @ConfigOption(name = "Co-op Boss", desc = "") @Accordion - public CoopBossHighlightConfig coopBoss = new CoopBossHighlightConfig(); + var coopBoss: CoopBossHighlightConfig = CoopBossHighlightConfig() @Expose @ConfigOption(name = "Transparency", desc = "Choose the transparency of the color.") - @ConfigEditorSlider(minStep = 1, minValue = 1, maxValue = 250) - public int withAlpha = 80; + @ConfigEditorSlider(minStep = 1f, minValue = 1f, maxValue = 250f) + var withAlpha: Int = 80 @Expose @ConfigOption(name = "See Through Blocks", desc = "Highlight even when behind others mobs/players.") @ConfigEditorBoolean - public boolean seeThrough = false; + var seeThrough: Boolean = false @Expose @ConfigOption(name = "Low Health", desc = "Change color when the boss is below 20% health.") @ConfigEditorBoolean @FeatureToggle - public boolean changeColorWhenCanSteak = true; + var changeColorWhenCanSteak: Boolean = true @Expose @ConfigOption(name = "Can use Steak Color", desc = "Color when the boss is below 20% health.") @ConfigEditorColour - public String steakColor = "0:255:255:0:88"; + var steakColor: String = "0:255:255:0:88" @Expose @ConfigOption(name = "Twinclaws", desc = "Delay the Twinclaws alert for a given amount in milliseconds.") - @ConfigEditorSlider(minStep = 1, minValue = 0, maxValue = 1000) - public int twinclawsDelay = 0; + @ConfigEditorSlider(minStep = 1f, minValue = 0f, maxValue = 1000f) + var twinclawsDelay: Int = 0 @Expose @ConfigOption(name = "Draw Line", desc = "Draw a line starting at your crosshair to the boss head.") @ConfigEditorBoolean @FeatureToggle - public boolean drawLine = false; + var drawLine: Boolean = false @Expose @ConfigOption(name = "Line Color", desc = "Color of the line.") @ConfigEditorColour - public String lineColor = "0:255:255:0:88"; + var lineColor: String = "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 = 1; + @ConfigEditorSlider(minStep = 1f, minValue = 1f, maxValue = 10f) + var lineWidth: Int = 1 @Expose @ConfigOption(name = "Blood Ichor", desc = "") @Accordion - public BloodIchorConfig bloodIchor = new BloodIchorConfig(); + var bloodIchor: BloodIchorConfig = BloodIchorConfig() @Expose @ConfigOption(name = "Killer Spring", desc = "") @Accordion - public KillerSpringConfig killerSpring = new KillerSpringConfig(); + var killerSpring: KillerSpringConfig = KillerSpringConfig() } diff --git a/src/main/java/at/hannibal2/skyhanni/data/TitleManager.kt b/src/main/java/at/hannibal2/skyhanni/data/TitleManager.kt index 8a6c789e9a7b..b20fc257ceac 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/TitleManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/TitleManager.kt @@ -13,20 +13,24 @@ import net.minecraft.client.renderer.GlStateManager import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import org.lwjgl.opengl.GL11 import kotlin.time.Duration -import kotlin.time.Duration.Companion.milliseconds import kotlin.time.Duration.Companion.seconds @SkyHanniModule object TitleManager { - private var originalText = "" + private var currentText = "" private var display = "" private var endTime = SimpleTimeMark.farPast() private var heightModifier = 1.8 private var fontSizeModifier = 4f + @Deprecated("Use LorenzUtils instead", ReplaceWith("LorenzUtils.sendTitle(text, duration, height, fontSize)")) fun sendTitle(text: String, duration: Duration, height: Double, fontSize: Float) { - originalText = text + setTitle(text, duration, height, fontSize) + } + + fun setTitle(text: String, duration: Duration, height: Double, fontSize: Float) { + currentText = text display = "§f$text" endTime = SimpleTimeMark.now() + duration heightModifier = height @@ -34,8 +38,8 @@ object TitleManager { } fun optionalResetTitle(condition: (String) -> Boolean) { - if (condition(originalText)) { - sendTitle("", 1.milliseconds, 1.8, 4f) + if (condition(currentText)) { + stop() } } @@ -55,6 +59,10 @@ object TitleManager { @HandleEvent fun onProfileJoin(event: ProfileJoinEvent) { + stop() + } + + private fun stop() { endTime = SimpleTimeMark.farPast() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt index 787ee632c2bf..ff7bb761931e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt @@ -104,17 +104,14 @@ object BestiaryData { @SubscribeEvent fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { - if (!isEnabled()) return - if (inInventory) { - for (slot in InventoryUtils.getItemsInOpenChest()) { - val stack = slot.stack - val lore = stack.getLore() - if (lore.any { it == "§7Overall Progress: §b100% §7(§c§lMAX!§7)" || it == "§7Families Completed: §a100%" }) { - slot highlight LorenzColor.GREEN - } - if (!overallProgressEnabled && lore.any { it == "§7Overall Progress: §cHIDDEN" }) { - slot highlight LorenzColor.RED - } + if (!isEnabled() || !inInventory) return + for (slot in InventoryUtils.getItemsInOpenChest()) { + val lore = slot.stack.getLore() + if (lore.any { it == "§7Overall Progress: §b100% §7(§c§lMAX!§7)" || it == "§7Families Completed: §a100%" }) { + slot highlight LorenzColor.GREEN + } + if (!overallProgressEnabled && lore.any { it == "§7Overall Progress: §cHIDDEN" }) { + slot highlight LorenzColor.RED } } } @@ -171,7 +168,6 @@ object BestiaryData { for ((index, stack) in stackList) { if (stack.displayName == " ") continue if (!indexes.contains(index)) continue - inInventory = true val name = stack.displayName var familiesFound: Long = 0 var totalFamilies: Long = 0 @@ -200,7 +196,6 @@ object BestiaryData { for ((index, stack) in stackList) { if (stack.displayName == " ") continue if (!indexes.contains(index)) continue - inInventory = true val name = " [IVX0-9]+$".toPattern().matcher(stack.displayName).replaceFirst("") val level = " ([IVX0-9]+$)".toRegex().find(stack.displayName)?.groupValues?.get(1) ?: "0" var totalKillToMax: Long = 0 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 206db62d2961..f5bee31fd25d 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 @@ -44,8 +44,8 @@ object BurrowWarpHelper { HypixelCommands.warp(it.name) lastWarp = currentWarp GriffinBurrowHelper.lastTitleSentTime = SimpleTimeMark.now() + 2.seconds - TitleManager.optionalResetTitle { - it.startsWith("§bWarp to ") + TitleManager.optionalResetTitle { currentTitle -> + currentTitle.startsWith("§bWarp to ") } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/GoldenFishTimer.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/GoldenFishTimer.kt index e60a6a1c1c43..f8cca07fd6bb 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/GoldenFishTimer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/GoldenFishTimer.kt @@ -3,7 +3,6 @@ package at.hannibal2.skyhanni.features.fishing.trophy import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.IslandType -import at.hannibal2.skyhanni.data.TitleManager import at.hannibal2.skyhanni.events.DebugDataCollectEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzChatEvent @@ -256,7 +255,7 @@ object GoldenFishTimer { private fun rodWarning() { if (!config.throwRodWarning || hasWarnedRod) return hasWarnedRod = true - TitleManager.sendTitle("§cThrow your rod!", 5.seconds, 3.6, 7.0f) + LorenzUtils.sendTitle("§cThrow your rod!", 5.seconds, 3.6, 7.0f) SoundUtils.repeatSound(100, 10, SoundUtils.plingSound) } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt index 27c8c56677fc..be1c09a43aef 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt @@ -164,7 +164,7 @@ object GardenAPI { return CropType.entries.firstOrNull { internalName.startsWith(it.toolName) } } - fun readCounter(itemStack: ItemStack): Long = itemStack.getHoeCounter() ?: itemStack.getCultivatingCounter() ?: -1L + fun readCounter(itemStack: ItemStack): Long? = itemStack.getHoeCounter() ?: itemStack.getCultivatingCounter() fun MutableList.addCropIcon( crop: CropType, 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 4527b726f763..cd7fb68dcd55 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/ToolTooltipTweaks.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/ToolTooltipTweaks.kt @@ -13,10 +13,12 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.KeyboardManager.isKeyHeld import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.RegexUtils.find import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getFarmingForDummiesCount import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getReforgeName import at.hannibal2.skyhanni.utils.StringUtils.firstLetterUppercase import at.hannibal2.skyhanni.utils.StringUtils.removeColor +import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.text.DecimalFormat import kotlin.math.roundToInt @@ -26,8 +28,14 @@ object ToolTooltipTweaks { private val config get() = GardenAPI.config.tooltipTweak - private val tooltipFortunePattern = - "^§5§o§7Farming Fortune: §a\\+([\\d.]+)(?: §2\\(\\+\\d\\))?(?: §9\\(\\+(\\d+)\\))?$".toRegex() + /** + * REGEX-TEST: §7Farming Fortune: §a+73 §9(+30) §d(+8) + */ + private val farmingFortunePattern by RepoPattern.pattern( + "garden.tooltip.farmingfortune", + "§7Farming Fortune: §a", + ) + private val counterStartLine = setOf("§5§o§6Logarithmic Counter", "§5§o§6Collection Analysis") private val reforgeEndLine = setOf("§5§o", "§5§o§7chance for multiple crops.") private const val ABILITY_DESCRIPTION_START = "§5§o§7These boots gain §a+2❈ Defense" @@ -67,8 +75,7 @@ object ToolTooltipTweaks { var removingAbilityDescription = false for (line in iterator) { - val match = tooltipFortunePattern.matchEntire(line)?.groups - if (match != null) { + if (farmingFortunePattern.find(line)) { val enchantmentFortune = sunderFortune + harvestingFortune + cultivatingFortune FarmingFortuneDisplay.loadFortuneLineData(itemStack, enchantmentFortune) @@ -89,8 +96,10 @@ object ToolTooltipTweaks { val fortuneLine = when (config.cropTooltipFortune) { CropTooltipFortuneEntry.DEFAULT -> "§7Farming Fortune: §a+${displayedFortune.formatStat()}$ffdString$reforgeString" + CropTooltipFortuneEntry.SHOW -> "§7Farming Fortune: §a+${displayedFortune.formatStat()}$ffdString$reforgeString$cropString" + else -> "§7Farming Fortune: §a+${totalFortune.formatStat()}$ffdString$reforgeString$cropString" } 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 81c4b340f5a7..35f20292577f 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 @@ -112,8 +112,7 @@ object GardenCropMilestoneDisplay { try { val item = event.itemStack - val counter = GardenAPI.readCounter(item) - if (counter == -1L) return + val counter = GardenAPI.readCounter(item) ?: return val crop = item.getCropType() ?: return if (cultivatingData.containsKey(crop)) { val old = cultivatingData[crop]!! @@ -206,7 +205,7 @@ object GardenCropMilestoneDisplay { val speedText = "§7In §b$duration" lineMap[MilestoneTextEntry.TIME] = Renderable.string(speedText) GardenAPI.itemInHand?.let { - if (GardenAPI.readCounter(it) == -1L) { + if (GardenAPI.readCounter(it) == null) { lineMap[MilestoneTextEntry.TIME] = Renderable.string("$speedText §7Inaccurate!") } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFGuideGUI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFGuideGUI.kt index 8912bd4d1618..56242df5fdc5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFGuideGUI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFGuideGUI.kt @@ -18,7 +18,7 @@ import net.minecraft.item.ItemStack class FFGuideGUI : GuideGUI(FortuneGuidePage.OVERVIEW) { override val sizeX = 360 - override val sizeY = 200 + override val sizeY = 225 companion object { @@ -66,10 +66,10 @@ class FFGuideGUI : GuideGUI(FortuneGuidePage.OVERVI }, vTab( ItemStack(Items.map), - Renderable.string("§eUpgrades") + Renderable.string("§eUpgrades"), ) { currentPage = FortuneGuidePage.UPGRADES - } + }, ) horizontalTabs = buildList { add( @@ -77,7 +77,7 @@ class FFGuideGUI : GuideGUI(FortuneGuidePage.OVERVI currentCrop = null it.pageSwitchHorizontal() - } + }, ) for (crop in CropType.entries) { add( @@ -85,7 +85,7 @@ class FFGuideGUI : GuideGUI(FortuneGuidePage.OVERVI currentCrop = crop it.pageSwitchHorizontal() - } + }, ) } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFInfos.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFInfos.kt index 61a12dbd963e..b4b97dfbaf80 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFInfos.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFInfos.kt @@ -84,7 +84,7 @@ internal enum class FFInfos( FarmingItems.MOOSHROOM_COW -> 158 FarmingItems.BEE -> 30 FarmingItems.SLUG -> 100 - FarmingItems.HEDGEHOG -> 45 + FarmingItems.HEDGEHOG -> 45 * 3 else -> 0 } }, diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFStats.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFStats.kt index 86f008344a00..e1bcf5a23859 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFStats.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFStats.kt @@ -11,15 +11,12 @@ import at.hannibal2.skyhanni.utils.SimpleTimeMark import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getFarmingForDummiesCount import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getPetItem import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getPetLevel +import at.hannibal2.skyhanni.utils.SkyBlockTime import net.minecraft.item.ItemStack import kotlin.math.floor object FFStats { - @Suppress("PropertyWrapping") - private val mathCrops = setOf(CropType.WHEAT, CropType.CARROT, CropType.POTATO, CropType.SUGAR_CANE, CropType.NETHER_WART) - private val dicerCrops = setOf(CropType.PUMPKIN, CropType.MELON) - private val farmingBoots = setOf("RANCHERS_BOOTS", "FARMER_BOOTS") var cakeExpireTime @@ -64,7 +61,7 @@ object FFStats { FarmingFortuneDisplay.loadFortuneLineData(tool, 0.0) when (crop) { - in mathCrops -> { + CropType.WHEAT, CropType.CARROT, CropType.POTATO, CropType.SUGAR_CANE, CropType.NETHER_WART -> { FortuneStats.BASE_TOOL.set(FarmingFortuneDisplay.getToolFortune(tool), 50.0) FortuneStats.COUNTER.set(FarmingFortuneDisplay.getCounterFortune(tool), 96.0) FortuneStats.HARVESTING.set(FarmingFortuneDisplay.getHarvestingFortune(tool), 75.0) @@ -73,7 +70,7 @@ object FFStats { FortuneStats.GEMSTONE.set(FarmingFortuneDisplay.gemstoneFortune, 30.0) } - in dicerCrops -> { + CropType.PUMPKIN, CropType.MELON -> { FortuneStats.SUNDER.set(FarmingFortuneDisplay.getSunderFortune(tool), 75.0) FortuneStats.REFORGE.set(FarmingFortuneDisplay.reforgeFortune, 20.0) FortuneStats.GEMSTONE.set(FarmingFortuneDisplay.gemstoneFortune, 30.0) @@ -188,7 +185,7 @@ object FFStats { rawInternalName.contains("BEE;2") -> 0.2 * petLevel rawInternalName.contains("BEE;3") || rawInternalName.contains("BEE;4") -> 0.3 * petLevel rawInternalName.contains("SLUG;4") -> 1.0 * petLevel - rawInternalName.contains("HEDGEHOG;4") -> 0.45 * petLevel + rawInternalName.contains("HEDGEHOG;4") -> 0.45 * petLevel * if (SkyBlockTime.isDay()) 1.0 else 3.0 else -> 0.0 } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/CropPage.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/CropPage.kt index 6494986afbb0..3e88ec3a4d4e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/CropPage.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/CropPage.kt @@ -70,7 +70,7 @@ class CropPage(val crop0: () -> CropType, sizeX: Int, sizeY: Int, paddingX: Int 2, verticalAlign = RenderUtils.VerticalAlignment.BOTTOM, ), - 164, + sizeY - 36, horizontalAlign = RenderUtils.HorizontalAlignment.CENTER, verticalAlign = RenderUtils.VerticalAlignment.BOTTOM, ) diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/OverviewPage.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/OverviewPage.kt index bd70d96cf18b..f4a593ccd669 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/OverviewPage.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/OverviewPage.kt @@ -11,10 +11,9 @@ import at.hannibal2.skyhanni.utils.TimeUtils.format import at.hannibal2.skyhanni.utils.guide.GuideTablePage import at.hannibal2.skyhanni.utils.renderables.Renderable -class OverviewPage(sizeX: Int, sizeY: Int, paddingX: Int = 15, paddingY: Int = 7, footerSpacing: Int = 6) : - GuideTablePage( - sizeX, sizeY, paddingX, paddingY, footerSpacing, - ) { +class OverviewPage(sizeX: Int, sizeY: Int, paddingX: Int = 15, paddingY: Int = 7, footerSpacing: Int = 6) : GuideTablePage( + sizeX, sizeY, paddingX, paddingY, footerSpacing, +) { override fun onEnter() { val (content, footer) = getPage() @@ -209,20 +208,17 @@ class OverviewPage(sizeX: Int, sizeY: Int, paddingX: Int = 15, paddingY: Int = 7 ), ) - footer.add( - Renderable.horizontalContainer( - FarmingItems.getPetsDisplay(true), - 4, - horizontalAlign = RenderUtils.HorizontalAlignment.CENTER, - verticalAlign = RenderUtils.VerticalAlignment.CENTER, - ), + val petFooter = Renderable.horizontalContainer( + FarmingItems.getPetsDisplay(true), + 4, + horizontalAlign = RenderUtils.HorizontalAlignment.CENTER, + verticalAlign = RenderUtils.VerticalAlignment.CENTER, ) footer.add( FFInfos.TOTAL_PET.bar( "§2Total Pet Fortune", "§7§2The total fortune from your pet and its item", - 72, ), ) @@ -230,7 +226,6 @@ class OverviewPage(sizeX: Int, sizeY: Int, paddingX: Int = 15, paddingY: Int = 7 FFInfos.PET_BASE.bar( "§2Base Pet Fortune", "§7§2The base fortune from your pet", - 72, ), ) @@ -243,7 +238,6 @@ class OverviewPage(sizeX: Int, sizeY: Int, paddingX: Int = 15, paddingY: Int = 7 "MINOS_RELIC" -> "§cGreen Bandana is better for fortune than minos relic!" else -> "No fortune boosting pet item" }, - 72, ), ) @@ -268,7 +262,21 @@ class OverviewPage(sizeX: Int, sizeY: Int, paddingX: Int = 15, paddingY: Int = 7 ), ) - return content to footer + val realFooter = Renderable.verticalContainer( + listOf( + petFooter, + Renderable.horizontalContainer( + footer, + spacing = 15, + horizontalAlign = RenderUtils.HorizontalAlignment.CENTER, verticalAlign = RenderUtils.VerticalAlignment.CENTER, + ), + ), + spacing = 2, + horizontalAlign = RenderUtils.HorizontalAlignment.CENTER, + verticalAlign = RenderUtils.VerticalAlignment.CENTER, + ) + + return content to listOf(realFooter) } private fun FFTypes.notSaved(): Boolean = FFStats.baseFF[this]?.let { diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CopyPlaytime.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CopyPlaytime.kt index 347d47667383..8dacba5f8016 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/CopyPlaytime.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CopyPlaytime.kt @@ -3,11 +3,11 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.data.HypixelData import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.LorenzToolTipEvent -import at.hannibal2.skyhanni.features.misc.limbo.LimboPlaytime import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.ClipboardUtils import at.hannibal2.skyhanni.utils.InventoryUtils +import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.StringUtils.firstLetterUppercase import at.hannibal2.skyhanni.utils.StringUtils.removeColor @@ -32,7 +32,7 @@ object CopyPlaytime { if (event.clickedButton != 0) return event.cancel() - val text = LimboPlaytime.tooltipPlaytime.dropLast(2).toMutableList() + val text = event.item?.getLore()?.toMutableList() ?: return val profile = HypixelData.profileName.firstLetterUppercase() text.add(0, "${LorenzUtils.getPlayerName()}'s - $profile Playtime Stats") diff --git a/src/main/java/at/hannibal2/skyhanni/test/graph/GraphEditor.kt b/src/main/java/at/hannibal2/skyhanni/test/graph/GraphEditor.kt index 299637565eb0..635121313946 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/graph/GraphEditor.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/graph/GraphEditor.kt @@ -42,6 +42,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable import java.awt.Color import kotlin.math.min +import kotlin.time.Duration.Companion.seconds @Suppress("LargeClass") @SkyHanniModule @@ -221,6 +222,8 @@ object GraphEditor { if (nodesToFind.isEmpty()) { currentNodeToFind = null ChatUtils.chat("Found all nodes on this island") + LorenzUtils.sendTitle("§eAll Found!", 3.seconds) + active = false return } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt index f2992de196ac..5b7d741c0933 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt @@ -286,7 +286,7 @@ object LorenzUtils { val JsonPrimitive.asIntOrNull get() = takeIf { it.isNumber }?.asInt fun sendTitle(text: String, duration: Duration, height: Double = 1.8, fontSize: Float = 4f) { - TitleManager.sendTitle(text, duration, height, fontSize) + TitleManager.setTitle(text, duration, height, fontSize) } inline fun > enumValueOfOrNull(name: String): T? { diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockTime.kt b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockTime.kt index 4f49a64b829a..c9b1d3bfe7d4 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockTime.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockTime.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.utils +import net.minecraft.client.Minecraft import java.time.Instant /** @@ -46,8 +47,8 @@ data class SkyBlockTime( Instant.ofEpochMilli( SKYBLOCK_EPOCH_START_MILLIS + (SKYBLOCK_YEAR_MILLIS * year) + - (SKYBLOCK_MONTH_MILLIS * (season.getMonth(modifier))) - ) + (SKYBLOCK_MONTH_MILLIS * (season.getMonth(modifier))), + ), ) } @@ -77,7 +78,7 @@ data class SkyBlockTime( day: Int, hour: Int, minute: Int, - second: Int + second: Int, ): Long { var time = 0L time += year * SKYBLOCK_YEAR_MILLIS @@ -123,6 +124,8 @@ data class SkyBlockTime( val millis = toMillis() + duration.inWholeMilliseconds return fromInstant(Instant.ofEpochMilli(millis)) } + + fun isDay(): Boolean = Minecraft.getMinecraft().theWorld.worldTime % 24000 in 1..12000 } }