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 (limited to 'src/main/java/at/hannibal2') 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 -} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/HighlightRiftGuide.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/HighlightRiftGuide.kt deleted file mode 100644 index 4335077a5..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/HighlightRiftGuide.kt +++ /dev/null @@ -1,63 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.GuiContainerEvent -import at.hannibal2.skyhanni.events.InventoryCloseEvent -import at.hannibal2.skyhanni.events.InventoryOpenEvent -import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getLore -import at.hannibal2.skyhanni.utils.LorenzColor -import at.hannibal2.skyhanni.utils.RenderUtils.highlight -import net.minecraftforge.fml.common.eventhandler.EventPriority -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class HighlightRiftGuide { - private val config get() = SkyHanniMod.feature.rift - private var inInventory = false - private var highlightedItems = emptyList() - - @SubscribeEvent - fun onInventoryOpen(event: InventoryOpenEvent) { - inInventory = false - - if (!isEnabled()) return - - val inGuide = event.inventoryItems[40]?.getLore()?.let { - if (it.size == 1) { - it[0].startsWith("§7To Rift Guide") - } else false - } ?: false - if (!inGuide) return - - val highlightedItems = mutableListOf() - for ((slot, stack) in event.inventoryItems) { - val lore = stack.getLore() - if (lore.isNotEmpty()) { - if (lore.last() == "§8✖ Not completed yet!") { - highlightedItems.add(slot) - } - } - } - inInventory = true - this.highlightedItems = highlightedItems - } - - @SubscribeEvent - fun onInventoryClose(event: InventoryCloseEvent) { - inInventory = false - } - - @SubscribeEvent(priority = EventPriority.LOW) - fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { - if (!isEnabled()) return - if (!inInventory) return - - for (slot in InventoryUtils.getItemsInOpenChest()) { - if (slot.slotIndex in highlightedItems) { - slot highlight LorenzColor.YELLOW - } - } - } - - fun isEnabled() = RiftAPI.inRift() && config.highlightGuide -} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/KloonHacking.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/KloonHacking.kt deleted file mode 100644 index 3e6bc1dac..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/KloonHacking.kt +++ /dev/null @@ -1,158 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.data.ProfileStorageData -import at.hannibal2.skyhanni.events.* -import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled -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.LocationUtils.distanceToPlayer -import at.hannibal2.skyhanni.utils.LorenzColor -import at.hannibal2.skyhanni.utils.RenderUtils.highlight -import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher -import at.hannibal2.skyhanni.utils.StringUtils.removeColor -import io.github.moulberry.notenoughupdates.events.SlotClickEvent -import net.minecraftforge.client.event.RenderWorldLastEvent -import net.minecraftforge.fml.common.eventhandler.EventPriority -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class KloonHacking { - private var wearingHelmet = false - private var inTerminalInventory = false - private var inColourInventory = false - private val correctButtons = mutableListOf() - private var nearestTerminal: KloonTerminal? = null - - @SubscribeEvent - fun onTick(event: LorenzTickEvent) { - if (!RiftAPI.inRift()) return - if (event.isMod(20)) { - checkHelmet() - } - } - - private fun checkHelmet() { - wearingHelmet = InventoryUtils.getArmor()[3]?.getInternalName() == "RETRO_ENCABULATING_VISOR" - } - - @SubscribeEvent - fun onInventoryOpen(event: InventoryOpenEvent) { - inTerminalInventory = false - inColourInventory = false - nearestTerminal = null - if (!RiftAPI.inRift()) return - if (!SkyHanniMod.feature.rift.hacking.solver) return - if (event.inventoryName == "Hacking" || event.inventoryName == "Hacking (As seen on CSI)") { - inTerminalInventory = true - correctButtons.clear() - for ((slot, stack) in event.inventoryItems) { - if (slot in 2..6) { - correctButtons.add(stack.displayName.removeColor()) - } - } - } - if (event.inventoryName == "Hacked Terminal Color Picker") { - inColourInventory = true - } - } - - @SubscribeEvent - fun onInventoryClose(event: InventoryCloseEvent) { - inTerminalInventory = false - inColourInventory = false - } - - @SubscribeEvent - fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { - if (!RiftAPI.inRift()) return - if (inTerminalInventory) { - if (!SkyHanniMod.feature.rift.hacking.solver) return - var i = 0 - for (slot in InventoryUtils.getItemsInOpenChest()) { - if (slot.slotIndex == 11 + 10 * i) { - val correctButton = slot.stack!!.displayName.removeColor() == correctButtons[i] - slot highlight if (correctButton) LorenzColor.GREEN else LorenzColor.RED - continue - } - if (slot.slotIndex > i * 9 + 8 && slot.slotIndex < i * 9 + 18) { - if (slot.stack!!.displayName.removeColor() == correctButtons[i]) { - slot highlight LorenzColor.YELLOW - } - } - if (slot.slotIndex == i * 9 + 17) { - i += 1 - } - } - } - if (inColourInventory) { - if (!SkyHanniMod.feature.rift.hacking.colour) return - val targetColour = nearestTerminal ?: getNearestTerminal() - for (slot in InventoryUtils.getItemsInOpenChest()) { - if (slot.stack.getLore().any { it.contains(targetColour?.name ?: "") }) { - slot highlight LorenzColor.GREEN - } - } - } - } - - @SubscribeEvent(priority = EventPriority.HIGH) - fun onSlotClick(event: SlotClickEvent) { - if (!inTerminalInventory || !RiftAPI.inRift()) return - event.usePickblockInstead() - } - - @SubscribeEvent - fun onRenderWorld(event: RenderWorldLastEvent) { - if (!RiftAPI.inRift()) return - if (!SkyHanniMod.feature.rift.hacking.waypoints) return - if (!wearingHelmet) return - val hidden = ProfileStorageData.profileSpecific?.rift ?: return - for (terminal in KloonTerminal.values()) { - if (terminal !in hidden.completedKloonTerminals) { - event.drawWaypointFilled(terminal.location, LorenzColor.DARK_RED.toColor(), true, true) - } - } - } - - @SubscribeEvent - fun onChat(event: LorenzChatEvent) { - if (!RiftAPI.inRift()) return - if (!wearingHelmet) return - - "You've set the color of this terminal to (?.*)!".toPattern().matchMatcher(event.message.removeColor()) { - val hidden = ProfileStorageData.profileSpecific?.rift ?: return - val colour = group("colour") - val completedTerminal = KloonTerminal.values().firstOrNull { it.name == colour } ?: return - if (completedTerminal != nearestTerminal) return - hidden.completedKloonTerminals.add(completedTerminal) - } - } - - @SubscribeEvent - fun onTooltip(event: LorenzToolTipEvent) { - if (!RiftAPI.inRift()) return - if (!inTerminalInventory) return - if (!SkyHanniMod.feature.rift.hacking.solver) return - - val neededTooltips = listOf(0, 2, 3, 4, 5, 6, 8, 9, 26, 27, 44, 45) - if (event.slot.slotIndex !in neededTooltips) { - event.toolTip.clear() - } - } - - private fun getNearestTerminal(): KloonTerminal? { - var closestTerminal: KloonTerminal? = null - var closestDistance = 8.0 - - for (terminal in KloonTerminal.values()) { - val distance = terminal.location.distanceToPlayer() - if (distance < closestDistance) { - closestTerminal = terminal - closestDistance = distance - } - } - nearestTerminal = closestTerminal - return closestTerminal - } -} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/KloonTerminal.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/KloonTerminal.kt deleted file mode 100644 index 320105f23..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/KloonTerminal.kt +++ /dev/null @@ -1,14 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.utils.LorenzVec - -enum class KloonTerminal(val location: LorenzVec) { - RED(LorenzVec(-69.0, 65.0, -63.0)), - ORANGE(LorenzVec(-44.0, 71.0, -62.0)), - YELLOW(LorenzVec(-39.0, 71.0, -95.0)), - GREEN(LorenzVec(-62.0, 71.0, -83.0)), - AQUA(LorenzVec(-33.0, 70.0, -134.5)), - BLUE(LorenzVec(-66.5, 72.0, -119.0)), - PURPLE(LorenzVec(-89.0, 73.0, -115.0)), - PINK(LorenzVec(-110.0, 73.0, -107.0)) -} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/LivingMetalSuitProgress.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/LivingMetalSuitProgress.kt deleted file mode 100644 index b6758a923..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/LivingMetalSuitProgress.kt +++ /dev/null @@ -1,95 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.GuiRenderEvent -import at.hannibal2.skyhanni.events.LorenzTickEvent -import at.hannibal2.skyhanni.utils.InventoryUtils -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.SkyBlockItemModifierUtils.getLivingMetalProgress -import net.minecraft.item.ItemStack -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class LivingMetalSuitProgress { - - private val config get() = SkyHanniMod.feature.rift.livingMetalSuitProgress - private var display = emptyList>() - private var progressMap = mapOf() - - @SubscribeEvent - fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { - if (!isEnabled()) return - config.position.renderStringsAndItems( - display, - posLabel = "Living Metal Armor Progress" - ) - } - - private fun update() { - display = drawDisplay() - } - - fun drawDisplay(): List> = buildList { - val piecesMaxed = progressMap.values.filterNotNull().count { it >= 1 } - val isMaxed = piecesMaxed == 4 - - if (progressMap.isEmpty()) return@buildList - - val totalProgress = progressMap.values.map { it ?: 1.0 }.average().roundToPrecision(1) - val formatPercentage = LorenzUtils.formatPercentage(totalProgress) - addAsSingletonList("§7Living Metal Suit Progress: ${if (isMaxed) "§a§lMAXED!" else "§a$formatPercentage"}") - - if (config.compactWhenMaxed && isMaxed) return@buildList - - for ((stack, progress) in progressMap.entries.reversed()) { - add(buildList { - add(" §7- ") - add(stack) - add("${stack.displayName}: ") - add(progress?.let { - drawProgressBar(progress) + " §b${LorenzUtils.formatPercentage(progress)}" - } ?: "§cStart upgrading it!") - }) - } - } - - @SubscribeEvent - fun onTick(event: LorenzTickEvent) { - if (!isEnabled()) return - if (!event.isMod(20)) return - val old = progressMap - progressMap = buildMap { - for (armor in InventoryUtils.getArmor().filterNotNull()) { - put(armor, armor.getLivingMetalProgress()?.toDouble()?.let { - it.coerceAtMost(100.0) / 100 - }) - } - } - if (old != progressMap) { - update() - } - } - - private fun drawProgressBar(percentage: Double): String { - val progressBarLength = 20 - val filledLength = (percentage * progressBarLength).toInt() - - val green = "§a" - val grey = "§7" - val reset = "§f" - - val progressBar = StringBuilder() - progressBar.append(green) - repeat(filledLength) { progressBar.append("|") } - - progressBar.append(grey) - repeat(progressBarLength - filledLength) { progressBar.append("|") } - - progressBar.append(reset) - return progressBar.toString() - } - - fun isEnabled() = RiftAPI.inRift() && config.enabled -} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt deleted file mode 100644 index e0ff66926..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt +++ /dev/null @@ -1,19 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.config.features.RiftConfig -import at.hannibal2.skyhanni.data.IslandType -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName -import at.hannibal2.skyhanni.utils.LorenzUtils -import net.minecraft.item.ItemStack - -object RiftAPI { - fun inRift() = LorenzUtils.inIsland(IslandType.THE_RIFT) - - val config: RiftConfig get() = SkyHanniMod.feature.rift - - // internal name -> motes - var motesPrice = emptyMap() - - fun ItemStack.motesNpcPrice() = motesPrice[getInternalName()] -} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAgaricusCap.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAgaricusCap.kt deleted file mode 100644 index c4b452396..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAgaricusCap.kt +++ /dev/null @@ -1,70 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.LorenzTickEvent -import at.hannibal2.skyhanni.utils.* -import at.hannibal2.skyhanni.utils.BlockUtils.getBlockStateAt -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName -import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText -import net.minecraftforge.client.event.RenderWorldLastEvent -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class RiftAgaricusCap { - private val config get() = SkyHanniMod.feature.rift - private var startTime = 0L - private var location: LorenzVec? = null - - @SubscribeEvent - fun onTick(event: LorenzTickEvent) { - if (!isEnabled()) return - val area = LorenzUtils.skyBlockArea - if (area != "West Village" && area != "Dreadfarm") return - - location = updateLocation() - } - - private fun updateLocation(): LorenzVec? { - if (InventoryUtils.getItemInHand()?.getInternalName() != "FARMING_WAND") return null - val currentLocation = BlockUtils.getBlockLookingAt() ?: return null - - when (currentLocation.getBlockStateAt().toString()) { - "minecraft:brown_mushroom" -> { - return if (location != currentLocation) { - startTime = System.currentTimeMillis() - currentLocation - } else { - if (startTime == -1L) { - startTime = System.currentTimeMillis() - } - location - } - } - - "minecraft:red_mushroom" -> { - if (location == currentLocation) { - startTime = -1L - return location - } - } - } - return null - } - - @SubscribeEvent - fun onRenderWorld(event: RenderWorldLastEvent) { - if (!isEnabled()) return - - val location = location?.add(0.0, 0.6, 0.0) ?: return - - if (startTime == -1L) { - event.drawDynamicText(location, "§cClick!", 1.5) - return - } - - val countDown = System.currentTimeMillis() - startTime - val format = TimeUtils.formatDuration(countDown - 1000, showMilliSeconds = true) - event.drawDynamicText(location, "§b$format", 1.5) - } - - fun isEnabled() = RiftAPI.inRift() && config.agaricusCap -} diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftLarva.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftLarva.kt deleted file mode 100644 index 93df913c8..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftLarva.kt +++ /dev/null @@ -1,51 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.LorenzTickEvent -import at.hannibal2.skyhanni.events.withAlpha -import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper -import at.hannibal2.skyhanni.utils.EntityUtils.hasSkullTexture -import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName -import at.hannibal2.skyhanni.utils.LorenzUtils.toChromaColor -import net.minecraft.client.Minecraft -import net.minecraft.entity.item.EntityArmorStand -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class RiftLarva { - private val config get() = SkyHanniMod.feature.rift.larvas - private var hasHookInHand = false - val larvaSkullTexture = - "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTgzYjMwZTlkMTM1YjA1MTkwZWVhMmMzYWM2MWUyYWI1NWEyZDgxZTFhNThkYmIyNjk4M2ExNDA4MjY2NCJ9fX0=" - - @SubscribeEvent - fun onTick(event: LorenzTickEvent) { - if (!isEnabled()) return - - checkHand() - if (!hasHookInHand) return - - if (event.isMod(20)) { - findLarvas() - } - } - - private fun checkHand() { - hasHookInHand = InventoryUtils.getItemInHand()?.getInternalName() == "LARVA_HOOK" - } - - private fun findLarvas() { - - val list = Minecraft.getMinecraft().theWorld?.loadedEntityList ?: return - for (stand in list.filterIsInstance()) { - if (stand.hasSkullTexture(larvaSkullTexture)) { - RenderLivingEntityHelper.setEntityColor( - stand, - config.highlightColor.toChromaColor().withAlpha(1) - ) { isEnabled() && hasHookInHand } - } - } - } - - fun isEnabled() = RiftAPI.inRift() && config.highlight -} diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftLavaMazeParkour.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftLavaMazeParkour.kt deleted file mode 100644 index 20029f9b7..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftLavaMazeParkour.kt +++ /dev/null @@ -1,75 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.CheckRenderEntityEvent -import at.hannibal2.skyhanni.events.ConfigLoadEvent -import at.hannibal2.skyhanni.events.LorenzChatEvent -import at.hannibal2.skyhanni.events.RepositoryReloadEvent -import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.LorenzUtils.toChromaColor -import at.hannibal2.skyhanni.utils.ParkourHelper -import at.hannibal2.skyhanni.utils.jsonobjects.ParkourJson -import net.minecraftforge.client.event.RenderWorldLastEvent -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class RiftLavaMazeParkour { - private val config get() = SkyHanniMod.feature.rift.mirrorVerse.lavaMazeConfig - private var parkourHelper: ParkourHelper? = null - - @SubscribeEvent - fun onRepoReload(event: RepositoryReloadEvent) { - val data = event.getConstant("RiftLavaMazeParkour") ?: return - parkourHelper = ParkourHelper( - data.locations, - data.shortCuts, - platformSize = 1.0, - detectionRange = 1.0 - ) - updateConfig() - } - - @SubscribeEvent - fun onCheckRender(event: CheckRenderEntityEvent<*>) { - if (!isEnabled()) return - if (!config.hidePlayers) return - - parkourHelper?.let { - if (it.inParkour()) { - event.isCanceled = true - } - } - } - - @SubscribeEvent - fun onChatMessage(event: LorenzChatEvent) { - if (!isEnabled()) return - - if (event.message == "§c§lEEK! THE LAVA OOFED YOU!") { - parkourHelper?.reset() - } - } - - @SubscribeEvent - fun onConfigLoad(event: ConfigLoadEvent) { - LorenzUtils.onToggle(config.rainbowColor, config.monochromeColor, config.lookAhead) { - updateConfig() - } - } - - private fun updateConfig() { - parkourHelper?.run { - rainbowColor = config.rainbowColor.get() - monochromeColor = config.monochromeColor.get().toChromaColor() - lookAhead = config.lookAhead.get() + 1 - } - } - - @SubscribeEvent - fun onRenderWorld(event: RenderWorldLastEvent) { - if (!isEnabled()) return - - parkourHelper?.render(event) - } - - fun isEnabled() = RiftAPI.inRift() && LorenzUtils.skyBlockArea == "Mirrorverse" && config.enabled -} diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftOdonata.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftOdonata.kt deleted file mode 100644 index 7c3fae78b..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftOdonata.kt +++ /dev/null @@ -1,51 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.LorenzTickEvent -import at.hannibal2.skyhanni.events.withAlpha -import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper -import at.hannibal2.skyhanni.utils.EntityUtils.hasSkullTexture -import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName -import at.hannibal2.skyhanni.utils.LorenzUtils.toChromaColor -import net.minecraft.client.Minecraft -import net.minecraft.entity.item.EntityArmorStand -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class RiftOdonata { - private val config get() = SkyHanniMod.feature.rift.odonata - private var hasBottleInHand = false - val odonataSkullTexture = - "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOWZkODA2ZGVmZGZkZjU5YjFmMjYwOWM4ZWUzNjQ2NjZkZTY2MTI3YTYyMzQxNWI1NDMwYzkzNThjNjAxZWY3YyJ9fX0=" - - @SubscribeEvent - fun onTick(event: LorenzTickEvent) { - if (!isEnabled()) return - - checkHand() - if (!hasBottleInHand) return - - if (event.isMod(20)) { - findOdonatas() - } - } - - private fun checkHand() { - hasBottleInHand = InventoryUtils.getItemInHand()?.getInternalName() == "EMPTY_ODONATA_BOTTLE" - } - - private fun findOdonatas() { - - val list = Minecraft.getMinecraft().theWorld?.loadedEntityList ?: return - for (stand in list.filterIsInstance()) { - if (stand.hasSkullTexture(odonataSkullTexture)) { - RenderLivingEntityHelper.setEntityColor( - stand, - config.highlightColor.toChromaColor().withAlpha(1) - ) { isEnabled() && hasBottleInHand } - } - } - } - - fun isEnabled() = RiftAPI.inRift() && config.highlight -} diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftTimer.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftTimer.kt index 42188244e..29919e940 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftTimer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftTimer.kt @@ -1,8 +1,8 @@ package at.hannibal2.skyhanni.features.rift -import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzActionBarEvent +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.RenderUtils.renderStrings import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher @@ -11,7 +11,7 @@ import net.minecraftforge.event.world.WorldEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class RiftTimer { - private val config get() = SkyHanniMod.feature.rift.timer + private val config get() = RiftAPI.config.timer private var display = emptyList() private var maxTime = 0L private var latestTime = 0L diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftUpsideDownParkour.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftUpsideDownParkour.kt deleted file mode 100644 index 12f419a3a..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftUpsideDownParkour.kt +++ /dev/null @@ -1,76 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.CheckRenderEntityEvent -import at.hannibal2.skyhanni.events.ConfigLoadEvent -import at.hannibal2.skyhanni.events.LorenzChatEvent -import at.hannibal2.skyhanni.events.RepositoryReloadEvent -import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.LorenzUtils.toChromaColor -import at.hannibal2.skyhanni.utils.ParkourHelper -import at.hannibal2.skyhanni.utils.jsonobjects.ParkourJson -import net.minecraftforge.client.event.RenderWorldLastEvent -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class RiftUpsideDownParkour { - private val config get() = SkyHanniMod.feature.rift.mirrorVerse.upsideDownParkour - private var parkourHelper: ParkourHelper? = null - - @SubscribeEvent - fun onRepoReload(event: RepositoryReloadEvent) { - val data = event.getConstant("RiftUpsideDownParkour") ?: return - parkourHelper = ParkourHelper( - data.locations.map { it.add(-1.0, -1.0, -1.0) },// TODO remove offset. change repo instead - data.shortCuts, - platformSize = 2.0, - detectionRange = 2.0 - ) - updateConfig() - } - - @SubscribeEvent - fun onCheckRender(event: CheckRenderEntityEvent<*>) { - if (!isEnabled()) return - if (!config.hidePlayers) return - - parkourHelper?.let { - if (it.inParkour()) { - event.isCanceled = true - } - } - } - - @SubscribeEvent - fun onChatMessage(event: LorenzChatEvent) { - if (!isEnabled()) return - - if (event.message == "§c§lOH NO! THE LAVA OOFED YOU BACK TO THE START!") { - parkourHelper?.reset() - } - } - - @SubscribeEvent - fun onConfigLoad(event: ConfigLoadEvent) { - LorenzUtils.onToggle(config.rainbowColor, config.monochromeColor, config.lookAhead) { - updateConfig() - } - } - - private fun updateConfig() { - parkourHelper?.run { - rainbowColor = config.rainbowColor.get() - monochromeColor = config.monochromeColor.get().toChromaColor() - lookAhead = config.lookAhead.get() + 1 - outline = config.outline - } - } - - @SubscribeEvent - fun onRenderWorld(event: RenderWorldLastEvent) { - if (!isEnabled()) return - - parkourHelper?.render(event) - } - - fun isEnabled() = RiftAPI.inRift() && LorenzUtils.skyBlockArea == "Mirrorverse" && config.enabled -} diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/ShowMotesNpcSellPrice.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/ShowMotesNpcSellPrice.kt index 41fb1f0b5..404e1f3e2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/ShowMotesNpcSellPrice.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/ShowMotesNpcSellPrice.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.rift -import at.hannibal2.skyhanni.features.rift.RiftAPI.motesNpcPrice +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI.motesNpcPrice import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import net.minecraftforge.event.entity.player.ItemTooltipEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/ShyCruxWarnings.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/ShyCruxWarnings.kt deleted file mode 100644 index a8b46741e..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/ShyCruxWarnings.kt +++ /dev/null @@ -1,27 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.data.TitleUtils -import at.hannibal2.skyhanni.events.LorenzTickEvent -import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayer -import net.minecraft.client.Minecraft -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class ShyCruxWarnings { - private val shyNames = arrayOf("I'm ugly! :(", "Eek!", "Don't look at me!", "Look away!") - - @SubscribeEvent - fun onTick(event: LorenzTickEvent) { - if (!RiftAPI.inRift() || !SkyHanniMod.feature.rift.crux.shyWarning) return - if (event.isMod(2)) { - checkForShy() - } - } - - private fun checkForShy() { - val list = Minecraft.getMinecraft().theWorld?.getLoadedEntityList() ?: return - if (list.any { it.name in shyNames && it.distanceToPlayer() < 8 }) { - TitleUtils.sendTitle("§eLook away!", 150) - } - } -} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/TubulatorParkour.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/TubulatorParkour.kt deleted file mode 100644 index 5b476962b..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/TubulatorParkour.kt +++ /dev/null @@ -1,70 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.CheckRenderEntityEvent -import at.hannibal2.skyhanni.events.ConfigLoadEvent -import at.hannibal2.skyhanni.events.RepositoryReloadEvent -import at.hannibal2.skyhanni.utils.LocationUtils.isPlayerInside -import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.LorenzUtils.toChromaColor -import at.hannibal2.skyhanni.utils.ParkourHelper -import at.hannibal2.skyhanni.utils.jsonobjects.ParkourJson -import net.minecraft.util.AxisAlignedBB -import net.minecraftforge.client.event.RenderWorldLastEvent -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class TubulatorParkour { - private val config get() = SkyHanniMod.feature.rift.mirrorVerse.tubulatorConfig - private var parkourHelper: ParkourHelper? = null - private val puzzleRoom = AxisAlignedBB(-298.0, 0.0, -112.0, -309.0, 63.0, -101.0) - - @SubscribeEvent - fun onRepoReload(event: RepositoryReloadEvent) { - val data = event.getConstant("RiftTubulator") ?: return - parkourHelper = ParkourHelper( - data.locations, - data.shortCuts, - platformSize = 1.0, - detectionRange = 2.0, - ) - updateConfig() - } - - @SubscribeEvent - fun onCheckRender(event: CheckRenderEntityEvent<*>) { - if (!isEnabled()) return - if (!config.hidePlayers) return - - parkourHelper?.let { - if (it.inParkour()) { - event.isCanceled = true - } - } - } - - @SubscribeEvent - fun onConfigLoad(event: ConfigLoadEvent) { - LorenzUtils.onToggle(config.rainbowColor, config.monochromeColor, config.lookAhead) { - updateConfig() - } - } - - private fun updateConfig() { - parkourHelper?.run { - rainbowColor = config.rainbowColor.get() - monochromeColor = config.monochromeColor.get().toChromaColor() - lookAhead = config.lookAhead.get() + 1 - outline = config.outline - } - } - - @SubscribeEvent - fun onRenderWorld(event: RenderWorldLastEvent) { - if (!isEnabled()) return - - parkourHelper?.render(event) - } - - fun isEnabled() = - RiftAPI.inRift() && LorenzUtils.skyBlockArea == "Mirrorverse" && config.enabled && puzzleRoom.isPlayerInside() -} diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/VoltHighlighter.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/VoltHighlighter.kt deleted file mode 100644 index 4b03e9b6c..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/VoltHighlighter.kt +++ /dev/null @@ -1,119 +0,0 @@ -package at.hannibal2.skyhanni.features.rift - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.EntityEquipmentChangeEvent -import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper -import at.hannibal2.skyhanni.utils.ItemUtils.getSkullTexture -import at.hannibal2.skyhanni.utils.LorenzUtils.editCopy -import at.hannibal2.skyhanni.utils.RenderUtils -import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText -import at.hannibal2.skyhanni.utils.RenderUtils.exactLocation -import at.hannibal2.skyhanni.utils.SimpleTimeMark -import at.hannibal2.skyhanni.utils.SpecialColour -import at.hannibal2.skyhanni.utils.TimeUtils -import net.minecraft.client.Minecraft -import net.minecraft.entity.Entity -import net.minecraft.entity.EntityLivingBase -import net.minecraft.entity.item.EntityArmorStand -import net.minecraft.item.ItemStack -import net.minecraftforge.client.event.RenderWorldLastEvent -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -import java.awt.Color -import kotlin.time.Duration -import kotlin.time.Duration.Companion.seconds - -class VoltHighlighter { - private val config get() = SkyHanniMod.feature.rift.crux - - private val LIGHTNING_DISTANCE = 7F - private val ARMOR_SLOT_HEAD = 3 - private val CHARGE_TIME = 12.seconds - private var chargingSince = mapOf() - - @SubscribeEvent - fun onArmorChange(event: EntityEquipmentChangeEvent) { - if (!RiftAPI.inRift() || !config.voltWarning) return - val player = Minecraft.getMinecraft().thePlayer ?: return - if (event.isHead && getVoltState(event.entity) == VoltState.DOING_LIGHTNING - && event.entity.positionVector.squareDistanceTo(player.positionVector) <= LIGHTNING_DISTANCE * LIGHTNING_DISTANCE - ) { - chargingSince = chargingSince.editCopy { - this[event.entity] = SimpleTimeMark.now() - } - } - } - - @SubscribeEvent - fun onRender(event: RenderWorldLastEvent) { - if (!RiftAPI.inRift() || !(config.voltRange || config.voltMoodMeter)) return - val list = Minecraft.getMinecraft().theWorld?.loadedEntityList ?: return - for (entity in list) { - if (entity !is EntityLivingBase) continue - val state = getVoltState(entity) - if (state == VoltState.NO_VOLT) continue - - if (config.voltMoodMeter) - RenderLivingEntityHelper.setEntityColor( - entity, when (state) { - VoltState.FRIENDLY -> 0x8000FF00.toInt() - VoltState.DOING_LIGHTNING -> 0x800000FF.toInt() - VoltState.HOSTILE -> 0x80FF0000.toInt() - else -> 0 - } - ) { config.voltMoodMeter } - if (state == VoltState.DOING_LIGHTNING && config.voltRange) { - RenderUtils.drawCylinderInWorld( - Color(SpecialColour.specialToChromaRGB(config.voltColour), true), - entity.posX, - entity.posY - 4f, - entity.posZ, - radius = LIGHTNING_DISTANCE, - partialTicks = event.partialTicks, - height = 20F - ) - val dischargingSince = chargingSince.getOrDefault(entity, SimpleTimeMark.farPast()) - val dischargeTimeLeft = CHARGE_TIME - dischargingSince.passedSince() - if (dischargeTimeLeft > Duration.ZERO) { - event.drawDynamicText( - event.exactLocation(entity).add(0.0, 2.5, 0.0), - "§eLightning: ${TimeUtils.formatDuration(dischargeTimeLeft, showMilliSeconds = true)}", - 2.5 - ) - } - } - } - } - - enum class VoltState { - NO_VOLT, - FRIENDLY, - HOSTILE, - DOING_LIGHTNING, - ; - } - - private fun getVoltState(itemStack: ItemStack): VoltState { - return when (itemStack.getSkullTexture()) { - "ewogICJ0aW1lc3RhbXAiIDogMTY3Mzg4MzU3MjAzNSwKICAicHJvZmlsZUlkIiA6ICI0MDU4NDhjMmJjNTE0ZDhkOThkOTJkMGIwYzhiZDQ0YiIsCiAgInByb2ZpbGVOYW1lIiA6ICJMb3ZlT3dPIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2UxYjFiZmI1MzZiNjQxNmIyNmEyODNkMmQ4YWQ0YjE3NzFiYmU1Yjc2ODk2ZTI3MjdkNWU4MzNiYzg5NDk4MmQiLAogICAgICAibWV0YWRhdGEiIDogewogICAgICAgICJtb2RlbCIgOiAic2xpbSIKICAgICAgfQogICAgfQogIH0KfQ==" -> { - VoltState.DOING_LIGHTNING - } - - "ewogICJ0aW1lc3RhbXAiIDogMTY3MzYzNzQ1OTAwOCwKICAicHJvZmlsZUlkIiA6ICJmMTA0NzMxZjljYTU0NmI0OTkzNjM4NTlkZWY5N2NjNiIsCiAgInByb2ZpbGVOYW1lIiA6ICJ6aWFkODciLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvN2FlYTYyNTFlNThlM2QyMDU1MmEwMzVkNDI0NTYxZWFlZTA4M2ZlYWNkMWU2Y2IzYzJhNWNmOTQ1Y2U2ZDc2ZSIsCiAgICAgICJtZXRhZGF0YSIgOiB7CiAgICAgICAgIm1vZGVsIiA6ICJzbGltIgogICAgICB9CiAgICB9CiAgfQp9" -> { - VoltState.FRIENDLY - } - - "ewogICJ0aW1lc3RhbXAiIDogMTY3Mzg4MzEwNjAwMywKICAicHJvZmlsZUlkIiA6ICI5NTE3OTkxNjljYzE0MGY1OGM2MmRjOGZmZTU3NjBiZCIsCiAgInByb2ZpbGVOYW1lIiA6ICJZdWFyaWciLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOGY5ZWRlOTcwZDQwYzViMjQ1Y2JkNjUxMzQ5ZWUxNjZmNjk1ZDI1MDM0NWY4ZjBlNjNmY2IxMGNmYjVhMmI3OCIsCiAgICAgICJtZXRhZGF0YSIgOiB7CiAgICAgICAgIm1vZGVsIiA6ICJzbGltIgogICAgICB9CiAgICB9CiAgfQp9" -> { - VoltState.HOSTILE - } - - else -> VoltState.NO_VOLT - } - - } - - private fun getVoltState(entity: Entity): VoltState { - if (entity !is EntityArmorStand) return VoltState.NO_VOLT - val helmet = entity.getCurrentArmor(ARMOR_SLOT_HEAD) ?: return VoltState.NO_VOLT - return getVoltState(helmet) - } -} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/RiftLarva.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/RiftLarva.kt new file mode 100644 index 000000000..164faa446 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/RiftLarva.kt @@ -0,0 +1,51 @@ +package at.hannibal2.skyhanni.features.rift.area + +import at.hannibal2.skyhanni.events.LorenzTickEvent +import at.hannibal2.skyhanni.events.withAlpha +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI +import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper +import at.hannibal2.skyhanni.utils.EntityUtils.hasSkullTexture +import at.hannibal2.skyhanni.utils.InventoryUtils +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.LorenzUtils.toChromaColor +import net.minecraft.client.Minecraft +import net.minecraft.entity.item.EntityArmorStand +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class RiftLarva { + private val config get() = RiftAPI.config.area.wyldWoodsConfig.larvas + private var hasHookInHand = false + val larvaSkullTexture = + "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTgzYjMwZTlkMTM1YjA1MTkwZWVhMmMzYWM2MWUyYWI1NWEyZDgxZTFhNThkYmIyNjk4M2ExNDA4MjY2NCJ9fX0=" + + @SubscribeEvent + fun onTick(event: LorenzTickEvent) { + if (!isEnabled()) return + + checkHand() + if (!hasHookInHand) return + + if (event.isMod(20)) { + findLarvas() + } + } + + private fun checkHand() { + hasHookInHand = InventoryUtils.getItemInHand()?.getInternalName() == "LARVA_HOOK" + } + + private fun findLarvas() { + + val list = Minecraft.getMinecraft().theWorld?.loadedEntityList ?: return + for (stand in list.filterIsInstance()) { + if (stand.hasSkullTexture(larvaSkullTexture)) { + RenderLivingEntityHelper.setEntityColor( + stand, + config.highlightColor.toChromaColor().withAlpha(1) + ) { isEnabled() && hasHookInHand } + } + } + } + + fun isEnabled() = RiftAPI.inRift() && config.highlight +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftAgaricusCap.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftAgaricusCap.kt new file mode 100644 index 000000000..d7bbf541d --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftAgaricusCap.kt @@ -0,0 +1,70 @@ +package at.hannibal2.skyhanni.features.rift.area.dreadfarm + +import at.hannibal2.skyhanni.events.LorenzTickEvent +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI +import at.hannibal2.skyhanni.utils.* +import at.hannibal2.skyhanni.utils.BlockUtils.getBlockStateAt +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText +import net.minecraftforge.client.event.RenderWorldLastEvent +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class RiftAgaricusCap { + private val config get() = RiftAPI.config.area.dreadfarmConfig + private var startTime = 0L + private var location: LorenzVec? = null + + @SubscribeEvent + fun onTick(event: LorenzTickEvent) { + if (!isEnabled()) return + val area = LorenzUtils.skyBlockArea + if (area != "West Village" && area != "Dreadfarm") return + + location = updateLocation() + } + + private fun updateLocation(): LorenzVec? { + if (InventoryUtils.getItemInHand()?.getInternalName() != "FARMING_WAND") return null + val currentLocation = BlockUtils.getBlockLookingAt() ?: return null + + when (currentLocation.getBlockStateAt().toString()) { + "minecraft:brown_mushroom" -> { + return if (location != currentLocation) { + startTime = System.currentTimeMillis() + currentLocation + } else { + if (startTime == -1L) { + startTime = System.currentTimeMillis() + } + location + } + } + + "minecraft:red_mushroom" -> { + if (location == currentLocation) { + startTime = -1L + return location + } + } + } + return null + } + + @SubscribeEvent + fun onRenderWorld(event: RenderWorldLastEvent) { + if (!isEnabled()) return + + val location = location?.add(0.0, 0.6, 0.0) ?: return + + if (startTime == -1L) { + event.drawDynamicText(location, "§cClick!", 1.5) + return + } + + val countDown = System.currentTimeMillis() - startTime + val format = TimeUtils.formatDuration(countDown - 1000, showMilliSeconds = true) + event.drawDynamicText(location, "§b$format", 1.5) + } + + fun isEnabled() = RiftAPI.inRift() && config.agaricusCap +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/VoltHighlighter.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/VoltHighlighter.kt new file mode 100644 index 000000000..2e8bd9c0d --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/VoltHighlighter.kt @@ -0,0 +1,120 @@ +package at.hannibal2.skyhanni.features.rift.area.dreadfarm + +import at.hannibal2.skyhanni.events.EntityEquipmentChangeEvent +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI +import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper +import at.hannibal2.skyhanni.utils.ItemUtils.getSkullTexture +import at.hannibal2.skyhanni.utils.LorenzUtils.editCopy +import at.hannibal2.skyhanni.utils.RenderUtils +import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText +import at.hannibal2.skyhanni.utils.RenderUtils.exactLocation +import at.hannibal2.skyhanni.utils.SimpleTimeMark +import at.hannibal2.skyhanni.utils.SpecialColour +import at.hannibal2.skyhanni.utils.TimeUtils +import net.minecraft.client.Minecraft +import net.minecraft.entity.Entity +import net.minecraft.entity.EntityLivingBase +import net.minecraft.entity.item.EntityArmorStand +import net.minecraft.item.ItemStack +import net.minecraftforge.client.event.RenderWorldLastEvent +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import java.awt.Color +import kotlin.time.Duration +import kotlin.time.Duration.Companion.seconds + +class VoltHighlighter { + + private val config get() = RiftAPI.config.area.dreadfarmConfig.voltCrux + + private val LIGHTNING_DISTANCE = 7F + private val ARMOR_SLOT_HEAD = 3 + private val CHARGE_TIME = 12.seconds + private var chargingSince = mapOf() + + @SubscribeEvent + fun onArmorChange(event: EntityEquipmentChangeEvent) { + if (!RiftAPI.inRift() || !config.voltWarning) return + val player = Minecraft.getMinecraft().thePlayer ?: return + if (event.isHead && getVoltState(event.entity) == VoltState.DOING_LIGHTNING + && event.entity.positionVector.squareDistanceTo(player.positionVector) <= LIGHTNING_DISTANCE * LIGHTNING_DISTANCE + ) { + chargingSince = chargingSince.editCopy { + this[event.entity] = SimpleTimeMark.now() + } + } + } + + @SubscribeEvent + fun onRender(event: RenderWorldLastEvent) { + if (!RiftAPI.inRift() || !(config.voltRange || config.voltMoodMeter)) return + val list = Minecraft.getMinecraft().theWorld?.loadedEntityList ?: return + for (entity in list) { + if (entity !is EntityLivingBase) continue + val state = getVoltState(entity) + if (state == VoltState.NO_VOLT) continue + + if (config.voltMoodMeter) + RenderLivingEntityHelper.setEntityColor( + entity, when (state) { + VoltState.FRIENDLY -> 0x8000FF00.toInt() + VoltState.DOING_LIGHTNING -> 0x800000FF.toInt() + VoltState.HOSTILE -> 0x80FF0000.toInt() + else -> 0 + } + ) { config.voltMoodMeter } + if (state == VoltState.DOING_LIGHTNING && config.voltRange) { + RenderUtils.drawCylinderInWorld( + Color(SpecialColour.specialToChromaRGB(config.voltColour), true), + entity.posX, + entity.posY - 4f, + entity.posZ, + radius = LIGHTNING_DISTANCE, + partialTicks = event.partialTicks, + height = 20F + ) + val dischargingSince = chargingSince.getOrDefault(entity, SimpleTimeMark.farPast()) + val dischargeTimeLeft = CHARGE_TIME - dischargingSince.passedSince() + if (dischargeTimeLeft > Duration.ZERO) { + event.drawDynamicText( + event.exactLocation(entity).add(0.0, 2.5, 0.0), + "§eLightning: ${TimeUtils.formatDuration(dischargeTimeLeft, showMilliSeconds = true)}", + 2.5 + ) + } + } + } + } + + enum class VoltState { + NO_VOLT, + FRIENDLY, + HOSTILE, + DOING_LIGHTNING, + ; + } + + private fun getVoltState(itemStack: ItemStack): VoltState { + return when (itemStack.getSkullTexture()) { + "ewogICJ0aW1lc3RhbXAiIDogMTY3Mzg4MzU3MjAzNSwKICAicHJvZmlsZUlkIiA6ICI0MDU4NDhjMmJjNTE0ZDhkOThkOTJkMGIwYzhiZDQ0YiIsCiAgInByb2ZpbGVOYW1lIiA6ICJMb3ZlT3dPIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2UxYjFiZmI1MzZiNjQxNmIyNmEyODNkMmQ4YWQ0YjE3NzFiYmU1Yjc2ODk2ZTI3MjdkNWU4MzNiYzg5NDk4MmQiLAogICAgICAibWV0YWRhdGEiIDogewogICAgICAgICJtb2RlbCIgOiAic2xpbSIKICAgICAgfQogICAgfQogIH0KfQ==" -> { + VoltState.DOING_LIGHTNING + } + + "ewogICJ0aW1lc3RhbXAiIDogMTY3MzYzNzQ1OTAwOCwKICAicHJvZmlsZUlkIiA6ICJmMTA0NzMxZjljYTU0NmI0OTkzNjM4NTlkZWY5N2NjNiIsCiAgInByb2ZpbGVOYW1lIiA6ICJ6aWFkODciLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvN2FlYTYyNTFlNThlM2QyMDU1MmEwMzVkNDI0NTYxZWFlZTA4M2ZlYWNkMWU2Y2IzYzJhNWNmOTQ1Y2U2ZDc2ZSIsCiAgICAgICJtZXRhZGF0YSIgOiB7CiAgICAgICAgIm1vZGVsIiA6ICJzbGltIgogICAgICB9CiAgICB9CiAgfQp9" -> { + VoltState.FRIENDLY + } + + "ewogICJ0aW1lc3RhbXAiIDogMTY3Mzg4MzEwNjAwMywKICAicHJvZmlsZUlkIiA6ICI5NTE3OTkxNjljYzE0MGY1OGM2MmRjOGZmZTU3NjBiZCIsCiAgInByb2ZpbGVOYW1lIiA6ICJZdWFyaWciLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOGY5ZWRlOTcwZDQwYzViMjQ1Y2JkNjUxMzQ5ZWUxNjZmNjk1ZDI1MDM0NWY4ZjBlNjNmY2IxMGNmYjVhMmI3OCIsCiAgICAgICJtZXRhZGF0YSIgOiB7CiAgICAgICAgIm1vZGVsIiA6ICJzbGltIgogICAgICB9CiAgICB9CiAgfQp9" -> { + VoltState.HOSTILE + } + + else -> VoltState.NO_VOLT + } + + } + + private fun getVoltState(entity: Entity): VoltState { + if (entity !is EntityArmorStand) return VoltState.NO_VOLT + val helmet = entity.getCurrentArmor(ARMOR_SLOT_HEAD) ?: return VoltState.NO_VOLT + return getVoltState(helmet) + } +} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingMetalSuitProgress.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingMetalSuitProgress.kt new file mode 100644 index 000000000..8005c2ee0 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingMetalSuitProgress.kt @@ -0,0 +1,95 @@ +package at.hannibal2.skyhanni.features.rift.area.livingcave + +import at.hannibal2.skyhanni.events.GuiRenderEvent +import at.hannibal2.skyhanni.events.LorenzTickEvent +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.addAsSingletonList +import at.hannibal2.skyhanni.utils.NumberUtil.roundToPrecision +import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems +import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getLivingMetalProgress +import net.minecraft.item.ItemStack +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class LivingMetalSuitProgress { + + private val config get() = RiftAPI.config.area.livingCaveConfig.livingMetalSuitProgress + private var display = emptyList>() + private var progressMap = mapOf() + + @SubscribeEvent + fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { + if (!isEnabled()) return + config.position.renderStringsAndItems( + display, + posLabel = "Living Metal Armor Progress" + ) + } + + private fun update() { + display = drawDisplay() + } + + fun drawDisplay(): List> = buildList { + val piecesMaxed = progressMap.values.filterNotNull().count { it >= 1 } + val isMaxed = piecesMaxed == 4 + + if (progressMap.isEmpty()) return@buildList + + val totalProgress = progressMap.values.map { it ?: 1.0 }.average().roundToPrecision(1) + val formatPercentage = LorenzUtils.formatPercentage(totalProgress) + addAsSingletonList("§7Living Metal Suit Progress: ${if (isMaxed) "§a§lMAXED!" else "§a$formatPercentage"}") + + if (config.compactWhenMaxed && isMaxed) return@buildList + + for ((stack, progress) in progressMap.entries.reversed()) { + add(buildList { + add(" §7- ") + add(stack) + add("${stack.displayName}: ") + add(progress?.let { + drawProgressBar(progress) + " §b${LorenzUtils.formatPercentage(progress)}" + } ?: "§cStart upgrading it!") + }) + } + } + + @SubscribeEvent + fun onTick(event: LorenzTickEvent) { + if (!isEnabled()) return + if (!event.isMod(20)) return + val old = progressMap + progressMap = buildMap { + for (armor in InventoryUtils.getArmor().filterNotNull()) { + put(armor, armor.getLivingMetalProgress()?.toDouble()?.let { + it.coerceAtMost(100.0) / 100 + }) + } + } + if (old != progressMap) { + update() + } + } + + private fun drawProgressBar(percentage: Double): String { + val progressBarLength = 20 + val filledLength = (percentage * progressBarLength).toInt() + + val green = "§a" + val grey = "§7" + val reset = "§f" + + val progressBar = StringBuilder() + progressBar.append(green) + repeat(filledLength) { progressBar.append("|") } + + progressBar.append(grey) + repeat(progressBarLength - filledLength) { progressBar.append("|") } + + progressBar.append(reset) + return progressBar.toString() + } + + fun isEnabled() = RiftAPI.inRift() && config.enabled +} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/DanceRoomHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/DanceRoomHelper.kt new file mode 100644 index 000000000..e84b668ed --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/DanceRoomHelper.kt @@ -0,0 +1,173 @@ +package at.hannibal2.skyhanni.features.rift.area.mirrorverse + + +import at.hannibal2.skyhanni.events.* +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI +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() = RiftAPI.config.area.mirrorVerseConfig.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/area/mirrorverse/RiftLavaMazeParkour.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/RiftLavaMazeParkour.kt new file mode 100644 index 000000000..7bbcca209 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/RiftLavaMazeParkour.kt @@ -0,0 +1,75 @@ +package at.hannibal2.skyhanni.features.rift.area.mirrorverse + +import at.hannibal2.skyhanni.events.CheckRenderEntityEvent +import at.hannibal2.skyhanni.events.ConfigLoadEvent +import at.hannibal2.skyhanni.events.LorenzChatEvent +import at.hannibal2.skyhanni.events.RepositoryReloadEvent +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.LorenzUtils.toChromaColor +import at.hannibal2.skyhanni.utils.ParkourHelper +import at.hannibal2.skyhanni.utils.jsonobjects.ParkourJson +import net.minecraftforge.client.event.RenderWorldLastEvent +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class RiftLavaMazeParkour { + private val config get() = RiftAPI.config.area.mirrorVerseConfig.lavaMazeConfig + private var parkourHelper: ParkourHelper? = null + + @SubscribeEvent + fun onRepoReload(event: RepositoryReloadEvent) { + val data = event.getConstant("RiftLavaMazeParkour") ?: return + parkourHelper = ParkourHelper( + data.locations, + data.shortCuts, + platformSize = 1.0, + detectionRange = 1.0 + ) + updateConfig() + } + + @SubscribeEvent + fun onCheckRender(event: CheckRenderEntityEvent<*>) { + if (!isEnabled()) return + if (!config.hidePlayers) return + + parkourHelper?.let { + if (it.inParkour()) { + event.isCanceled = true + } + } + } + + @SubscribeEvent + fun onChatMessage(event: LorenzChatEvent) { + if (!isEnabled()) return + + if (event.message == "§c§lEEK! THE LAVA OOFED YOU!") { + parkourHelper?.reset() + } + } + + @SubscribeEvent + fun onConfigLoad(event: ConfigLoadEvent) { + LorenzUtils.onToggle(config.rainbowColor, config.monochromeColor, config.lookAhead) { + updateConfig() + } + } + + private fun updateConfig() { + parkourHelper?.run { + rainbowColor = config.rainbowColor.get() + monochromeColor = config.monochromeColor.get().toChromaColor() + lookAhead = config.lookAhead.get() + 1 + } + } + + @SubscribeEvent + fun onRenderWorld(event: RenderWorldLastEvent) { + if (!isEnabled()) return + + parkourHelper?.render(event) + } + + fun isEnabled() = RiftAPI.inRift() && LorenzUtils.skyBlockArea == "Mirrorverse" && config.enabled +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/RiftUpsideDownParkour.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/RiftUpsideDownParkour.kt new file mode 100644 index 000000000..bcf697a07 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/RiftUpsideDownParkour.kt @@ -0,0 +1,76 @@ +package at.hannibal2.skyhanni.features.rift.area.mirrorverse + +import at.hannibal2.skyhanni.events.CheckRenderEntityEvent +import at.hannibal2.skyhanni.events.ConfigLoadEvent +import at.hannibal2.skyhanni.events.LorenzChatEvent +import at.hannibal2.skyhanni.events.RepositoryReloadEvent +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.LorenzUtils.toChromaColor +import at.hannibal2.skyhanni.utils.ParkourHelper +import at.hannibal2.skyhanni.utils.jsonobjects.ParkourJson +import net.minecraftforge.client.event.RenderWorldLastEvent +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class RiftUpsideDownParkour { + private val config get() = RiftAPI.config.area.mirrorVerseConfig.upsideDownParkour + private var parkourHelper: ParkourHelper? = null + + @SubscribeEvent + fun onRepoReload(event: RepositoryReloadEvent) { + val data = event.getConstant("RiftUpsideDownParkour") ?: return + parkourHelper = ParkourHelper( + data.locations.map { it.add(-1.0, -1.0, -1.0) },// TODO remove offset. change repo instead + data.shortCuts, + platformSize = 2.0, + detectionRange = 2.0 + ) + updateConfig() + } + + @SubscribeEvent + fun onCheckRender(event: CheckRenderEntityEvent<*>) { + if (!isEnabled()) return + if (!config.hidePlayers) return + + parkourHelper?.let { + if (it.inParkour()) { + event.isCanceled = true + } + } + } + + @SubscribeEvent + fun onChatMessage(event: LorenzChatEvent) { + if (!isEnabled()) return + + if (event.message == "§c§lOH NO! THE LAVA OOFED YOU BACK TO THE START!") { + parkourHelper?.reset() + } + } + + @SubscribeEvent + fun onConfigLoad(event: ConfigLoadEvent) { + LorenzUtils.onToggle(config.rainbowColor, config.monochromeColor, config.lookAhead) { + updateConfig() + } + } + + private fun updateConfig() { + parkourHelper?.run { + rainbowColor = config.rainbowColor.get() + monochromeColor = config.monochromeColor.get().toChromaColor() + lookAhead = config.lookAhead.get() + 1 + outline = config.outline + } + } + + @SubscribeEvent + fun onRenderWorld(event: RenderWorldLastEvent) { + if (!isEnabled()) return + + parkourHelper?.render(event) + } + + fun isEnabled() = RiftAPI.inRift() && LorenzUtils.skyBlockArea == "Mirrorverse" && config.enabled +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/TubulatorParkour.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/TubulatorParkour.kt new file mode 100644 index 000000000..a25c91cd8 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/TubulatorParkour.kt @@ -0,0 +1,70 @@ +package at.hannibal2.skyhanni.features.rift.area.mirrorverse + +import at.hannibal2.skyhanni.events.CheckRenderEntityEvent +import at.hannibal2.skyhanni.events.ConfigLoadEvent +import at.hannibal2.skyhanni.events.RepositoryReloadEvent +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI +import at.hannibal2.skyhanni.utils.LocationUtils.isPlayerInside +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.LorenzUtils.toChromaColor +import at.hannibal2.skyhanni.utils.ParkourHelper +import at.hannibal2.skyhanni.utils.jsonobjects.ParkourJson +import net.minecraft.util.AxisAlignedBB +import net.minecraftforge.client.event.RenderWorldLastEvent +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class TubulatorParkour { + private val config get() = RiftAPI.config.area.mirrorVerseConfig.tubulatorConfig + private var parkourHelper: ParkourHelper? = null + private val puzzleRoom = AxisAlignedBB(-298.0, 0.0, -112.0, -309.0, 63.0, -101.0) + + @SubscribeEvent + fun onRepoReload(event: RepositoryReloadEvent) { + val data = event.getConstant("RiftTubulator") ?: return + parkourHelper = ParkourHelper( + data.locations, + data.shortCuts, + platformSize = 1.0, + detectionRange = 2.0, + ) + updateConfig() + } + + @SubscribeEvent + fun onCheckRender(event: CheckRenderEntityEvent<*>) { + if (!isEnabled()) return + if (!config.hidePlayers) return + + parkourHelper?.let { + if (it.inParkour()) { + event.isCanceled = true + } + } + } + + @SubscribeEvent + fun onConfigLoad(event: ConfigLoadEvent) { + LorenzUtils.onToggle(config.rainbowColor, config.monochromeColor, config.lookAhead) { + updateConfig() + } + } + + private fun updateConfig() { + parkourHelper?.run { + rainbowColor = config.rainbowColor.get() + monochromeColor = config.monochromeColor.get().toChromaColor() + lookAhead = config.lookAhead.get() + 1 + outline = config.outline + } + } + + @SubscribeEvent + fun onRenderWorld(event: RenderWorldLastEvent) { + if (!isEnabled()) return + + parkourHelper?.render(event) + } + + fun isEnabled() = + RiftAPI.inRift() && LorenzUtils.skyBlockArea == "Mirrorverse" && config.enabled && puzzleRoom.isPlayerInside() +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/KloonHacking.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/KloonHacking.kt new file mode 100644 index 000000000..1b3e08953 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/KloonHacking.kt @@ -0,0 +1,159 @@ +package at.hannibal2.skyhanni.features.rift.area.westvillage + +import at.hannibal2.skyhanni.data.ProfileStorageData +import at.hannibal2.skyhanni.events.* +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI +import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled +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.LocationUtils.distanceToPlayer +import at.hannibal2.skyhanni.utils.LorenzColor +import at.hannibal2.skyhanni.utils.RenderUtils.highlight +import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher +import at.hannibal2.skyhanni.utils.StringUtils.removeColor +import io.github.moulberry.notenoughupdates.events.SlotClickEvent +import net.minecraftforge.client.event.RenderWorldLastEvent +import net.minecraftforge.fml.common.eventhandler.EventPriority +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class KloonHacking { + private val config get() = RiftAPI.config.area.westVillageConfig.hacking + private var wearingHelmet = false + private var inTerminalInventory = false + private var inColourInventory = false + private val correctButtons = mutableListOf() + private var nearestTerminal: KloonTerminal? = null + + @SubscribeEvent + fun onTick(event: LorenzTickEvent) { + if (!RiftAPI.inRift()) return + if (event.isMod(20)) { + checkHelmet() + } + } + + private fun checkHelmet() { + wearingHelmet = InventoryUtils.getArmor()[3]?.getInternalName() == "RETRO_ENCABULATING_VISOR" + } + + @SubscribeEvent + fun onInventoryOpen(event: InventoryOpenEvent) { + inTerminalInventory = false + inColourInventory = false + nearestTerminal = null + if (!RiftAPI.inRift()) return + if (!config.solver) return + if (event.inventoryName == "Hacking" || event.inventoryName == "Hacking (As seen on CSI)") { + inTerminalInventory = true + correctButtons.clear() + for ((slot, stack) in event.inventoryItems) { + if (slot in 2..6) { + correctButtons.add(stack.displayName.removeColor()) + } + } + } + if (event.inventoryName == "Hacked Terminal Color Picker") { + inColourInventory = true + } + } + + @SubscribeEvent + fun onInventoryClose(event: InventoryCloseEvent) { + inTerminalInventory = false + inColourInventory = false + } + + @SubscribeEvent + fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { + if (!RiftAPI.inRift()) return + if (inTerminalInventory) { + if (!config.solver) return + var i = 0 + for (slot in InventoryUtils.getItemsInOpenChest()) { + if (slot.slotIndex == 11 + 10 * i) { + val correctButton = slot.stack!!.displayName.removeColor() == correctButtons[i] + slot highlight if (correctButton) LorenzColor.GREEN else LorenzColor.RED + continue + } + if (slot.slotIndex > i * 9 + 8 && slot.slotIndex < i * 9 + 18) { + if (slot.stack!!.displayName.removeColor() == correctButtons[i]) { + slot highlight LorenzColor.YELLOW + } + } + if (slot.slotIndex == i * 9 + 17) { + i += 1 + } + } + } + if (inColourInventory) { + if (!config.colour) return + val targetColour = nearestTerminal ?: getNearestTerminal() + for (slot in InventoryUtils.getItemsInOpenChest()) { + if (slot.stack.getLore().any { it.contains(targetColour?.name ?: "") }) { + slot highlight LorenzColor.GREEN + } + } + } + } + + @SubscribeEvent(priority = EventPriority.HIGH) + fun onSlotClick(event: SlotClickEvent) { + if (!inTerminalInventory || !RiftAPI.inRift()) return + event.usePickblockInstead() + } + + @SubscribeEvent + fun onRenderWorld(event: RenderWorldLastEvent) { + if (!RiftAPI.inRift()) return + if (!config.waypoints) return + if (!wearingHelmet) return + val hidden = ProfileStorageData.profileSpecific?.rift ?: return + for (terminal in KloonTerminal.values()) { + if (terminal !in hidden.completedKloonTerminals) { + event.drawWaypointFilled(terminal.location, LorenzColor.DARK_RED.toColor(), true, true) + } + } + } + + @SubscribeEvent + fun onChat(event: LorenzChatEvent) { + if (!RiftAPI.inRift()) return + if (!wearingHelmet) return + + "You've set the color of this terminal to (?.*)!".toPattern().matchMatcher(event.message.removeColor()) { + val hidden = ProfileStorageData.profileSpecific?.rift ?: return + val colour = group("colour") + val completedTerminal = KloonTerminal.values().firstOrNull { it.name == colour } ?: return + if (completedTerminal != nearestTerminal) return + hidden.completedKloonTerminals.add(completedTerminal) + } + } + + @SubscribeEvent + fun onTooltip(event: LorenzToolTipEvent) { + if (!RiftAPI.inRift()) return + if (!inTerminalInventory) return + if (!config.solver) return + + val neededTooltips = listOf(0, 2, 3, 4, 5, 6, 8, 9, 26, 27, 44, 45) + if (event.slot.slotIndex !in neededTooltips) { + event.toolTip.clear() + } + } + + private fun getNearestTerminal(): KloonTerminal? { + var closestTerminal: KloonTerminal? = null + var closestDistance = 8.0 + + for (terminal in KloonTerminal.values()) { + val distance = terminal.location.distanceToPlayer() + if (distance < closestDistance) { + closestTerminal = terminal + closestDistance = distance + } + } + nearestTerminal = closestTerminal + return closestTerminal + } +} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/KloonTerminal.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/KloonTerminal.kt new file mode 100644 index 000000000..b5434d330 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/KloonTerminal.kt @@ -0,0 +1,14 @@ +package at.hannibal2.skyhanni.features.rift.area.westvillage + +import at.hannibal2.skyhanni.utils.LorenzVec + +enum class KloonTerminal(val location: LorenzVec) { + RED(LorenzVec(-69.0, 65.0, -63.0)), + ORANGE(LorenzVec(-44.0, 71.0, -62.0)), + YELLOW(LorenzVec(-39.0, 71.0, -95.0)), + GREEN(LorenzVec(-62.0, 71.0, -83.0)), + AQUA(LorenzVec(-33.0, 70.0, -134.5)), + BLUE(LorenzVec(-66.5, 72.0, -119.0)), + PURPLE(LorenzVec(-89.0, 73.0, -115.0)), + PINK(LorenzVec(-110.0, 73.0, -107.0)) +} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/wyldwoods/RiftOdonata.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/wyldwoods/RiftOdonata.kt new file mode 100644 index 000000000..8d0e93594 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/wyldwoods/RiftOdonata.kt @@ -0,0 +1,51 @@ +package at.hannibal2.skyhanni.features.rift.area.wyldwoods + +import at.hannibal2.skyhanni.events.LorenzTickEvent +import at.hannibal2.skyhanni.events.withAlpha +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI +import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper +import at.hannibal2.skyhanni.utils.EntityUtils.hasSkullTexture +import at.hannibal2.skyhanni.utils.InventoryUtils +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.LorenzUtils.toChromaColor +import net.minecraft.client.Minecraft +import net.minecraft.entity.item.EntityArmorStand +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class RiftOdonata { + private val config get() = RiftAPI.config.area.wyldWoodsConfig.odonata + private var hasBottleInHand = false + val odonataSkullTexture = + "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOWZkODA2ZGVmZGZkZjU5YjFmMjYwOWM4ZWUzNjQ2NjZkZTY2MTI3YTYyMzQxNWI1NDMwYzkzNThjNjAxZWY3YyJ9fX0=" + + @SubscribeEvent + fun onTick(event: LorenzTickEvent) { + if (!isEnabled()) return + + checkHand() + if (!hasBottleInHand) return + + if (event.isMod(20)) { + findOdonatas() + } + } + + private fun checkHand() { + hasBottleInHand = InventoryUtils.getItemInHand()?.getInternalName() == "EMPTY_ODONATA_BOTTLE" + } + + private fun findOdonatas() { + + val list = Minecraft.getMinecraft().theWorld?.loadedEntityList ?: return + for (stand in list.filterIsInstance()) { + if (stand.hasSkullTexture(odonataSkullTexture)) { + RenderLivingEntityHelper.setEntityColor( + stand, + config.highlightColor.toChromaColor().withAlpha(1) + ) { isEnabled() && hasBottleInHand } + } + } + } + + fun isEnabled() = RiftAPI.inRift() && config.highlight +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/wyldwoods/ShyCruxWarnings.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/wyldwoods/ShyCruxWarnings.kt new file mode 100644 index 000000000..7641cc6b7 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/wyldwoods/ShyCruxWarnings.kt @@ -0,0 +1,28 @@ +package at.hannibal2.skyhanni.features.rift.area.wyldwoods + +import at.hannibal2.skyhanni.data.TitleUtils +import at.hannibal2.skyhanni.events.LorenzTickEvent +import at.hannibal2.skyhanni.features.rift.everywhere.RiftAPI +import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayer +import net.minecraft.client.Minecraft +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class ShyCruxWarnings { + private val config get() = RiftAPI.config.area.wyldWoodsConfig + private val shyNames = arrayOf("I'm ugly! :(", "Eek!", "Don't look at me!", "Look away!") + + @SubscribeEvent + fun onTick(event: LorenzTickEvent) { + if (!RiftAPI.inRift() || !config.shyWarning) return + if (event.isMod(2)) { + checkForShy() + } + } + + private fun checkForShy() { + val list = Minecraft.getMinecraft().theWorld?.getLoadedEntityList() ?: return + if (list.any { it.name in shyNames && it.distanceToPlayer() < 8 }) { + TitleUtils.sendTitle("§eLook away!", 150) + } + } +} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/CruxTalismanDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/CruxTalismanDisplay.kt new file mode 100644 index 000000000..8d72af8d0 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/CruxTalismanDisplay.kt @@ -0,0 +1,126 @@ +package at.hannibal2.skyhanni.features.rift.everywhere + +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() = RiftAPI.config.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/everywhere/EnigmaSoulWaypoints.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt new file mode 100644 index 000000000..fa71103c2 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt @@ -0,0 +1,181 @@ +package at.hannibal2.skyhanni.features.rift.everywhere + +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() = RiftAPI.config.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 +} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/HighlightRiftGuide.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/HighlightRiftGuide.kt new file mode 100644 index 000000000..b338e33e6 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/HighlightRiftGuide.kt @@ -0,0 +1,61 @@ +package at.hannibal2.skyhanni.features.rift.everywhere + +import at.hannibal2.skyhanni.events.GuiContainerEvent +import at.hannibal2.skyhanni.events.InventoryCloseEvent +import at.hannibal2.skyhanni.events.InventoryOpenEvent +import at.hannibal2.skyhanni.utils.InventoryUtils +import at.hannibal2.skyhanni.utils.ItemUtils.getLore +import at.hannibal2.skyhanni.utils.LorenzColor +import at.hannibal2.skyhanni.utils.RenderUtils.highlight +import net.minecraftforge.fml.common.eventhandler.EventPriority +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class HighlightRiftGuide { + private var inInventory = false + private var highlightedItems = emptyList() + + @SubscribeEvent + fun onInventoryOpen(event: InventoryOpenEvent) { + inInventory = false + + if (!isEnabled()) return + + val inGuide = event.inventoryItems[40]?.getLore()?.let { + if (it.size == 1) { + it[0].startsWith("§7To Rift Guide") + } else false + } ?: false + if (!inGuide) return + + val highlightedItems = mutableListOf() + for ((slot, stack) in event.inventoryItems) { + val lore = stack.getLore() + if (lore.isNotEmpty()) { + if (lore.last() == "§8✖ Not completed yet!") { + highlightedItems.add(slot) + } + } + } + inInventory = true + this.highlightedItems = highlightedItems + } + + @SubscribeEvent + fun onInventoryClose(event: InventoryCloseEvent) { + inInventory = false + } + + @SubscribeEvent(priority = EventPriority.LOW) + fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { + if (!isEnabled()) return + if (!inInventory) return + + for (slot in InventoryUtils.getItemsInOpenChest()) { + if (slot.slotIndex in highlightedItems) { + slot highlight LorenzColor.YELLOW + } + } + } + + fun isEnabled() = RiftAPI.inRift() && RiftAPI.config.highlightGuide +} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftAPI.kt new file mode 100644 index 000000000..5fa19f20e --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftAPI.kt @@ -0,0 +1,19 @@ +package at.hannibal2.skyhanni.features.rift.everywhere + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.features.RiftConfig +import at.hannibal2.skyhanni.data.IslandType +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.LorenzUtils +import net.minecraft.item.ItemStack + +object RiftAPI { + fun inRift() = LorenzUtils.inIsland(IslandType.THE_RIFT) + + val config: RiftConfig get() = SkyHanniMod.feature.rift + + // internal name -> motes + var motesPrice = emptyMap() + + fun ItemStack.motesNpcPrice() = motesPrice[getInternalName()] +} \ No newline at end of file -- cgit