summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/nether
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-10-01 13:17:34 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-10-01 13:17:34 +0200
commit9946e80fa0fb5da41c4ad8e5ace2edad6c519167 (patch)
treecb9d11ae19767a47739f74f553a89657c2796016 /src/main/java/at/hannibal2/skyhanni/features/nether
parent0185d2cfdceb33c3f72f79f6e119b896f56b7a79 (diff)
downloadskyhanni-9946e80fa0fb5da41c4ad8e5ace2edad6c519167.tar.gz
skyhanni-9946e80fa0fb5da41c4ad8e5ace2edad6c519167.tar.bz2
skyhanni-9946e80fa0fb5da41c4ad8e5ace2edad6c519167.zip
add all particles to hide in ashfang and blaze features
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/nether')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt35
1 files changed, 25 insertions, 10 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt
index c6c5f8786..feb13b2eb 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt
@@ -1,29 +1,44 @@
package at.hannibal2.skyhanni.features.nether.ashfang
import at.hannibal2.skyhanni.SkyHanniMod
-import at.hannibal2.skyhanni.events.BlazeParticleEvent
import at.hannibal2.skyhanni.events.PlayParticleEvent
+import at.hannibal2.skyhanni.events.SpawnParticleEvent
import at.hannibal2.skyhanni.features.damageindicator.BossType
import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager
import at.hannibal2.skyhanni.utils.LorenzUtils
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+import net.minecraftforge.fml.common.gameevent.TickEvent
class AshfangHideParticles {
+ var tick = 0
+ var hideParticles = false
+
@SubscribeEvent
- fun onReceivePacket(event: PlayParticleEvent) {
- if (isEnabled()) {
- event.isCanceled = true
+ fun onTick(event: TickEvent.ClientTickEvent) {
+ if (!LorenzUtils.inSkyblock) return
+
+ if (tick++ % 60 == 0) {
+ val distance = DamageIndicatorManager.getDistanceTo(BossType.NETHER_ASHFANG)
+ hideParticles = distance < 40
}
}
@SubscribeEvent
- fun onBlazeParticle(event: BlazeParticleEvent) {
- if (isEnabled()) {
- event.isCanceled = true
- }
+ fun onReceivePacket(event: PlayParticleEvent) {
+ if (!isEnabled()) return
+ if (!hideParticles) return
+
+ event.isCanceled = true
+ }
+
+ @SubscribeEvent
+ fun onSpawnParticle(event: SpawnParticleEvent) {
+ if (!isEnabled()) return
+ if (!hideParticles) return
+
+ event.isCanceled = true
}
- private fun isEnabled() = LorenzUtils.inSkyblock && SkyHanniMod.feature.ashfang.hideParticles &&
- DamageIndicatorManager.isBossSpawned(BossType.NETHER_ASHFANG)
+ private fun isEnabled() = LorenzUtils.inSkyblock && SkyHanniMod.feature.ashfang.hideParticles
} \ No newline at end of file