From f881d99d5594362e5561b6971d25fdd9b78d787e Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 10 Jul 2023 19:33:48 +0200 Subject: Small rift config changes --- src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt | 18 +- .../java/at/hannibal2/skyhanni/config/Storage.java | 2 +- .../skyhanni/config/features/RiftConfig.java | 593 ++++++++++++--------- .../skyhanni/features/bazaar/BazaarDataHolder.kt | 2 +- .../skyhanni/features/damageindicator/MobFinder.kt | 2 +- .../features/inventory/HideNotClickableItems.kt | 2 +- .../skyhanni/features/misc/CurrentPetDisplay.kt | 2 +- .../features/misc/NonGodPotEffectDisplay.kt | 2 +- .../features/misc/discordrpc/DiscordStatus.kt | 2 +- .../skyhanni/features/rift/CruxTalismanDisplay.kt | 127 ----- .../skyhanni/features/rift/DanceRoomHelper.kt | 173 ------ .../skyhanni/features/rift/EnigmaSoulWaypoints.kt | 182 ------- .../skyhanni/features/rift/HighlightRiftGuide.kt | 63 --- .../skyhanni/features/rift/KloonHacking.kt | 158 ------ .../skyhanni/features/rift/KloonTerminal.kt | 14 - .../features/rift/LivingMetalSuitProgress.kt | 95 ---- .../at/hannibal2/skyhanni/features/rift/RiftAPI.kt | 19 - .../skyhanni/features/rift/RiftAgaricusCap.kt | 70 --- .../hannibal2/skyhanni/features/rift/RiftLarva.kt | 51 -- .../skyhanni/features/rift/RiftLavaMazeParkour.kt | 75 --- .../skyhanni/features/rift/RiftOdonata.kt | 51 -- .../hannibal2/skyhanni/features/rift/RiftTimer.kt | 4 +- .../features/rift/RiftUpsideDownParkour.kt | 76 --- .../features/rift/ShowMotesNpcSellPrice.kt | 3 +- .../skyhanni/features/rift/ShyCruxWarnings.kt | 27 - .../skyhanni/features/rift/TubulatorParkour.kt | 70 --- .../skyhanni/features/rift/VoltHighlighter.kt | 119 ----- .../skyhanni/features/rift/area/RiftLarva.kt | 51 ++ .../rift/area/dreadfarm/RiftAgaricusCap.kt | 70 +++ .../rift/area/dreadfarm/VoltHighlighter.kt | 120 +++++ .../area/livingcave/LivingMetalSuitProgress.kt | 95 ++++ .../rift/area/mirrorverse/DanceRoomHelper.kt | 173 ++++++ .../rift/area/mirrorverse/RiftLavaMazeParkour.kt | 75 +++ .../rift/area/mirrorverse/RiftUpsideDownParkour.kt | 76 +++ .../rift/area/mirrorverse/TubulatorParkour.kt | 70 +++ .../features/rift/area/westvillage/KloonHacking.kt | 159 ++++++ .../rift/area/westvillage/KloonTerminal.kt | 14 + .../features/rift/area/wyldwoods/RiftOdonata.kt | 51 ++ .../rift/area/wyldwoods/ShyCruxWarnings.kt | 28 + .../rift/everywhere/CruxTalismanDisplay.kt | 126 +++++ .../rift/everywhere/EnigmaSoulWaypoints.kt | 181 +++++++ .../features/rift/everywhere/HighlightRiftGuide.kt | 61 +++ .../skyhanni/features/rift/everywhere/RiftAPI.kt | 19 + 43 files changed, 1733 insertions(+), 1638 deletions(-) delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/CruxTalismanDisplay.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/DanceRoomHelper.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/EnigmaSoulWaypoints.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/HighlightRiftGuide.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/KloonHacking.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/KloonTerminal.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/LivingMetalSuitProgress.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/RiftAgaricusCap.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/RiftLarva.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/RiftLavaMazeParkour.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/RiftOdonata.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/RiftUpsideDownParkour.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/ShyCruxWarnings.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/TubulatorParkour.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/VoltHighlighter.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/area/RiftLarva.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftAgaricusCap.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/VoltHighlighter.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingMetalSuitProgress.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/DanceRoomHelper.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/RiftLavaMazeParkour.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/RiftUpsideDownParkour.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/TubulatorParkour.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/KloonHacking.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/KloonTerminal.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/area/wyldwoods/RiftOdonata.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/area/wyldwoods/ShyCruxWarnings.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/CruxTalismanDisplay.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/HighlightRiftGuide.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftAPI.kt diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt index 29746e638..c16efdb36 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt @@ -60,7 +60,23 @@ import at.hannibal2.skyhanni.features.mobs.AshfangMinisNametagHider import at.hannibal2.skyhanni.features.mobs.MobHighlight import at.hannibal2.skyhanni.features.nether.ashfang.* import at.hannibal2.skyhanni.features.nether.reputationhelper.CrimsonIsleReputationHelper -import at.hannibal2.skyhanni.features.rift.* +import at.hannibal2.skyhanni.features.rift.RiftTimer +import at.hannibal2.skyhanni.features.rift.ShowMotesNpcSellPrice +import at.hannibal2.skyhanni.features.rift.area.RiftLarva +import at.hannibal2.skyhanni.features.rift.area.dreadfarm.RiftAgaricusCap +import at.hannibal2.skyhanni.features.rift.area.dreadfarm.VoltHighlighter +import at.hannibal2.skyhanni.features.rift.area.livingcave.LivingMetalSuitProgress +import at.hannibal2.skyhanni.features.rift.area.mirrorverse.DanceRoomHelper +import at.hannibal2.skyhanni.features.rift.area.mirrorverse.RiftLavaMazeParkour +import at.hannibal2.skyhanni.features.rift.area.mirrorverse.RiftUpsideDownParkour +import at.hannibal2.skyhanni.features.rift.area.mirrorverse.TubulatorParkour +import at.hannibal2.skyhanni.features.rift.area.westvillage.KloonHacking +import at.hannibal2.skyhanni.features.rift.area.wyldwoods.RiftOdonata +import at.hannibal2.skyhanni.features.rift.area.wyldwoods.ShyCruxWarnings +import at.hannibal2.skyhanni.features.rift.everywhere.CruxTalismanDisplay +import at.hannibal2.skyhanni.features.rift.everywhere.EnigmaSoulWaypoints +import at.hannibal2.skyhanni.features.rift.everywhere.HighlightRiftGuide +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI import at.hannibal2.skyhanni.features.slayer.* import at.hannibal2.skyhanni.features.slayer.blaze.BlazeSlayerClearView import at.hannibal2.skyhanni.features.slayer.blaze.BlazeSlayerDaggerHelper diff --git a/src/main/java/at/hannibal2/skyhanni/config/Storage.java b/src/main/java/at/hannibal2/skyhanni/config/Storage.java index a1f9fbfb1..b55e410fe 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/Storage.java +++ b/src/main/java/at/hannibal2/skyhanni/config/Storage.java @@ -7,7 +7,7 @@ import at.hannibal2.skyhanni.features.garden.fortuneguide.FarmingItems; import at.hannibal2.skyhanni.features.garden.visitor.VisitorReward; import at.hannibal2.skyhanni.features.misc.FrozenTreasure; import at.hannibal2.skyhanni.features.misc.GhostCounter.Option; -import at.hannibal2.skyhanni.features.rift.KloonTerminal; +import at.hannibal2.skyhanni.features.rift.area.westvillage.KloonTerminal; import at.hannibal2.skyhanni.utils.LorenzVec; import com.google.gson.annotations.Expose; import net.minecraft.item.ItemStack; diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java index f164750e3..702791dc0 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java @@ -34,40 +34,6 @@ public class RiftConfig { } - @ConfigOption(name = "Crux Warnings", desc = "") - @Accordion - @Expose - public CruxWarnings crux = new CruxWarnings(); - - public static class CruxWarnings { - - @Expose - @ConfigOption(name = "Shy Warning", desc = "Shows a warning when a shy is going to steal your time. " + - "Useful if you play without volume.") - @ConfigEditorBoolean - public boolean shyWarning = true; - - @Expose - @ConfigOption(name = "Volt Warning", desc = "Shows a warning while a volt is discharging lightning.") - @ConfigEditorBoolean - public boolean voltWarning = true; - - @Expose - @ConfigOption(name = "Volt Range Highlighter", desc = "Shows the area in which a Volt might strike lightning.") - @ConfigEditorBoolean - public boolean voltRange = true; - - @Expose - @ConfigOption(name = "Volt Range Highlighter Color", desc = "In which color should the volt range be highlighted?") - @ConfigEditorColour - public String voltColour = "0:60:0:0:255"; - - @Expose - @ConfigOption(name = "Volt mood color", desc = "Change the color of the volt enemy depending on their mood.") - @ConfigEditorBoolean - public boolean voltMoodMeter = false; - } - @ConfigOption(name = "Crux Talisman Progress", desc = "") @Accordion @Expose @@ -77,7 +43,7 @@ public class RiftConfig { @Expose @ConfigOption(name = "Crux Talisman Display", desc = "Display progress of the Crux Talisman on screen.") @ConfigEditorBoolean - public boolean enabled = true; + public boolean enabled = false; @Expose @ConfigOption(name = "Compact", desc = "Show a compacted version of the overlay when the talisman is maxed.") @@ -93,339 +59,452 @@ public class RiftConfig { public Position position = new Position(144, 139, false, true); } - @ConfigOption(name = "Larvas", desc = "") + @ConfigOption(name = "Enigma Soul Waypoints", desc = "") @Accordion @Expose - public LarvasConfig larvas = new LarvasConfig(); + public EnigmaSoulConfig enigmaSoulWaypoints = new EnigmaSoulConfig(); - public static class LarvasConfig { + public static class EnigmaSoulConfig { @Expose - @ConfigOption(name = "Highlight", desc = "Highlight §cLarvas on trees §7while holding a §eLarva Hook §7in the hand.") + @ConfigOption(name = "Enabled", desc = "Click on Enigma Souls in Rift Guides to highlight their location.") @ConfigEditorBoolean - public boolean highlight = true; + public boolean enabled = true; @Expose - @ConfigOption(name = "Color", desc = "Color of the Larvas.") + @ConfigOption(name = "Color", desc = "Color of the Enigma Souls.") @ConfigEditorColour - public String highlightColor = "0:120:13:49:255"; + public String color = "0:120:13:49:255"; } - @ConfigOption(name = "Odonatas", desc = "") + @ConfigOption(name = "Rift Areas", desc = "") @Accordion @Expose - public OdonataConfig odonata = new OdonataConfig(); + public RiftAreasConfig area = new RiftAreasConfig(); - public static class OdonataConfig { + public static class RiftAreasConfig { + @ConfigOption(name = "Wyld Woods", desc = "") + @Accordion @Expose - @ConfigOption(name = "Highlight", desc = "Highlight the small §cOdonatas §7flying around the trees while holding a " + - "§eEmpty Odonata Bottle §7in the hand.") - @ConfigEditorBoolean - public boolean highlight = true; + public WyldWoodsConfig wyldWoodsConfig = new WyldWoodsConfig(); - @Expose - @ConfigOption(name = "Color", desc = "Color of the Odonatas.") - @ConfigEditorColour - public String highlightColor = "0:120:13:49:255"; + public static class WyldWoodsConfig { - } + @Expose + @ConfigOption(name = "Shy Crux Warning", desc = "Shows a warning when a Shy Crux is going to steal your time. " + + "Useful if you play without volume.") + @ConfigEditorBoolean + public boolean shyWarning = true; - @ConfigOption(name = "Enigma Soul Waypoints", desc = "") - @Accordion - @Expose - public EnigmaSoulConfig enigmaSoulWaypoints = new EnigmaSoulConfig(); + @ConfigOption(name = "Larvas", desc = "") + @Accordion + @Expose + public LarvasConfig larvas = new LarvasConfig(); - public static class EnigmaSoulConfig { + public static class LarvasConfig { - @Expose - @ConfigOption(name = "Enabled", desc = "Click on Enigma Souls in Rift Guides to highlight their location.") - @ConfigEditorBoolean - public boolean enabled = true; + @Expose + @ConfigOption(name = "Highlight", desc = "Highlight §cLarvas on trees §7while holding a §eLarva Hook §7in the hand.") + @ConfigEditorBoolean + public boolean highlight = true; - @Expose - @ConfigOption(name = "Color", desc = "Color of the Enigma Souls.") - @ConfigEditorColour - public String color = "0:120:13:49:255"; + @Expose + @ConfigOption(name = "Color", desc = "Color of the Larvas.") + @ConfigEditorColour + public String highlightColor = "0:120:13:49:255"; - } + } - @Expose - @ConfigOption(name = "Highlight Guide", desc = "Highlight things to do in the Rift Guide.") - @ConfigEditorBoolean - public boolean highlightGuide = true; + @ConfigOption(name = "Odonatas", desc = "") + @Accordion + @Expose + public OdonataConfig odonata = new OdonataConfig(); - @Expose - @ConfigOption(name = "Agaricus Cap", desc = "Counts down the time until §eAgaricus Cap (Mushroom) " + - "§7changes color from brown to red and is breakable.") - @ConfigEditorBoolean - public boolean agaricusCap = true; + public static class OdonataConfig { - @ConfigOption(name = "Mirror Verse", desc = "") - @Accordion - @Expose - public MirrorVerse mirrorVerse = new MirrorVerse(); + @Expose + @ConfigOption(name = "Highlight", desc = "Highlight the small §cOdonatas §7flying around the trees while holding a " + + "§eEmpty Odonata Bottle §7in the hand.") + @ConfigEditorBoolean + public boolean highlight = true; - public static class MirrorVerse { + @Expose + @ConfigOption(name = "Color", desc = "Color of the Odonatas.") + @ConfigEditorColour + public String highlightColor = "0:120:13:49:255"; + + } + } - @ConfigOption(name = "Lava Maze", desc = "") + @ConfigOption(name = "West Village", desc = "") @Accordion @Expose - public LavaMazeConfig lavaMazeConfig = new LavaMazeConfig(); - public static class LavaMazeConfig { + public WestVillageConfig westVillageConfig = new WestVillageConfig(); - @Expose - @ConfigOption(name = "Enabled", desc = "Helps solving the lava maze in the mirror verse by showing the correct way.") - @ConfigEditorBoolean - public boolean enabled = true; + public static class WestVillageConfig { + @ConfigOption(name = "Kloon Hacking", desc = "") + @Accordion @Expose - @ConfigOption(name = "Look Ahead", desc = "Change how many platforms should be shown in front of you.") - @ConfigEditorSlider(minStep = 1, maxValue = 30, minValue = 1) - public Property lookAhead = Property.of(3); + public KloonHacking hacking = new KloonHacking(); - @Expose - @ConfigOption(name = "Rainbow Color", desc = "Show the rainbow color effect instead of a boring monochrome.") - @ConfigEditorBoolean - public Property rainbowColor = Property.of(true); + public static class KloonHacking { - @Expose - @ConfigOption(name = "Monochrome Color", desc = "Set a boring monochrome color for the parkour platforms.") - @ConfigEditorColour - public Property monochromeColor = Property.of("0:60:0:0:255"); + @Expose + @ConfigOption(name = "Hacking Solver", desc = "Highlights the correct button to click in the hacking inventory.") + @ConfigEditorBoolean + public boolean solver = true; - @Expose - @ConfigOption(name = "Hide others players", desc = "Hide other players while doing the lava maze.") - @ConfigEditorBoolean - public boolean hidePlayers = false; - } + @Expose + @ConfigOption(name = "Color Guide", desc = "Tells you which colour to pick.") + @ConfigEditorBoolean + public boolean colour = true; + @Expose + @ConfigOption(name = "Terminal Waypoints", desc = "While wearing the helmet, waypoints will appear at each terminal location.") + @ConfigEditorBoolean + public boolean waypoints = true; + } + } - @ConfigOption(name = "Upside Down Parkour", desc = "") - @Accordion @Expose - public UpsideDownParkour upsideDownParkour = new UpsideDownParkour(); - public static class UpsideDownParkour { + @ConfigOption(name = "Dreadfarm", desc = "") + @Accordion + public DreadfarmConfig dreadfarmConfig = new DreadfarmConfig(); + public static class DreadfarmConfig { @Expose - @ConfigOption(name = "Enabled", desc = "Helps solving the upside down parkour in the mirror verse by showing the correct way.") + @ConfigOption(name = "Agaricus Cap", desc = "Counts down the time until §eAgaricus Cap (Mushroom) " + + "§7changes color from brown to red and is breakable.") @ConfigEditorBoolean - public boolean enabled = true; + public boolean agaricusCap = true; + @ConfigOption(name = "Volt Crux", desc = "") + @Accordion @Expose - @ConfigOption(name = "Look Ahead", desc = "Change how many platforms should be shown in front of you.") - @ConfigEditorSlider(minStep = 1, maxValue = 9, minValue = 1) - public Property lookAhead = Property.of(3); + public VoltCruxConfig voltCrux = new VoltCruxConfig(); - @Expose - @ConfigOption(name = "Outline", desc = "Outlines the top edge of the platforms.") - @ConfigEditorBoolean - public boolean outline = true; + public static class VoltCruxConfig { - @Expose - @ConfigOption(name = "Rainbow Color", desc = "Show the rainbow color effect instead of a boring monochrome.") - @ConfigEditorBoolean - public Property rainbowColor = Property.of(true); + @Expose + @ConfigOption(name = "Volt Warning", desc = "Shows a warning while a volt is discharging lightning.") + @ConfigEditorBoolean + public boolean voltWarning = true; - @Expose - @ConfigOption(name = "Monochrome Color", desc = "Set a boring monochrome color for the parkour platforms.") - @ConfigEditorColour - public Property monochromeColor = Property.of("0:60:0:0:255"); + @Expose + @ConfigOption(name = "Volt Range Highlighter", desc = "Shows the area in which a Volt might strike lightning.") + @ConfigEditorBoolean + public boolean voltRange = true; - @Expose - @ConfigOption(name = "Hide others players", desc = "Hide other players while doing the upside down parkour.") - @ConfigEditorBoolean - public boolean hidePlayers = false; - } + @Expose + @ConfigOption(name = "Volt Range Highlighter Color", desc = "In which color should the volt range be highlighted?") + @ConfigEditorColour + public String voltColour = "0:60:0:0:255"; + @Expose + @ConfigOption(name = "Volt mood color", desc = "Change the color of the volt enemy depending on their mood.") + @ConfigEditorBoolean + public boolean voltMoodMeter = false; + } + } - @ConfigOption(name = "Dance Room Helper", desc = "") + @ConfigOption(name = "Mirror Verse", desc = "") @Accordion @Expose - public DanceRoomHelper danceRoomHelper = new DanceRoomHelper(); - public static class DanceRoomHelper { + public MirrorVerse mirrorVerseConfig = new MirrorVerse(); - @Expose - @ConfigOption(name = "Enabled", desc = "Helps to solve the dance room in the mirror verse by showing multiple tasks at once.") - @ConfigEditorBoolean - public boolean enabled = false; + public static class MirrorVerse { + @ConfigOption(name = "Lava Maze", desc = "") + @Accordion @Expose - @ConfigOption(name = "Lines to show", desc = "How many tasks you should see.") - @ConfigEditorSlider(minStep = 1, maxValue = 49, minValue = 1) - public int lineToShow = 3; + public LavaMazeConfig lavaMazeConfig = new LavaMazeConfig(); - @Expose - @ConfigOption(name = "Space", desc = "Change the space between each line.") - @ConfigEditorSlider(minStep = 1, maxValue = 10, minValue = -5) - public int extraSpace = 0; + public static class LavaMazeConfig { - @Expose - @ConfigOption(name = "Hide others players", desc = "Hide other players inside the dance room.") - @ConfigEditorBoolean - public boolean hidePlayers = false; + @Expose + @ConfigOption(name = "Enabled", desc = "Helps solving the lava maze in the mirror verse by showing the correct way.") + @ConfigEditorBoolean + public boolean enabled = true; + + @Expose + @ConfigOption(name = "Look Ahead", desc = "Change how many platforms should be shown in front of you.") + @ConfigEditorSlider(minStep = 1, maxValue = 30, minValue = 1) + public Property lookAhead = Property.of(3); + + @Expose + @ConfigOption(name = "Rainbow Color", desc = "Show the rainbow color effect instead of a boring monochrome.") + @ConfigEditorBoolean + public Property rainbowColor = Property.of(true); + + @Expose + @ConfigOption(name = "Monochrome Color", desc = "Set a boring monochrome color for the parkour platforms.") + @ConfigEditorColour + public Property monochromeColor = Property.of("0:60:0:0:255"); + + @Expose + @ConfigOption(name = "Hide others players", desc = "Hide other players while doing the lava maze.") + @ConfigEditorBoolean + public boolean hidePlayers = false; + } - @Expose - @ConfigOption(name = "Hide Title", desc = "Hide Instructions, \"§aIt's happening!\" §7and \"§aKeep it up!\" §7titles.") - @ConfigEditorBoolean - public boolean hideOriginalTitle = false; + @ConfigOption(name = "Upside Down Parkour", desc = "") + @Accordion @Expose - @ConfigOption(name = "Formatting", desc = "") + public UpsideDownParkour upsideDownParkour = new UpsideDownParkour(); + + public static class UpsideDownParkour { + + @Expose + @ConfigOption(name = "Enabled", desc = "Helps solving the upside down parkour in the mirror verse by showing the correct way.") + @ConfigEditorBoolean + public boolean enabled = true; + + @Expose + @ConfigOption(name = "Look Ahead", desc = "Change how many platforms should be shown in front of you.") + @ConfigEditorSlider(minStep = 1, maxValue = 9, minValue = 1) + public Property lookAhead = Property.of(3); + + @Expose + @ConfigOption(name = "Outline", desc = "Outlines the top edge of the platforms.") + @ConfigEditorBoolean + public boolean outline = true; + + @Expose + @ConfigOption(name = "Rainbow Color", desc = "Show the rainbow color effect instead of a boring monochrome.") + @ConfigEditorBoolean + public Property rainbowColor = Property.of(true); + + @Expose + @ConfigOption(name = "Monochrome Color", desc = "Set a boring monochrome color for the parkour platforms.") + @ConfigEditorColour + public Property monochromeColor = Property.of("0:60:0:0:255"); + + @Expose + @ConfigOption(name = "Hide others players", desc = "Hide other players while doing the upside down parkour.") + @ConfigEditorBoolean + public boolean hidePlayers = false; + } + + + @ConfigOption(name = "Dance Room Helper", desc = "") @Accordion - public DanceRoomFormatting danceRoomFormatting = new DanceRoomFormatting(); + @Expose + public DanceRoomHelper danceRoomHelper = new DanceRoomHelper(); - public static class DanceRoomFormatting { + public static class DanceRoomHelper { @Expose - @ConfigOption(name = "Now", desc = "Formatting for \"Now:\"") - @ConfigEditorText - public String now = "&7Now:"; + @ConfigOption(name = "Enabled", desc = "Helps to solve the dance room in the mirror verse by showing multiple tasks at once.") + @ConfigEditorBoolean + public boolean enabled = false; @Expose - @ConfigOption(name = "Next", desc = "Formatting for \"Next:\"") - @ConfigEditorText - public String next = "&7Next:"; + @ConfigOption(name = "Lines to show", desc = "How many tasks you should see.") + @ConfigEditorSlider(minStep = 1, maxValue = 49, minValue = 1) + public int lineToShow = 3; @Expose - @ConfigOption(name = "Later", desc = "Formatting for \"Later:\"") - @ConfigEditorText - public String later = "&7Later:"; + @ConfigOption(name = "Space", desc = "Change the space between each line.") + @ConfigEditorSlider(minStep = 1, maxValue = 10, minValue = -5) + public int extraSpace = 0; @Expose - @ConfigOption(name = "Color Option", desc = "") - @Accordion - public Color color = new Color(); - public static class Color { - @Expose - @ConfigOption(name = "Move", desc = "Color for the Move instruction") - @ConfigEditorText - public String move = "&e"; + @ConfigOption(name = "Hide others players", desc = "Hide other players inside the dance room.") + @ConfigEditorBoolean + public boolean hidePlayers = false; - @Expose - @ConfigOption(name = "Stand", desc = "Color for the Stand instruction") - @ConfigEditorText - public String stand = "&e"; + @Expose + @ConfigOption(name = "Hide Title", desc = "Hide Instructions, \"§aIt's happening!\" §7and \"§aKeep it up!\" §7titles.") + @ConfigEditorBoolean + public boolean hideOriginalTitle = false; - @Expose - @ConfigOption(name = "Sneak", desc = "Color for the Sneak instruction") - @ConfigEditorText - public String sneak = "&5"; + @Expose + @ConfigOption(name = "Formatting", desc = "") + @Accordion + public DanceRoomFormatting danceRoomFormatting = new DanceRoomFormatting(); + + public static class DanceRoomFormatting { @Expose - @ConfigOption(name = "Jump", desc = "Color for the Jump instruction") + @ConfigOption(name = "Now", desc = "Formatting for \"Now:\"") @ConfigEditorText - public String jump = "&b"; + public String now = "&7Now:"; @Expose - @ConfigOption(name = "Punch", desc = "Color for the Punch instruction") + @ConfigOption(name = "Next", desc = "Formatting for \"Next:\"") @ConfigEditorText - public String punch = "&d"; + public String next = "&7Next:"; @Expose - @ConfigOption(name = "Countdown", desc = "Color for the Countdown") + @ConfigOption(name = "Later", desc = "Formatting for \"Later:\"") @ConfigEditorText - public String countdown = "&f"; + public String later = "&7Later:"; @Expose - @ConfigOption(name = "Default", desc = "Fallback color") - @ConfigEditorText - public String fallback = "&f"; + @ConfigOption(name = "Color Option", desc = "") + @Accordion + public Color color = new Color(); + + public static class Color { + @Expose + @ConfigOption(name = "Move", desc = "Color for the Move instruction") + @ConfigEditorText + public String move = "&e"; + + @Expose + @ConfigOption(name = "Stand", desc = "Color for the Stand instruction") + @ConfigEditorText + public String stand = "&e"; + + @Expose + @ConfigOption(name = "Sneak", desc = "Color for the Sneak instruction") + @ConfigEditorText + public String sneak = "&5"; + + @Expose + @ConfigOption(name = "Jump", desc = "Color for the Jump instruction") + @ConfigEditorText + public String jump = "&b"; + + @Expose + @ConfigOption(name = "Punch", desc = "Color for the Punch instruction") + @ConfigEditorText + public String punch = "&d"; + + @Expose + @ConfigOption(name = "Countdown", desc = "Color for the Countdown") + @ConfigEditorText + public String countdown = "&f"; + + @Expose + @ConfigOption(name = "Default", desc = "Fallback color") + @ConfigEditorText + public String fallback = "&f"; + } } + + @Expose + public Position position = new Position(442, 239, false, true); } + + @ConfigOption(name = "Tubulator", desc = "") + @Accordion @Expose - public Position position = new Position(442, 239, false, true); - } + public TubulatorConfig tubulatorConfig = new TubulatorConfig(); + public static class TubulatorConfig { - @ConfigOption(name = "Tubulator", desc = "") - @Accordion - @Expose - public TubulatorConfig tubulatorConfig = new TubulatorConfig(); - public static class TubulatorConfig { - - @Expose - @ConfigOption(name = "Enabled", desc = "Highlights the location of the invisible Tubulator blocks (Laser Parkour).") - @ConfigEditorBoolean - public boolean enabled = true; + @Expose + @ConfigOption(name = "Enabled", desc = "Highlights the location of the invisible Tubulator blocks (Laser Parkour).") + @ConfigEditorBoolean + public boolean enabled = true; - @Expose - @ConfigOption(name = "Look Ahead", desc = "Change how many platforms should be shown in front of you.") - @ConfigEditorSlider(minStep = 1, maxValue = 30, minValue = 1) - public Property lookAhead = Property.of(2); + @Expose + @ConfigOption(name = "Look Ahead", desc = "Change how many platforms should be shown in front of you.") + @ConfigEditorSlider(minStep = 1, maxValue = 30, minValue = 1) + public Property lookAhead = Property.of(2); - @Expose - @ConfigOption(name = "Outline", desc = "Outlines the top edge of the platforms.") - @ConfigEditorBoolean - public boolean outline = true; + @Expose + @ConfigOption(name = "Outline", desc = "Outlines the top edge of the platforms.") + @ConfigEditorBoolean + public boolean outline = true; - @Expose - @ConfigOption(name = "Rainbow Color", desc = "Show the rainbow color effect instead of a boring monochrome.") - @ConfigEditorBoolean - public Property rainbowColor = Property.of(true); + @Expose + @ConfigOption(name = "Rainbow Color", desc = "Show the rainbow color effect instead of a boring monochrome.") + @ConfigEditorBoolean + public Property rainbowColor = Property.of(true); - @Expose - @ConfigOption(name = "Monochrome Color", desc = "Set a boring monochrome color for the parkour platforms.") - @ConfigEditorColour - public Property monochromeColor = Property.of("0:60:0:0:255"); + @Expose + @ConfigOption(name = "Monochrome Color", desc = "Set a boring monochrome color for the parkour platforms.") + @ConfigEditorColour + public Property monochromeColor = Property.of("0:60:0:0:255"); - @Expose - @ConfigOption(name = "Hide others players", desc = "Hide other players while doing the lava maze.") - @ConfigEditorBoolean - public boolean hidePlayers = false; + @Expose + @ConfigOption(name = "Hide others players", desc = "Hide other players while doing the lava maze.") + @ConfigEditorBoolean + public boolean hidePlayers = false; + } } - } - @ConfigOption(name = "Kloon Hacking", desc = "") - @Accordion - @Expose - public KloonHacking hacking = new KloonHacking(); - - public static class KloonHacking { +// @Expose +// @ConfigOption(name = "Village Plaza", desc = "") +// @Accordion +// public VillagePlazaConfig villagePlazaConfig = new VillagePlazaConfig(); +// +// public static class VillagePlazaConfig { +// +// } @Expose - @ConfigOption(name = "Hacking Solver", desc = "Highlights the correct button to click in the hacking inventory.") - @ConfigEditorBoolean - public boolean solver = true; + @ConfigOption(name = "Living Cave", desc = "") + @Accordion + public LivingCaveConfig livingCaveConfig = new LivingCaveConfig(); - @Expose - @ConfigOption(name = "Color Guide", desc = "Tells you which colour to pick.") - @ConfigEditorBoolean - public boolean colour = true; + public static class LivingCaveConfig { - @Expose - @ConfigOption(name = "Terminal Waypoints", desc = "While wearing the helmet, waypoints will appear at each terminal location.") - @ConfigEditorBoolean - public boolean waypoints = true; + @Expose + @ConfigOption(name = "Living Metal Suit Progress", desc = "") + @Accordion + public LivingMetalSuitProgress livingMetalSuitProgress = new LivingMetalSuitProgress(); - } + public static class LivingMetalSuitProgress { - @Expose - @ConfigOption(name = "Living Metal Suit Progress", desc = "") - @Accordion - public LivingMetalSuitProgress livingMetalSuitProgress = new LivingMetalSuitProgress(); + @Expose + @ConfigOption(name = "Enabled", desc = "Display progress Living Metal Suit") + @ConfigEditorBoolean + public boolean enabled = false; - public static class LivingMetalSuitProgress { + @Expose + @ConfigOption(name = "Compact", desc = "Show a compacted version of the overlay when the set is maxed.") + @ConfigEditorBoolean + public boolean compactWhenMaxed = false; - @Expose - @ConfigOption(name = "Enabled", desc = "Display progress Living Metal Suit") - @ConfigEditorBoolean - public boolean enabled = true; + @Expose + public Position position = new Position(100, 100); + } + } - @Expose - @ConfigOption(name = "Compact", desc = "Show a compacted version of the overlay when the set is maxed.") - @ConfigEditorBoolean - public boolean compactWhenMaxed = false; +// @Expose +// @ConfigOption(name = "Colosseum", desc = "") +// @Accordion +// public ColosseumConfig colosseumConfig = new ColosseumConfig(); +// +// public static class ColosseumConfig { +// +// } + +// @Expose +// @ConfigOption(name = "Stillgore Chateau", desc = "") +// @Accordion +// public StillgoreChateauConfig stillgoreChateauConfig = new StillgoreChateauConfig(); +// +// public static class StillgoreChateauConfig { +// +// } + +// @Expose +// @ConfigOption(name = "Mountaintop", desc = "") +// @Accordion +// public MountaintopConfig mountaintopConfig = new MountaintopConfig(); +// +// public static class MountaintopConfig { +// +// } - @Expose - public Position position = new Position(100, 100); } + @Expose + @ConfigOption(name = "Highlight Guide", desc = "Highlight things to do in the Rift Guide.") + @ConfigEditorBoolean + public boolean highlightGuide = true; + @Expose @ConfigOption(name = "Show Motes Price", desc = "Show the Motes NPC price in the item lore.") @ConfigEditorBoolean public boolean showMotesPrice = true; - } diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataHolder.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataHolder.kt index d359cebc1..4ee209670 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataHolder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataHolder.kt @@ -1,7 +1,7 @@ package at.hannibal2.skyhanni.features.bazaar import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.features.rift.RiftAPI +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI import at.hannibal2.skyhanni.utils.APIUtil import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils diff --git a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/MobFinder.kt b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/MobFinder.kt index 6b1a4f41b..b8c20ddab 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/MobFinder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/MobFinder.kt @@ -4,7 +4,7 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.withAlpha import at.hannibal2.skyhanni.features.dungeon.DungeonData import at.hannibal2.skyhanni.features.dungeon.DungeonLividFinder -import at.hannibal2.skyhanni.features.rift.RiftAPI +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper import at.hannibal2.skyhanni.utils.EntityUtils.hasBossHealth import at.hannibal2.skyhanni.utils.EntityUtils.hasMaxHealth diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt index a90ba8a6f..f51b625e6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt @@ -8,7 +8,7 @@ import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.features.bazaar.BazaarApi import at.hannibal2.skyhanni.features.garden.composter.ComposterOverlay import at.hannibal2.skyhanni.features.garden.visitor.GardenVisitorFeatures -import at.hannibal2.skyhanni.features.rift.RiftAPI.motesNpcPrice +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI.motesNpcPrice import at.hannibal2.skyhanni.utils.* import at.hannibal2.skyhanni.utils.InventoryUtils.getInventoryName import at.hannibal2.skyhanni.utils.ItemUtils.cleanName diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CurrentPetDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CurrentPetDisplay.kt index d1b2ace7e..328a4aa37 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/CurrentPetDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CurrentPetDisplay.kt @@ -5,7 +5,7 @@ import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.InventoryOpenEvent import at.hannibal2.skyhanni.events.LorenzChatEvent -import at.hannibal2.skyhanni.features.rift.RiftAPI +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.between diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt index f6540e469..29cbfb837 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt @@ -2,7 +2,7 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.* -import at.hannibal2.skyhanni.features.rift.RiftAPI +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI import at.hannibal2.skyhanni.test.command.CopyErrorCommand import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt index c77776d5d..39f61f74b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt @@ -8,7 +8,7 @@ import at.hannibal2.skyhanni.data.GardenCropMilestones.Companion.getCounter import at.hannibal2.skyhanni.data.GardenCropMilestones.Companion.getTierForCrops import at.hannibal2.skyhanni.data.GardenCropMilestones.Companion.progressToNextLevel import at.hannibal2.skyhanni.features.garden.GardenAPI.getCropType -import at.hannibal2.skyhanni.features.rift.RiftAPI +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.colorCodeToRarity diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/CruxTalismanDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/CruxTalismanDisplay.kt deleted file mode 100644 index 632129d11..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/CruxTalismanDisplay.kt +++ /dev/null @@ -1,127 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.ConfigLoadEvent -import at.hannibal2.skyhanni.events.GuiRenderEvent -import at.hannibal2.skyhanni.events.LorenzTickEvent -import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName -import at.hannibal2.skyhanni.utils.ItemUtils.getLore -import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList -import at.hannibal2.skyhanni.utils.NumberUtil.roundToPrecision -import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems -import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher -import at.hannibal2.skyhanni.utils.StringUtils.removeColor -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -object CruxTalismanDisplay { - - private val config get() = SkyHanniMod.feature.rift.cruxTalisman - private val partialName = "CRUX_TALISMAN" - private var display = emptyList>() - private val displayLine = mutableListOf() - private val bonusesLine = mutableListOf() - private val progressPattern = - ".*(?§[0-9a-z][IV1-4-]+)\\s+(?§[0-9a-z]\\w+)§[0-9a-z]:\\s*(?§[0-9a-z](?:§[0-9a-z])?MAXED|(?:§[0-9a-z]\\d+§[0-9a-z]\\/§[0-9a-z]\\d+)).*".toPattern() - private var maxed = false - private var percentValue = 0.0 - - @SubscribeEvent - fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { - if (!isEnabled()) return - config.position.renderStringsAndItems( - display, - posLabel = "Crux Talisman Display" - ) - } - - private fun update() { - display = drawDisplay() - } - - private fun drawDisplay() = buildList { - var maxedKill = 0 - var percent = 0 - for (crux in displayLine) - if (crux.maxed) - maxedKill++ - if (maxedKill == 6) - maxed = true - - if (!config.compactWhenMaxed && maxed) maxed = false - - if (displayLine.isNotEmpty()) { - addAsSingletonList("§7Crux Talisman Progress: ${if (maxed) "§a§lMAXED!" else "§a$percentValue%"}") - if (!maxed) { - displayLine.forEach { - percent += if (config.compactWhenMaxed) { - if (!it.maxed) { - "(?\\d+)/\\d+".toRegex().find(it.progress.removeColor())?.groupValues?.get(1) - ?.toInt() ?: 0 - } else 100 - } else { - if (it.progress.contains("MAXED")) - 100 - else { - "(?\\d+)/\\d+".toRegex().find(it.progress.removeColor())?.groupValues?.get(1) - ?.toInt() ?: 0 - } - } - addAsSingletonList(" ${it.tier} ${it.name}: ${it.progress}") - } - } - } - percentValue = ((percent.toDouble() / 600) * 100).roundToPrecision(1) - if (bonusesLine.isNotEmpty() && config.showBonuses.get()) { - addAsSingletonList("§7Bonuses:") - bonusesLine.forEach { addAsSingletonList(" $it") } - } - } - - - @SubscribeEvent - fun onTick(event: LorenzTickEvent) { - if (!isEnabled()) return - if (!event.isMod(40)) return - if (!InventoryUtils.getItemsInOwnInventory().any { it.getInternalName().startsWith(partialName) }) return - - displayLine.clear() - bonusesLine.clear() - maxed = false - var bonusFound = false - val inventoryStack = InventoryUtils.getItemsInOwnInventory() - for (stack in inventoryStack) { - line@ for (line in stack.getLore()) { - progressPattern.matchMatcher(line) { - val tier = group("tier").replace("-", "0") - val name = group("name") - val progress = group("progress") - val crux = Crux(name, tier, progress, progress.contains("MAXED")) - displayLine.add(crux) - } - if (line.startsWith("§7Total Bonuses")) { - bonusFound = true - continue@line - } - if (bonusFound) { - if (line.isEmpty()) { - bonusFound = false - continue@line - } - bonusesLine.add(line) - } - } - } - update() - } - - @SubscribeEvent - fun onConfigLoad(event: ConfigLoadEvent) { - LorenzUtils.onToggle(config.showBonuses) { update() } - } - - data class Crux(val name: String, val tier: String, val progress: String, val maxed: Boolean) - - fun isEnabled() = RiftAPI.inRift() && config.enabled && LorenzUtils.skyBlockArea != "Mirrorverse" -} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/DanceRoomHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/DanceRoomHelper.kt deleted file mode 100644 index 53b31902b..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/DanceRoomHelper.kt +++ /dev/null @@ -1,173 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.* -import at.hannibal2.skyhanni.utils.LocationUtils.isPlayerInside -import at.hannibal2.skyhanni.utils.RenderUtils.renderStrings -import at.hannibal2.skyhanni.utils.StringUtils.firstLetterUppercase -import at.hannibal2.skyhanni.utils.jsonobjects.DanceRoomInstructionsJson -import kotlinx.coroutines.* -import net.minecraft.client.entity.EntityOtherPlayerMP -import net.minecraft.network.play.server.S45PacketTitle -import net.minecraft.util.AxisAlignedBB -import net.minecraftforge.event.world.WorldEvent -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -object DanceRoomHelper { - - private var display = emptyList() - private val config get() = SkyHanniMod.feature.rift.mirrorVerse.danceRoomHelper - private var index = 0 - private var found = false - private val danceRoom = AxisAlignedBB(-260.0, 32.0, -110.0, -267.0, 40.0, -102.0) - private var inRoom = false - private var instructions = emptyList() - private var countdown: String? = null - - fun update() { - display = buildList { - if (instructions.isEmpty()) { - add("§cError fetching Dance Room Instructions!") - add("§cTry §e/shreloadlocalrepo §cor §e/shupdaterepo") - } - for ((lineIndex, line) in instructions.withIndex()) { - addLine(lineIndex, line)?.let { add(it) } - } - } - } - - private fun addLine(lineIndex: Int, line: String) = with(config.danceRoomFormatting) { - val size = instructions.size - val format = line.format() - - if (index < size && index == lineIndex) { - val countdown = countdown?.let { "${color.countdown.formatColor()}$it" } ?: "" - "${now.formatColor()} $format $countdown" - - } else if (index + 1 < size && index + 1 == lineIndex) { - "${next.formatColor()} $format" - - } else if (index + 2 < size && (index + 2..index + config.lineToShow).contains(lineIndex)) { - "${later.formatColor()} $format" - - } else null - } - - private fun String.formatColor() = replace("&", "§") - - private fun String.format() = - split(" ").joinToString(" ") { it.firstLetterUppercase().addColor().replace("&", "§") } - - private fun String.addColor() = when (this) { - "Move" -> config.danceRoomFormatting.color.move - "Stand" -> config.danceRoomFormatting.color.stand - "Sneak" -> config.danceRoomFormatting.color.sneak - "Jump" -> config.danceRoomFormatting.color.jump - "Punch" -> config.danceRoomFormatting.color.punch - else -> config.danceRoomFormatting.color.fallback - } + this - - @SubscribeEvent - fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { - if (!isEnabled()) return - if (!inRoom) return - config.position.renderStrings( - display, - config.extraSpace, - posLabel = "Dance Room Helper" - ) - } - - @SubscribeEvent - fun onWorldChange(event: WorldEvent.Load) { - inRoom = false - } - - @SubscribeEvent - fun onTick(event: LorenzTickEvent) { - if (!isEnabled()) return - if (event.isMod(10)) { - inRoom = danceRoom.isPlayerInside() - } - if (inRoom) { - update() - } - } - - @SubscribeEvent - fun onSound(event: PlaySoundEvent) { - if (!isEnabled() || !inRoom) return - if ((event.soundName == "random.burp" && event.volume == 0.8f) || (event.soundName == "random.levelup" && event.pitch == 1.8412699f && event.volume == 1.0f)) { - index = 0 - found = false - countdown = null - update() - } - if (event.soundName == "note.bassattack" && event.pitch == 0.6984127f && event.volume == 1.0f && !found) { - found = true - start(2000) - update() - } - } - - @SubscribeEvent - fun onPacket(event: PacketEvent.ReceiveEvent) { - if (!isEnabled()) return - val packet = event.packet - if (packet !is S45PacketTitle) return // TODO add a title event - if (config.hideOriginalTitle && inRoom) event.isCanceled = true - } - - private fun startCountdown(seconds: Int, milliseconds: Int) { - if (seconds <= 0 && milliseconds <= 0) { - countdown = null - return - } - - val countdownString = "%01d:%03d".format(seconds, milliseconds) - countdown = countdownString - - CoroutineScope(Dispatchers.Default).launch { - delay(1) - var updatedSeconds = seconds - var updatedMilliseconds = milliseconds - 1 - if (updatedMilliseconds < 0) { - updatedSeconds -= 1 - updatedMilliseconds += 1000 - } - startCountdown(updatedSeconds, updatedMilliseconds) - } - } - - @SubscribeEvent - fun onCheckRender(event: CheckRenderEntityEvent<*>) { - if (RiftAPI.inRift() && config.hidePlayers) { - val entity = event.entity - if (entity is EntityOtherPlayerMP) { - if (inRoom) { - event.isCanceled = true - } - } - } - } - - @SubscribeEvent - fun onRepoReload(event: RepositoryReloadEvent) { - event.getConstant("DanceRoomInstructions")?.let { - instructions = it.instructions - } - } - - fun start(interval: Long): Job { - return CoroutineScope(Dispatchers.Default).launch { - while (NonCancellable.isActive && found) { - index++ - startCountdown(0, 500) - delay(interval) - } - } - } - - fun isEnabled() = RiftAPI.inRift() && config.enabled -} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/EnigmaSoulWaypoints.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/EnigmaSoulWaypoints.kt deleted file mode 100644 index a7d40580b..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/EnigmaSoulWaypoints.kt +++ /dev/null @@ -1,182 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.* -import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled -import at.hannibal2.skyhanni.utils.ItemUtils.getLore -import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayer -import at.hannibal2.skyhanni.utils.LorenzColor -import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.LorenzVec -import at.hannibal2.skyhanni.utils.NEUItems -import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText -import at.hannibal2.skyhanni.utils.RenderUtils.highlight -import at.hannibal2.skyhanni.utils.StringUtils.removeColor -import at.hannibal2.skyhanni.utils.jsonobjects.EnigmaSoulsJson -import io.github.moulberry.notenoughupdates.events.ReplaceItemEvent -import io.github.moulberry.notenoughupdates.events.SlotClickEvent -import io.github.moulberry.notenoughupdates.util.Utils -import net.minecraft.client.gui.inventory.GuiChest -import net.minecraft.client.player.inventory.ContainerLocalMenu -import net.minecraft.inventory.ContainerChest -import net.minecraftforge.client.event.RenderWorldLastEvent -import net.minecraftforge.fml.common.eventhandler.EventPriority -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -object EnigmaSoulWaypoints { - private val config get() = SkyHanniMod.feature.rift.enigmaSoulWaypoints - private var inInventory = false - private var soulLocations = mapOf() - private val trackedSouls = mutableListOf() - private val inventoryUnfound = mutableListOf() - private var adding = true - - private val item by lazy { - val neuItem = NEUItems.getItemStack("SKYBLOCK_ENIGMA_SOUL", true) - Utils.createItemStack( - neuItem.item, - "§5Toggle Missing", - "§7Click here to toggle", - "§7the waypoints for each", - "§7missing souls on this page" - ) - } - - @SubscribeEvent - fun replaceItem(event: ReplaceItemEvent) { - if (!isEnabled()) return - - if (inventoryUnfound.isEmpty()) return - if (event.inventory is ContainerLocalMenu && inInventory && event.slotNumber == 31) { - event.replaceWith(item) - } - } - - @SubscribeEvent - fun onInventoryOpen(event: InventoryOpenEvent) { - inInventory = false - if (!event.inventoryName.contains("Enigma Souls")) return - inInventory = true - - for (stack in event.inventoryItems.values) { - val split = stack.displayName.split("Enigma: ") - if (split.size == 2) { - if (stack.getLore().last() == "§8✖ Not completed yet!") { - inventoryUnfound.add(split.last()) - } - } - } - } - - @SubscribeEvent - fun onInventoryClose(event: InventoryCloseEvent) { - inInventory = false - inventoryUnfound.clear() - adding = true - } - - @SubscribeEvent(priority = EventPriority.HIGH) - fun onSlotClick(event: SlotClickEvent) { - if (!inInventory || !isEnabled()) return - - if (event.slotId == 31 && inventoryUnfound.isNotEmpty()) { - event.usePickblockInstead() - if (adding) { - trackedSouls.addAll(inventoryUnfound) - adding = false - } else { - trackedSouls.removeAll(inventoryUnfound) - adding = true - } - } - - if (event.slot.stack == null) return - val split = event.slot.stack.displayName.split("Enigma: ") - if (split.size == 2) { - event.usePickblockInstead() - if (soulLocations.contains(split.last())) { - if (!trackedSouls.contains(split.last())) { - LorenzUtils.chat("§5Tracking the ${split.last()} Enigma Soul!") - trackedSouls.add(split.last()) - } else { - trackedSouls.remove(split.last()) - LorenzUtils.chat("§5No longer tracking the ${split.last()} Enigma Soul!") - } - } - } - } - - @SubscribeEvent(priority = EventPriority.LOWEST) - fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { - if (!isEnabled() || !inInventory) return - - if (event.gui !is GuiChest) return - val guiChest = event.gui - val chest = guiChest.inventorySlots as ContainerChest - - for (slot in chest.inventorySlots) { - if (slot == null) continue - val stack = slot.stack ?: continue - - for (soul in trackedSouls) { - if (stack.displayName.removeColor().contains(soul)) { - slot highlight LorenzColor.DARK_PURPLE - } - } - } - if (!adding) { - chest.inventorySlots[31] highlight LorenzColor.DARK_PURPLE - } - } - - @SubscribeEvent - fun onRenderWorld(event: RenderWorldLastEvent) { - if (!isEnabled()) return - for (soul in trackedSouls) { - soulLocations[soul]?.let { - event.drawWaypointFilled(it, LorenzColor.DARK_PURPLE.toColor(), seeThroughBlocks = true, beacon = true) - event.drawDynamicText(it.add(0, 1, 0), "§5$soul Soul", 1.5) - } - } - } - - @SubscribeEvent - fun onRepoReload(event: RepositoryReloadEvent) { - val data = event.getConstant("EnigmaSouls") ?: return - val areas = data.areas ?: error("'areas' is null in EnigmaSouls!") - soulLocations = buildMap { - for ((area, locations) in areas) { - for (location in locations) { - this[location.name] = location.position - } - } - } - } - - @SubscribeEvent - fun onChat(event: LorenzChatEvent) { - if (!isEnabled()) return - val message = event.message.removeColor().trim() - if (message == "You have already found that Enigma Soul!" || message == "SOUL! You unlocked an Enigma Soul!") { - hideClosestSoul() - } - } - - private fun hideClosestSoul() { - var closestSoul = "" - var closestDistance = 8.0 - - for ((soul, location) in soulLocations) { - if (location.distanceToPlayer() < closestDistance) { - closestSoul = soul - closestDistance = location.distanceToPlayer() - } - } - if (closestSoul in trackedSouls) { - trackedSouls.remove(closestSoul) - LorenzUtils.chat("§5Found the $closestSoul Enigma Soul!") - } - } - - fun isEnabled() = RiftAPI.inRift() && config.enabled -} \