From 2f820c489b61634967be9608a44564d113ae6510 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Wed, 19 Jul 2023 19:44:23 +0200 Subject: reworked EndermanSlayerFeatures.kt --- src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt | 2 +- .../at/hannibal2/skyhanni/config/Features.java | 2 +- .../hannibal2/skyhanni/config/features/Slayer.java | 368 --------------------- .../skyhanni/config/features/SlayerConfig.java | 368 +++++++++++++++++++++ .../features/slayer/EndermanSlayerBeacon.kt | 159 --------- .../features/slayer/EndermanSlayerFeatures.kt | 136 ++++++++ .../at/hannibal2/skyhanni/utils/EntityUtils.kt | 3 + 7 files changed, 509 insertions(+), 529 deletions(-) delete mode 100644 src/main/java/at/hannibal2/skyhanni/config/features/Slayer.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/features/SlayerConfig.java delete mode 100644 src/main/java/at/hannibal2/skyhanni/features/slayer/EndermanSlayerBeacon.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/slayer/EndermanSlayerFeatures.kt (limited to 'src') diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt index 962d0474e..f538d1ed9 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt @@ -213,7 +213,7 @@ class SkyHanniMod { loadModule(HighlightDungeonDeathmite()) loadModule(DungeonHideItems()) loadModule(DungeonCopilot()) - loadModule(EndermanSlayerBeacon()) + loadModule(EndermanSlayerFeatures()) loadModule(FireVeilWandParticles()) loadModule(HideMobNames()) loadModule(HideDamageSplash()) diff --git a/src/main/java/at/hannibal2/skyhanni/config/Features.java b/src/main/java/at/hannibal2/skyhanni/config/Features.java index a680c806d..88a60c8ef 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/Features.java +++ b/src/main/java/at/hannibal2/skyhanni/config/Features.java @@ -89,7 +89,7 @@ public class Features extends Config { @Expose @Category(name = "Slayer", desc = "Slayer features.") - public Slayer slayer = new Slayer(); + public SlayerConfig slayer = new SlayerConfig(); @Expose @Category(name = "Diana", desc = "Diana's mythological event.") diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Slayer.java b/src/main/java/at/hannibal2/skyhanni/config/features/Slayer.java deleted file mode 100644 index 55b6059c9..000000000 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Slayer.java +++ /dev/null @@ -1,368 +0,0 @@ -package at.hannibal2.skyhanni.config.features; - -import at.hannibal2.skyhanni.config.core.config.Position; -import com.google.gson.annotations.Expose; -import io.github.moulberry.moulconfig.annotations.*; - -public class Slayer { - - @Expose - @ConfigOption(name = "Enderman Slayer Features", desc = "") - @ConfigEditorAccordion(id = 0) - public boolean enderman = false; - - @Expose - @ConfigOption(name = "Enderman Beacon", desc = "Highlight the enderman slayer Yang Glyph (Beacon) in red color. Supports beacon in hand and beacon flying.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - public boolean slayerEndermanBeacon = false; - - @Expose - @ConfigOption(name = "Enderman Beacon Warnig", desc = "Displays a warning mid-screen then the enderman Slayer throws a Yang Glyph (beacon).") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - public boolean slayerEndermanBeaconWaring = false; - - @Expose - @ConfigOption(name = "Enderman Highlight Nukekebi Skulls", desc = "Highlights the enderman Slayer Nukekebi Skulls.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - public boolean slayerEndermanHighlightNukekebiSkulls = false; - - @Expose - @ConfigOption(name = "Phase Display", desc = "Show the current phase of the enderman slayer.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 0) - public boolean endermanPhaseDisplay = false; - - @Expose - @ConfigOption(name = "Blaze", desc = "") - @ConfigEditorAccordion(id = 1) - public boolean blaze = false; - - @Expose - @ConfigOption(name = "Hellion Shields", desc = "") - @ConfigEditorAccordion(id = 2) - @ConfigAccordionId(id = 1) - public boolean blazeHellion = false; - - @Expose - @ConfigOption(name = "Colored Mobs", desc = "Color the blaze slayer boss and the demons in the right hellion shield color.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - public boolean blazeColoredMobs = false; - - @Expose - @ConfigOption(name = "Blaze Daggers", desc = "Faster and permanent display for the Blaze Slayer daggers.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - public boolean blazeDaggers = false; - - @Expose - @ConfigOption(name = "Right Dagger", desc = "Mark the right dagger to use for blaze slayer in the dagger overlay.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - public boolean blazeMarkRightHellionShield = false; - - @Expose - @ConfigOption(name = "First Dagger", desc = "Select the first, left sided dagger for the display.") - @ConfigEditorDropdown(values = {"Spirit/Crystal", "Ashen/Auric"}) - @ConfigAccordionId(id = 2) - public int blazeFirstDagger = 0; - - @Expose - @ConfigOption(name = "Hide Chat", desc = "Remove the wrong blaze slayer dagger messages from chat.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - public boolean blazeHideDaggerWarning = false; - - @Expose - @ConfigOption(name = "Fire Pits", desc = "Warning when the fire pit phase starts for the Blaze Slayer tier 3 and 4.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - public boolean firePitsWarning = false; - - @Expose - @ConfigOption(name = "Phase Display", desc = "Show the current phase of the blaze slayer.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - public boolean blazePhaseDisplay = false; - - @Expose - @ConfigOption(name = "Clear View", desc = "Hide particles and fireballs near blaze slayer bosses and demons.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - public boolean blazeClearView = false; - - @Expose - @ConfigOption(name = "Vampire Slayer Features", desc = "") - @Accordion - public VampireSlayerConfig vampireSlayerConfig = new VampireSlayerConfig(); - - public static class VampireSlayerConfig { - - @Expose - @ConfigOption(name = "Your Boss", desc = "") - @Accordion - public OwnBoss ownBoss = new OwnBoss(); - - public static class OwnBoss { - - @Expose - @ConfigOption(name = "Highlight your boss", desc = "Highlight your own vampire slayer boss.") - @ConfigEditorBoolean - public boolean highlight = true; - - @Expose - @ConfigOption(name = "Highlight Color", desc = "What color to highlight the boss in.") - @ConfigEditorColour - public String highlightColor = "0:249:0:255:88"; - - @Expose - @ConfigOption(name = "Steak Alert", desc = "Show a title when you can steak your boss.") - @ConfigEditorBoolean - public boolean steakAlert = true; - - @Expose - @ConfigOption(name = "Twinclaws warning", desc = "Send a title when Twinclaws is about to happen.\nWork on others highlighted people boss.") - @ConfigEditorBoolean - public boolean twinClawsTitle = true; - } - - @Expose - @ConfigOption(name = "Others Boss", desc = "") - @Accordion - public OthersBoss othersBoss = new OthersBoss(); - - public static class OthersBoss { - - @Expose - @ConfigOption(name = "Highlight Others people boss", desc = "Highlight others players boss.\nYou need to hit them first.") - @ConfigEditorBoolean - public boolean highlight = true; - - @Expose - @ConfigOption(name = "Highlight Color", desc = "What color to highlight the boss in.") - @ConfigEditorColour - public String highlightColor = "0:249:0:255:88"; - - @Expose - @ConfigOption(name = "Steak Alert", desc = "Show a title when you can steak the boss.") - @ConfigEditorBoolean - public boolean steakAlert = true; - - @Expose - @ConfigOption(name = "Twinclaws warning", desc = "Send a title when Twinclaws is about to happen.") - @ConfigEditorBoolean - public boolean twinClawsTitle = true; - } - - @Expose - @ConfigOption(name = "Co-op Boss", desc = "") - @Accordion - public CoopBossHighlight coopsBossHighlight = new CoopBossHighlight(); - - public static class CoopBossHighlight { - @Expose - @ConfigOption(name = "Highlight Co-op Boss", desc = "Highlight boss of your co-op member.") - @ConfigEditorBoolean - public boolean highlight = true; - - @Expose - @ConfigOption(name = "Highlight Color", desc = "What color to highlight the boss in.") - @ConfigEditorColour - public String highlightColor = "0:249:0:255:88"; - - @Expose - @ConfigOption(name = "Co-op Members", desc = "Add your co-op member here.\n§eFormat: §7Name1,Name2,Name3") - @ConfigEditorText - public String coopMembers = ""; - - @Expose - @ConfigOption(name = "Steak Alert", desc = "Show a title when you can steak the boss.") - @ConfigEditorBoolean - public boolean steakAlert = true; - - @Expose - @ConfigOption(name = "Twinclaws warning", desc = "Send a title when Twinclaws is about to happen.") - @ConfigEditorBoolean - public boolean twinClawsTitle = true; - } - - @Expose - @ConfigOption(name = "Transparency", desc = "Choose the transparency of the color.") - @ConfigEditorSlider(minStep = 1, minValue = 1, maxValue = 250) - public int withAlpha = 80; - - @Expose - @ConfigOption(name = "See Through Blocs", desc = "Highlight even when behind others mobs/players") - @ConfigEditorBoolean - public boolean seeThrough = false; - - @Expose - @ConfigOption(name = "Low Health", desc = "Change color when the boss is below 20% health.") - @ConfigEditorBoolean - public boolean changeColorWhenCanSteak = true; - - @Expose - @ConfigOption(name = "Can use Steak Color", desc = "Color when the boss is below 20% health.") - @ConfigEditorColour - public String steakColor = "0:255:255:0:88"; - - - @Expose - @ConfigOption(name = "Blood Ichor", desc = "") - @Accordion - public BloodIchor bloodIchor = new BloodIchor(); - - public static class BloodIchor { - @Expose - @ConfigOption(name = "Highlight blood Ichor", desc = "Highlight the blood Ichor.") - @ConfigEditorBoolean - public boolean highlight = true; - - @Expose - @ConfigOption(name = "Beacon Beam", desc = "Render a beacon beam where the Blood Ichor is.") - @ConfigEditorBoolean - public boolean renderBeam = true; - - @Expose - @ConfigOption(name = "Color", desc = "Highlight color.") - @ConfigEditorColour - public String color = "0:199:100:0:88"; - } - - @Expose - @ConfigOption(name = "Killer Spring", desc = "") - @Accordion - public KillerSpring killerSpring = new KillerSpring(); - - public static class KillerSpring { - @Expose - @ConfigOption(name = "Highlight Killer Spring", desc = "Highlight the Killer Spring tower.") - @ConfigEditorBoolean - public boolean highlight = true; - - @Expose - @ConfigOption(name = "Color", desc = "Highlight color.") - @ConfigEditorColour - public String color = "0:199:100:0:88"; - } - } - - @Expose - @ConfigOption(name = "Item Profit Tracker", desc = "") - @Accordion - public ItemProfitTracker itemProfitTracker = new ItemProfitTracker(); - - public static class ItemProfitTracker { - - @Expose - @ConfigOption(name = "Enabled", desc = "Count all items you pick up while doing slayer, " + - "keep track of how much you pay for starting slayers and calculating the overall profit.") - @ConfigEditorBoolean - public boolean enabled = true; - - @Expose - public Position pos = new Position(20, 20, false, true); - - @Expose - @ConfigOption(name = "Price in Chat", desc = "Show an extra chat message when you pick up an item. " + - "(This contains name, amount and price)") - @ConfigEditorBoolean - public boolean priceInChat = false; - - @Expose - @ConfigOption(name = "Show Price From", desc = "Show price from Bazaar or NPC.") - @ConfigEditorDropdown(values = {"Instant Sell", "Sell Offer", "NPC"}) - public int priceFrom = 1; - - @Expose - @ConfigOption(name = "Minimum Price", desc = "Items below this price will not show up in chat.") - @ConfigEditorSlider(minValue = 1, maxValue = 5_000_000, minStep = 1) - public int minimumPrice = 100_000; - - @Expose - @ConfigOption(name = "Title Warning", desc = "Show an title for expensive item pickups.") - @ConfigEditorBoolean - public boolean titleWarning = false; - - @Expose - @ConfigOption(name = "Title Price", desc = "Items above this price will show up as title.") - @ConfigEditorSlider(minValue = 1, maxValue = 20_000_000, minStep = 1) - public int minimumPriceWarning = 500_000; - } - - @Expose - @ConfigOption(name = "Items on Ground", desc = "") - @Accordion - public ItemsOnGround itemsOnGround = new ItemsOnGround(); - - public static class ItemsOnGround { - - @Expose - @ConfigOption(name = "Enabled", desc = "Show the name and price of items laying on the ground. §cOnly in slayer areas!") - @ConfigEditorBoolean - public boolean enabled = true; - - @Expose - @ConfigOption(name = "Minimum Price", desc = "Items below this price will be ignored.") - @ConfigEditorSlider(minValue = 1, maxValue = 1_000_000, minStep = 1) - public int minimumPrice = 50_000; - } - - @Expose - @ConfigOption(name = "RNG Meter Display", desc = "") - @Accordion - public RngMeterDisplay rngMeterDisplay = new RngMeterDisplay(); - - public static class RngMeterDisplay { - - @Expose - @ConfigOption(name = "Enabled", desc = "Display amount of bosses needed until next rng meter drop.") - @ConfigEditorBoolean - public boolean enabled = true; - - @Expose - @ConfigOption(name = "Warn Empty", desc = "Warn when no item is set in the rng meter.") - @ConfigEditorBoolean - public boolean warnEmpty = false; - - @Expose - @ConfigOption(name = "Hide Chat", desc = "Hide the rng meter message from chat if current item is selected.") - @ConfigEditorBoolean - public boolean hideChat = true; - - @Expose - public Position pos = new Position(410, 110, false, true); - - } - - @Expose - @ConfigOption(name = "Broken Wither Impact", - desc = "Warns when right-clicking with a Wither Impact weapon (e.g. Hyperion) no longer gains combat exp. " + - "Kill a mob with melee-hits to fix this hypixel bug. §cOnly works while doing slayers!" - ) - @ConfigEditorBoolean - public boolean brokenHyperion = true; - - @Expose - @ConfigOption(name = "Miniboss Highlight", desc = "Highlight slayer miniboss in blue color.") - @ConfigEditorBoolean - public boolean slayerMinibossHighlight = false; - - @Expose - @ConfigOption(name = "Hide Mob Names", desc = "Hide the name of the mobs you need to kill in order for the Slayer boss to spawn. Exclude mobs that are damaged, corrupted, runic or semi rare.") - @ConfigEditorBoolean - public boolean hideMobNames = false; - - @Expose - @ConfigOption(name = "Quest Warning", desc = "Warning when wrong slayer quest is selected, or killing mobs for the wrong slayer.") - @ConfigEditorBoolean - public boolean questWarning = true; - - @Expose - @ConfigOption(name = "Quest Warning Title", desc = "Sends a Title when warning.") - @ConfigEditorBoolean - public boolean questWarningTitle = true; -} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/SlayerConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/SlayerConfig.java new file mode 100644 index 000000000..e3aa63c89 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/SlayerConfig.java @@ -0,0 +1,368 @@ +package at.hannibal2.skyhanni.config.features; + +import at.hannibal2.skyhanni.config.core.config.Position; +import com.google.gson.annotations.Expose; +import io.github.moulberry.moulconfig.annotations.*; + +public class SlayerConfig { + + @Expose + @ConfigOption(name = "Enderman Slayer Features", desc = "") + @ConfigEditorAccordion(id = 0) + public boolean enderman = false; + + @Expose + @ConfigOption(name = "Highlight Yang Glyph", desc = "Highlight the enderman slayer Yang Glyph (beacon) in red color. Supports beacon in hand and beacon flying.") + @ConfigEditorBoolean + @ConfigAccordionId(id = 0) + public boolean slayerEndermanBeacon = false; + + @Expose + @ConfigOption(name = "Beacon Warning", desc = "Displays a warning mid-screen then the enderman Slayer throws a Yang Glyph (beacon).") + @ConfigEditorBoolean + @ConfigAccordionId(id = 0) + public boolean slayerEndermanBeaconWaring = false; + + @Expose + @ConfigOption(name = "Highlight Nukekebi Skulls", desc = "Highlights the enderman Slayer Nukekebi Skulls.") + @ConfigEditorBoolean + @ConfigAccordionId(id = 0) + public boolean endermanHighlightNukekebi = false; + + @Expose + @ConfigOption(name = "Phase Display", desc = "Show the current phase of the enderman slayer.") + @ConfigEditorBoolean + @ConfigAccordionId(id = 0) + public boolean endermanPhaseDisplay = false; + + @Expose + @ConfigOption(name = "Blaze", desc = "") + @ConfigEditorAccordion(id = 1) + public boolean blaze = false; + + @Expose + @ConfigOption(name = "Hellion Shields", desc = "") + @ConfigEditorAccordion(id = 2) + @ConfigAccordionId(id = 1) + public boolean blazeHellion = false; + + @Expose + @ConfigOption(name = "Colored Mobs", desc = "Color the blaze slayer boss and the demons in the right hellion shield color.") + @ConfigEditorBoolean + @ConfigAccordionId(id = 2) + public boolean blazeColoredMobs = false; + + @Expose + @ConfigOption(name = "Blaze Daggers", desc = "Faster and permanent display for the Blaze Slayer daggers.") + @ConfigEditorBoolean + @ConfigAccordionId(id = 2) + public boolean blazeDaggers = false; + + @Expose + @ConfigOption(name = "Right Dagger", desc = "Mark the right dagger to use for blaze slayer in the dagger overlay.") + @ConfigEditorBoolean + @ConfigAccordionId(id = 2) + public boolean blazeMarkRightHellionShield = false; + + @Expose + @ConfigOption(name = "First Dagger", desc = "Select the first, left sided dagger for the display.") + @ConfigEditorDropdown(values = {"Spirit/Crystal", "Ashen/Auric"}) + @ConfigAccordionId(id = 2) + public int blazeFirstDagger = 0; + + @Expose + @ConfigOption(name = "Hide Chat", desc = "Remove the wrong blaze slayer dagger messages from chat.") + @ConfigEditorBoolean + @ConfigAccordionId(id = 2) + public boolean blazeHideDaggerWarning = false; + + @Expose + @ConfigOption(name = "Fire Pits", desc = "Warning when the fire pit phase starts for the Blaze Slayer tier 3 and 4.") + @ConfigEditorBoolean + @ConfigAccordionId(id = 1) + public boolean firePitsWarning = false; + + @Expose + @ConfigOption(name = "Phase Display", desc = "Show the current phase of the blaze slayer.") + @ConfigEditorBoolean + @ConfigAccordionId(id = 1) + public boolean blazePhaseDisplay = false; + + @Expose + @ConfigOption(name = "Clear View", desc = "Hide particles and fireballs near blaze slayer bosses and demons.") + @ConfigEditorBoolean + @ConfigAccordionId(id = 1) + public boolean blazeClearView = false; + + @Expose + @ConfigOption(name = "Vampire Slayer Features", desc = "") + @Accordion + public VampireSlayerConfig vampireSlayerConfig = new VampireSlayerConfig(); + + public static class VampireSlayerConfig { + + @Expose + @ConfigOption(name = "Your Boss", desc = "") + @Accordion + public OwnBoss ownBoss = new OwnBoss(); + + public static class OwnBoss { + + @Expose + @ConfigOption(name = "Highlight your boss", desc = "Highlight your own vampire slayer boss.") + @ConfigEditorBoolean + public boolean highlight = true; + + @Expose + @ConfigOption(name = "Highlight Color", desc = "What color to highlight the boss in.") + @ConfigEditorColour + public String highlightColor = "0:249:0:255:88"; + + @Expose + @ConfigOption(name = "Steak Alert", desc = "Show a title when you can steak your boss.") + @ConfigEditorBoolean + public boolean steakAlert = true; + + @Expose + @ConfigOption(name = "Twinclaws warning", desc = "Send a title when Twinclaws is about to happen.\nWork on others highlighted people boss.") + @ConfigEditorBoolean + public boolean twinClawsTitle = true; + } + + @Expose + @ConfigOption(name = "Others Boss", desc = "") + @Accordion + public OthersBoss othersBoss = new OthersBoss(); + + public static class OthersBoss { + + @Expose + @ConfigOption(name = "Highlight Others people boss", desc = "Highlight others players boss.\nYou need to hit them first.") + @ConfigEditorBoolean + public boolean highlight = true; + + @Expose + @ConfigOption(name = "Highlight Color", desc = "What color to highlight the boss in.") + @ConfigEditorColour + public String highlightColor = "0:249:0:255:88"; + + @Expose + @ConfigOption(name = "Steak Alert", desc = "Show a title when you can steak the boss.") + @ConfigEditorBoolean + public boolean steakAlert = true; + + @Expose + @ConfigOption(name = "Twinclaws warning", desc = "Send a title when Twinclaws is about to happen.") + @ConfigEditorBoolean + public boolean twinClawsTitle = true; + } + + @Expose + @ConfigOption(name = "Co-op Boss", desc = "") + @Accordion + public CoopBossHighlight coopsBossHighlight = new CoopBossHighlight(); + + public static class CoopBossHighlight { + @Expose + @ConfigOption(name = "Highlight Co-op Boss", desc = "Highlight boss of your co-op member.") + @ConfigEditorBoolean + public boolean highlight = true; + + @Expose + @ConfigOption(name = "Highlight Color", desc = "What color to highlight the boss in.") + @ConfigEditorColour + public String highlightColor = "0:249:0:255:88"; + + @Expose + @ConfigOption(name = "Co-op Members", desc = "Add your co-op member here.\n§eFormat: §7Name1,Name2,Name3") + @ConfigEditorText + public String coopMembers = ""; + + @Expose + @ConfigOption(name = "Steak Alert", desc = "Show a title when you can steak the boss.") + @ConfigEditorBoolean + public boolean steakAlert = true; + + @Expose + @ConfigOption(name = "Twinclaws warning", desc = "Send a title when Twinclaws is about to happen.") + @ConfigEditorBoolean + public boolean twinClawsTitle = true; + } + + @Expose + @ConfigOption(name = "Transparency", desc = "Choose the transparency of the color.") + @ConfigEditorSlider(minStep = 1, minValue = 1, maxValue = 250) + public int withAlpha = 80; + + @Expose + @ConfigOption(name = "See Through Blocs", desc = "Highlight even when behind others mobs/players") + @ConfigEditorBoolean + public boolean seeThrough = false; + + @Expose + @ConfigOption(name = "Low Health", desc = "Change color when the boss is below 20% health.") + @ConfigEditorBoolean + public boolean changeColorWhenCanSteak = true; + + @Expose + @ConfigOption(name = "Can use Steak Color", desc = "Color when the boss is below 20% health.") + @ConfigEditorColour + public String steakColor = "0:255:255:0:88"; + + + @Expose + @ConfigOption(name = "Blood Ichor", desc = "") + @Accordion + public BloodIchor bloodIchor = new BloodIchor(); + + public static class BloodIchor { + @Expose + @ConfigOption(name = "Highlight blood Ichor", desc = "Highlight the blood Ichor.") + @ConfigEditorBoolean + public boolean highlight = true; + + @Expose + @ConfigOption(name = "Beacon Beam", desc = "Render a beacon beam where the Blood Ichor is.") + @ConfigEditorBoolean + public boolean renderBeam = true; + + @Expose + @ConfigOption(name = "Color", desc = "Highlight color.") + @ConfigEditorColour + public String color = "0:199:100:0:88"; + } + + @Expose + @ConfigOption(name = "Killer Spring", desc = "") + @Accordion + public KillerSpring killerSpring = new KillerSpring(); + + public static class KillerSpring { + @Expose + @ConfigOption(name = "Highlight Killer Spring", desc = "Highlight the Killer Spring tower.") + @ConfigEditorBoolean + public boolean highlight = true; + + @Expose + @ConfigOption(name = "Color", desc = "Highlight color.") + @ConfigEditorColour + public String color = "0:199:100:0:88"; + } + } + + @Expose + @ConfigOption(name = "Item Profit Tracker", desc = "") + @Accordion + public ItemProfitTracker itemProfitTracker = new ItemProfitTracker(); + + public static class ItemProfitTracker { + + @Expose + @ConfigOption(name = "Enabled", desc = "Count all items you pick up while doing slayer, " + + "keep track of how much you pay for starting slayers and calculating the overall profit.") + @ConfigEditorBoolean + public boolean enabled = true; + + @Expose + public Position pos = new Position(20, 20, false, true); + + @Expose + @ConfigOption(name = "Price in Chat", desc = "Show an extra chat message when you pick up an item. " + + "(This contains name, amount and price)") + @ConfigEditorBoolean + public boolean priceInChat = false; + + @Expose + @ConfigOption(name = "Show Price From", desc = "Show price from Bazaar or NPC.") + @ConfigEditorDropdown(values = {"Instant Sell", "Sell Offer", "NPC"}) + public int priceFrom = 1; + + @Expose + @ConfigOption(name = "Minimum Price", desc = "Items below this price will not show up in chat.") + @ConfigEditorSlider(minValue = 1, maxValue = 5_000_000, minStep = 1) + public int minimumPrice = 100_000; + + @Expose + @ConfigOption(name = "Title Warning", desc = "Show an title for expensive item pickups.") + @ConfigEditorBoolean + public boolean titleWarning = false; + + @Expose + @ConfigOption(name = "Title Price", desc = "Items above this price will show up as title.") + @ConfigEditorSlider(minValue = 1, maxValue = 20_000_000, minStep = 1) + public int minimumPriceWarning = 500_000; + } + + @Expose + @ConfigOption(name = "Items on Ground", desc = "") + @Accordion + public ItemsOnGround itemsOnGround = new ItemsOnGround(); + + public static class ItemsOnGround { + + @Expose + @ConfigOption(name = "Enabled", desc = "Show the name and price of items laying on the ground. §cOnly in slayer areas!") + @ConfigEditorBoolean + public boolean enabled = true; + + @Expose + @ConfigOption(name = "Minimum Price", desc = "Items below this price will be ignored.") + @ConfigEditorSlider(minValue = 1, maxValue = 1_000_000, minStep = 1) + public int minimumPrice = 50_000; + } + + @Expose + @ConfigOption(name = "RNG Meter Display", desc = "") + @Accordion + public RngMeterDisplay rngMeterDisplay = new RngMeterDisplay(); + + public static class RngMeterDisplay { + + @Expose + @ConfigOption(name = "Enabled", desc = "Display amount of bosses needed until next rng meter drop.") + @ConfigEditorBoolean + public boolean enabled = true; + + @Expose + @ConfigOption(name = "Warn Empty", desc = "Warn when no item is set in the rng meter.") + @ConfigEditorBoolean + public boolean warnEmpty = false; + + @Expose + @ConfigOption(name = "Hide Chat", desc = "Hide the rng meter message from chat if current item is selected.") + @ConfigEditorBoolean + public boolean hideChat = true; + + @Expose + public Position pos = new Position(410, 110, false, true); + + } + + @Expose + @ConfigOption(name = "Broken Wither Impact", + desc = "Warns when right-clicking with a Wither Impact weapon (e.g. Hyperion) no longer gains combat exp. " + + "Kill a mob with melee-hits to fix this hypixel bug. §cOnly works while doing slayers!" + ) + @ConfigEditorBoolean + public boolean brokenHyperion = true; + + @Expose + @ConfigOption(name = "Miniboss Highlight", desc = "Highlight slayer miniboss in blue color.") + @ConfigEditorBoolean + public boolean slayerMinibossHighlight = false; + + @Expose + @ConfigOption(name = "Hide Mob Names", desc = "Hide the name of the mobs you need to kill in order for the Slayer boss to spawn. Exclude mobs that are damaged, corrupted, runic or semi rare.") + @ConfigEditorBoolean + public boolean hideMobNames = false; + + @Expose + @ConfigOption(name = "Quest Warning", desc = "Warning when wrong slayer quest is selected, or killing mobs for the wrong slayer.") + @ConfigEditorBoolean + public boolean questWarning = true; + + @Expose + @ConfigOption(name = "Quest Warning Title", desc = "Sends a Title when warning.") + @ConfigEditorBoolean + public boolean questWarningTitle = true; +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/EndermanSlayerBeacon.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/EndermanSlayerBeacon.kt deleted file mode 100644 index 7683b30d1..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/EndermanSlayerBeacon.kt +++ /dev/null @@ -1,159 +0,0 @@ -package at.hannibal2.skyhanni.features.slayer - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.data.IslandType -import at.hannibal2.skyhanni.data.TitleUtils -import at.hannibal2.skyhanni.events.CheckRenderEntityEvent -import at.hannibal2.skyhanni.events.RenderMobColoredEvent -import at.hannibal2.skyhanni.events.ServerBlockChangeEvent -import at.hannibal2.skyhanni.events.withAlpha -import at.hannibal2.skyhanni.features.damageindicator.BossType -import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager -import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled -import at.hannibal2.skyhanni.utils.* -import at.hannibal2.skyhanni.utils.ItemUtils.getSkullTexture -import at.hannibal2.skyhanni.utils.ItemUtils.name -import at.hannibal2.skyhanni.utils.RenderUtils.drawColor -import at.hannibal2.skyhanni.utils.RenderUtils.drawString -import net.minecraft.entity.item.EntityArmorStand -import net.minecraft.entity.monster.EntityEnderman -import net.minecraft.init.Blocks -import net.minecraft.init.Items -import net.minecraftforge.client.event.RenderWorldLastEvent -import net.minecraftforge.event.world.WorldEvent -import net.minecraftforge.fml.common.eventhandler.EventPriority -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class EndermanSlayerBeacon { - - private val endermenWithBeacons = mutableListOf() - private val flyingBeacons = mutableListOf() - private val nukekebiSkulls = mutableListOf() - private val sittingBeacon = mutableListOf() - private val logger = LorenzLogger("slayer/voildgloom_beacon") - - @SubscribeEvent - fun onCheckRender(event: CheckRenderEntityEvent<*>) { - val entity = event.entity - if (entity in endermenWithBeacons || entity in flyingBeacons) return - - if (entity is EntityEnderman) { - if (hasBeaconInHand(entity) && canSee(LocationUtils.playerEyeLocation(), entity.getLorenzVec())) { - endermenWithBeacons.add(entity) - logger.log("Added enderman with beacon at ${entity.getLorenzVec()}") - } - } - - if (entity is EntityArmorStand) { - val stack = entity.inventory[4] ?: return - if (stack.name == "Beacon" && canSee(LocationUtils.playerEyeLocation(), entity.getLorenzVec())) { - flyingBeacons.add(entity) - if(isBeaconWarningEnabled()) - TitleUtils.sendTitle("§4Beacon", 1_000) - logger.log("Added flying beacons at ${entity.getLorenzVec()}") - } - - if (entity.inventory.any { - it?.takeIf { it.item == Items.skull } - ?.let { it.getSkullTexture() } == "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZWIwNzU5NGUyZGYyNzM5MjFhNzdjMTAxZDBiZmRmYTExMTVhYmVkNWI5YjIwMjllYjQ5NmNlYmE5YmRiYjRiMyJ9fX0=" - }) { - nukekebiSkulls.add(entity) - logger.log("Added nukekebi skulls at ${entity.getLorenzVec()}") - nukekebiSkulls.also { it.removeAll { it.isDead } } - - } - } - } - - private fun hasBeaconInHand(entity: EntityEnderman): Boolean { - val heldBlockState = entity.heldBlockState ?: return false - val block = heldBlockState.block ?: return false - return block == Blocks.beacon - } - - private fun canSee(a: LorenzVec, b: LorenzVec): Boolean = LocationUtils.canSee(a, b) || a.distance(b) < 15 - - @SubscribeEvent - fun onRenderMobColored(event: RenderMobColoredEvent) { - if(!isBeaconEnabled() && !isHighlightNukekebiSkullsEnabled()) return - - if (isBeaconEnabled() && event.entity in flyingBeacons) { - event.color = LorenzColor.DARK_RED.toColor().withAlpha(1) - } - - if (isHighlightNukekebiSkullsEnabled() && event.entity in nukekebiSkulls) { - event.color = LorenzColor.DARK_RED.toColor().withAlpha(1) - } - } - - @SubscribeEvent(priority = EventPriority.HIGH) - fun onWorldRender(event: RenderWorldLastEvent) { - if (!isBeaconEnabled()) return - - endermenWithBeacons.removeIf { it.isDead || !hasBeaconInHand(it) } - - endermenWithBeacons.map { it.getLorenzVec().add(-0.5, 0.2, -0.5) } - .forEach { event.drawColor(it, LorenzColor.DARK_RED, alpha = 1f) } - - for (location in sittingBeacon.toMutableList()) { - event.drawColor(location, LorenzColor.DARK_RED, alpha = 1f) - event.drawWaypointFilled(location, LorenzColor.RED.toColor(),true,true) - event.drawString(location.add(0.5, 0.5, 0.5), "§4Beacon", true) - - - } - } - - @SubscribeEvent - fun onBlockChange(event: ServerBlockChangeEvent) { - if (!isBeaconEnabled()) return - - val location = event.location - if (event.new == "beacon") { - val armorStand = flyingBeacons.find { location.distance(it.getLorenzVec()) < 3 } - if (armorStand != null) { - flyingBeacons.remove(armorStand) - sittingBeacon.add(location) - logger.log("Replaced flying beacon with sitting beacon at $location") - } - } else { - if (location in sittingBeacon) { - logger.log("Removed sitting beacon $location") - sittingBeacon.remove(location) - } - } - } - - private fun isBeaconEnabled(): Boolean = LorenzUtils.inSkyBlock && - SkyHanniMod.feature.slayer.slayerEndermanBeacon && - LorenzUtils.skyBlockIsland == IslandType.THE_END && - DamageIndicatorManager.isBossSpawned( - BossType.SLAYER_ENDERMAN_2, - BossType.SLAYER_ENDERMAN_3, - BossType.SLAYER_ENDERMAN_4 - ) - private fun isBeaconWarningEnabled(): Boolean = LorenzUtils.inSkyBlock && - SkyHanniMod.feature.slayer.slayerEndermanBeaconWaring && - LorenzUtils.skyBlockIsland == IslandType.THE_END && - DamageIndicatorManager.isBossSpawned( - BossType.SLAYER_ENDERMAN_2, - BossType.SLAYER_ENDERMAN_3, - BossType.SLAYER_ENDERMAN_4 - ) - private fun isHighlightNukekebiSkullsEnabled(): Boolean = LorenzUtils.inSkyBlock && - SkyHanniMod.feature.slayer.slayerEndermanHighlightNukekebiSkulls && - LorenzUtils.skyBlockIsland == IslandType.THE_END && - DamageIndicatorManager.isBossSpawned( - BossType.SLAYER_ENDERMAN_3, - BossType.SLAYER_ENDERMAN_4 - ) - - @SubscribeEvent - fun onWorldChange(event: WorldEvent.Load) { - endermenWithBeacons.clear() - flyingBeacons.clear() - nukekebiSkulls.clear() - sittingBeacon.clear() - logger.log("Reset everything (world change)") - } -} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/EndermanSlayerFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/EndermanSlayerFeatures.kt new file mode 100644 index 000000000..f55524d91 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/EndermanSlayerFeatures.kt @@ -0,0 +1,136 @@ +package at.hannibal2.skyhanni.features.slayer + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.data.IslandType +import at.hannibal2.skyhanni.data.TitleUtils +import at.hannibal2.skyhanni.events.CheckRenderEntityEvent +import at.hannibal2.skyhanni.events.RenderMobColoredEvent +import at.hannibal2.skyhanni.events.ServerBlockChangeEvent +import at.hannibal2.skyhanni.events.withAlpha +import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled +import at.hannibal2.skyhanni.utils.* +import at.hannibal2.skyhanni.utils.EntityUtils.getBlockInHand +import at.hannibal2.skyhanni.utils.ItemUtils.getSkullTexture +import at.hannibal2.skyhanni.utils.ItemUtils.name +import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland +import at.hannibal2.skyhanni.utils.RenderUtils.drawColor +import at.hannibal2.skyhanni.utils.RenderUtils.drawString +import net.minecraft.entity.item.EntityArmorStand +import net.minecraft.entity.monster.EntityEnderman +import net.minecraft.init.Blocks +import net.minecraftforge.client.event.RenderWorldLastEvent +import net.minecraftforge.event.world.WorldEvent +import net.minecraftforge.fml.common.eventhandler.EventPriority +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class EndermanSlayerFeatures { + private val config get() = SkyHanniMod.feature.slayer + private val endermenWithBeacons = mutableListOf() + private val flyingBeacons = mutableListOf() + private val nukekebiSkulls = mutableListOf() + private val sittingBeacon = mutableListOf() + private val logger = LorenzLogger("slayer/enderman") + private val nukekebiSkulTexture = + "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZWIwNzU5NGUyZGYyNzM5MjFhNzdjMTAxZDBiZmRmYTExMTVhYmVkNWI5YjIwMjllYjQ5NmNlYmE5YmRiYjRiMyJ9fX0=" + + @SubscribeEvent + fun onCheckRender(event: CheckRenderEntityEvent<*>) { + if (!IslandType.THE_END.isInIsland()) return + val entity = event.entity + if (entity in endermenWithBeacons || entity in flyingBeacons) return + + if (entity is EntityEnderman) { + if (config.slayerEndermanBeacon) { + if (hasBeaconInHand(entity) && canSee(LocationUtils.playerEyeLocation(), entity.getLorenzVec())) { + endermenWithBeacons.add(entity) + logger.log("Added enderman with beacon at ${entity.getLorenzVec()}") + } + } + } + + if (entity is EntityArmorStand) { + if (config.slayerEndermanBeacon) { + val stack = entity.inventory[4] ?: return + if (stack.name == "Beacon" && canSee(LocationUtils.playerEyeLocation(), entity.getLorenzVec())) { + flyingBeacons.add(entity) + if (config.slayerEndermanBeaconWaring) + TitleUtils.sendTitle("§4Beacon", 2_00) + logger.log("Added flying beacons at ${entity.getLorenzVec()}") + } + } + + if (config.endermanHighlightNukekebi) { + if (entity.inventory.any { it?.getSkullTexture() == nukekebiSkulTexture }) { + nukekebiSkulls.add(entity) + logger.log("Added nukekebi skulls at ${entity.getLorenzVec()}") + nukekebiSkulls.also { it.removeAll { it.isDead } } + } + } + } + } + + private fun hasBeaconInHand(enderman: EntityEnderman) = enderman.getBlockInHand()?.block == Blocks.beacon + + private fun canSee(a: LorenzVec, b: LorenzVec) = LocationUtils.canSee(a, b) || a.distance(b) < 15 + + @SubscribeEvent + fun onRenderMobColored(event: RenderMobColoredEvent) { + if (!IslandType.THE_END.isInIsland()) return + + if (config.slayerEndermanBeacon && event.entity in flyingBeacons) { + event.color = LorenzColor.DARK_RED.toColor().withAlpha(1) + } + + if (config.endermanHighlightNukekebi && event.entity in nukekebiSkulls) { + event.color = LorenzColor.GOLD.toColor().withAlpha(1) + } + } + + @SubscribeEvent(priority = EventPriority.HIGH) + fun onWorldRender(event: RenderWorldLastEvent) { + if (!IslandType.THE_END.isInIsland()) return + if (!config.slayerEndermanBeacon) return + + endermenWithBeacons.removeIf { it.isDead || !hasBeaconInHand(it) } + + endermenWithBeacons.map { it.getLorenzVec().add(-0.5, 0.2, -0.5) } + .forEach { event.drawColor(it, LorenzColor.DARK_RED, alpha = 1f) } + + for (location in sittingBeacon.toMutableList()) { + event.drawColor(location, LorenzColor.DARK_RED, alpha = 1f) + event.drawWaypointFilled(location, LorenzColor.RED.toColor(), true, true) + event.drawString(location.add(0.5, 0.5, 0.5), "§4Beacon", true) + + } + } + + @SubscribeEvent + fun onBlockChange(event: ServerBlockChangeEvent) { + if (!IslandType.THE_END.isInIsland()) return + if (!config.slayerEndermanBeacon) return + + val location = event.location + if (event.new == "beacon") { + val armorStand = flyingBeacons.find { location.distance(it.getLorenzVec()) < 3 } + if (armorStand != null) { + flyingBeacons.remove(armorStand) + sittingBeacon.add(location) + logger.log("Replaced flying beacon with sitting beacon at $location") + } + } else { + if (location in sittingBeacon) { + logger.log("Removed sitting beacon $location") + sittingBeacon.remove(location) + } + } + } + + @SubscribeEvent + fun onWorldChange(event: WorldEvent.Load) { + endermenWithBeacons.clear() + flyingBeacons.clear() + nukekebiSkulls.clear() + sittingBeacon.clear() + logger.log("Reset everything (world change)") + } +} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt index b9a4c4bcb..a8eda1617 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt @@ -8,6 +8,7 @@ import net.minecraft.entity.Entity import net.minecraft.entity.EntityLivingBase import net.minecraft.entity.item.EntityArmorStand import net.minecraft.entity.monster.EntityBlaze +import net.minecraft.entity.monster.EntityEnderman import net.minecraft.entity.player.EntityPlayer import net.minecraft.item.ItemStack import net.minecraft.potion.Potion @@ -152,4 +153,6 @@ object EntityUtils { fun EntityLivingBase.getArmorInventory(): Array? = if (this is EntityPlayer) inventory.armorInventory else null + + fun EntityEnderman.getBlockInHand() = heldBlockState } \ No newline at end of file -- cgit