diff options
author | My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> | 2020-12-17 14:09:43 -0500 |
---|---|---|
committer | My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> | 2020-12-17 14:09:43 -0500 |
commit | 8310ff1d171bfdec3de2a822134e91c16fd6bf51 (patch) | |
tree | a46422a4b2ed6c627470b43032d7cf2aef7bf9c7 /src | |
parent | 09a83ca95a990bbdd901560c601efa68ff008c36 (diff) | |
download | SkyblockMod-8310ff1d171bfdec3de2a822134e91c16fd6bf51.tar.gz SkyblockMod-8310ff1d171bfdec3de2a822134e91c16fd6bf51.tar.bz2 SkyblockMod-8310ff1d171bfdec3de2a822134e91c16fd6bf51.zip |
Expand Notify Slayer Slain to include bows and items with abilities
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/me/Danker/DankersSkyblockMod.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index dfe8a9c..902f4cf 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -2933,6 +2933,32 @@ public class DankersSkyblockMod if (ToggleCommand.lividDaggerToggled && item.getDisplayName().contains("Livid Dagger")) { event.setCanceled(true); } + if (ToggleCommand.notifySlayerSlainToggled) { + if (ScoreboardHandler.getSidebarLines().stream().anyMatch(x->ScoreboardHandler.cleanSB(x).contains("Boss slain!"))) { + if (ScoreboardHandler.getSidebarLines().stream().anyMatch(x->{ + String line = ScoreboardHandler.cleanSB(x); + return Arrays.stream(new String[]{"Howling Cave", "Ruins", "Graveyard", "Coal Mine", "Spider's Den"}).anyMatch(line::contains); + })) { + if (item.getItem() == Items.bow) { + Utils.createTitle(EnumChatFormatting.RED + "Boss slain!", 2); + } else if (Utils.hasRightClickAbility(item)) { + List<String> lore = Utils.getItemLore(item); + + int abilityLine = -1; + for (int i = 0; i < lore.size(); i++) { + String line = StringUtils.stripControlCodes(lore.get(i)); + if (line.startsWith("Item Ability:")) abilityLine = i; + if (abilityLine != -1 && i > abilityLine) { + if (line.toLowerCase().contains("damage")) { + Utils.createTitle(EnumChatFormatting.RED + "Boss slain!", 2); + break; + } + } + } + } + } + } + } } if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) { |