aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me
diff options
context:
space:
mode:
authorMy-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com>2020-12-17 14:55:08 -0500
committerMy-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com>2020-12-17 14:55:08 -0500
commit45577a8861674f14b2740bed95456c545cbaf9b5 (patch)
tree5b3357e1a45ee4adc6fd46053604a56820a95f09 /src/main/java/me
parent8310ff1d171bfdec3de2a822134e91c16fd6bf51 (diff)
downloadSkyblockMod-45577a8861674f14b2740bed95456c545cbaf9b5.tar.gz
SkyblockMod-45577a8861674f14b2740bed95456c545cbaf9b5.tar.bz2
SkyblockMod-45577a8861674f14b2740bed95456c545cbaf9b5.zip
Move non-working bow detection to arrownockevent
Diffstat (limited to 'src/main/java/me')
-rw-r--r--src/main/java/me/Danker/DankersSkyblockMod.java24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java
index 902f4cf..7a836ef 100644
--- a/src/main/java/me/Danker/DankersSkyblockMod.java
+++ b/src/main/java/me/Danker/DankersSkyblockMod.java
@@ -46,9 +46,7 @@ import net.minecraftforge.client.event.sound.PlaySoundEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
import net.minecraftforge.event.entity.player.AttackEntityEvent;
-import net.minecraftforge.event.entity.player.EntityInteractEvent;
-import net.minecraftforge.event.entity.player.ItemTooltipEvent;
-import net.minecraftforge.event.entity.player.PlayerInteractEvent;
+import net.minecraftforge.event.entity.player.*;
import net.minecraftforge.event.world.WorldEvent;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.common.Loader;
@@ -2939,9 +2937,7 @@ public class DankersSkyblockMod
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)) {
+ if (Utils.hasRightClickAbility(item)) {
List<String> lore = Utils.getItemLore(item);
int abilityLine = -1;
@@ -3014,6 +3010,22 @@ public class DankersSkyblockMod
}
@SubscribeEvent
+ public void onArrowNock(ArrowNockEvent event) {
+ if (!Utils.inSkyblock || Minecraft.getMinecraft().thePlayer != event.entityPlayer) return;
+
+ 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);
+ })) {
+ Utils.createTitle(EnumChatFormatting.RED + "Boss slain!", 2);
+ }
+ }
+ }
+ }
+
+ @SubscribeEvent
public void onAttackingEntity(AttackEntityEvent event) {
if (ToggleCommand.notifySlayerSlainToggled && (event.target instanceof EntityZombie || event.target instanceof EntitySpider || event.target instanceof EntityWolf)) {
List<String> scoreboard = ScoreboardHandler.getSidebarLines();