summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/nether
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-09-15 22:49:58 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-09-15 22:49:58 +0200
commit01d4aef89b7fdad58a320cf1eb4e478ac12aaba4 (patch)
tree3b933dd02f0f976760c0adba9342ea727bcda61a /src/main/java/at/hannibal2/skyhanni/features/nether
parentf02297bfffcdaaef5da4e04725b0658c00889cb7 (diff)
downloadskyhanni-01d4aef89b7fdad58a320cf1eb4e478ac12aaba4.tar.gz
skyhanni-01d4aef89b7fdad58a320cf1eb4e478ac12aaba4.tar.bz2
skyhanni-01d4aef89b7fdad58a320cf1eb4e478ac12aaba4.zip
added and used events for particle and sound
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/nether')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt16
1 files changed, 5 insertions, 11 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 07dc6d305..419f82486 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,26 +1,20 @@
package at.hannibal2.skyhanni.features.nether.ashfang
import at.hannibal2.skyhanni.SkyHanniMod
-import at.hannibal2.skyhanni.events.PacketEvent
+import at.hannibal2.skyhanni.events.PlayParticleEvent
import at.hannibal2.skyhanni.features.damageindicator.BossType
import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager
import at.hannibal2.skyhanni.utils.LorenzUtils
-import net.minecraft.network.play.server.S2APacketParticles
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class AshfangHideParticles {
@SubscribeEvent
- fun onReceivePacket(event: PacketEvent.ReceiveEvent) {
- if (event.packet !is S2APacketParticles) return
-
- if (isEnabled()) {
+ fun onReceivePacket(event: PlayParticleEvent) {
+ if (LorenzUtils.inSkyblock && SkyHanniMod.feature.ashfang.hideParticles &&
+ DamageIndicatorManager.isBossSpawned(BossType.NETHER_ASHFANG)
+ ) {
event.isCanceled = true
}
}
-
- private fun isEnabled(): Boolean {
- return LorenzUtils.inSkyblock && SkyHanniMod.feature.ashfang.hideParticles &&
- DamageIndicatorManager.isBossSpawned(BossType.NETHER_ASHFANG)
- }
} \ No newline at end of file