aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/HideDeadEntities.kt36
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerClearView.kt2
2 files changed, 37 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/HideDeadEntities.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/HideDeadEntities.kt
new file mode 100644
index 000000000..e4a29513f
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/HideDeadEntities.kt
@@ -0,0 +1,36 @@
+package at.hannibal2.skyhanni.features.misc
+
+import at.hannibal2.skyhanni.events.CheckRenderEntityEvent
+import at.hannibal2.skyhanni.events.EntityHealthUpdateEvent
+import at.hannibal2.skyhanni.utils.LorenzUtils
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+
+class HideDeadEntities {
+ private val hiddenEntities = mutableListOf<Int>()
+
+ @SubscribeEvent
+ fun onEntityHealthUpdate(event: EntityHealthUpdateEvent) {
+ val entityId = event.entity.entityId
+
+ if (event.health <= 0) {
+ if (!hiddenEntities.contains(entityId)) {
+ hiddenEntities.add(entityId)
+// LorenzUtils.chat("died: ${event.entity.name}")
+ }
+ } else {
+ if (hiddenEntities.contains(entityId)) {
+ hiddenEntities.remove(entityId)
+ LorenzUtils.debug("respawned: ${event.entity.name}")
+ }
+ }
+ }
+
+ @SubscribeEvent
+ fun onCheckRender(event: CheckRenderEntityEvent<*>) {
+ if (!LorenzUtils.inSkyBlock) return
+
+ if (hiddenEntities.contains(event.entity.entityId)) {
+ event.isCanceled = true
+ }
+ }
+} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerClearView.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerClearView.kt
index 43c17ec5a..9c220bea9 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerClearView.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerClearView.kt
@@ -34,7 +34,7 @@ class BlazeSlayerClearView {
BossType.SLAYER_BLAZE_QUAZII_2,
BossType.SLAYER_BLAZE_QUAZII_3,
BossType.SLAYER_BLAZE_QUAZII_4,
- ) < 10
+ ) < 20
}
}