aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt b/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt
index bf9980084..02768fc3d 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt
@@ -1,11 +1,12 @@
package at.hannibal2.skyhanni.data
+import at.hannibal2.skyhanni.api.event.HandleEvent
import at.hannibal2.skyhanni.events.ItemInHandChangeEvent
import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
-import at.hannibal2.skyhanni.events.PacketEvent
import at.hannibal2.skyhanni.events.PlaySoundEvent
import at.hannibal2.skyhanni.events.ReceiveParticleEvent
+import at.hannibal2.skyhanni.events.minecraft.packet.PacketReceivedEvent
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.DelayedRun
import at.hannibal2.skyhanni.utils.InventoryUtils
@@ -23,10 +24,8 @@ import net.minecraftforge.fml.common.gameevent.TickEvent
@SkyHanniModule
object MinecraftData {
- @SubscribeEvent(receiveCanceled = true)
- fun onSoundPacket(event: PacketEvent.ReceiveEvent) {
- if (!LorenzUtils.inSkyBlock) return
-
+ @HandleEvent(receiveCancelled = true, onlyOnSkyblock = true)
+ fun onSoundPacket(event: PacketReceivedEvent) {
val packet = event.packet
if (packet !is S29PacketSoundEffect) return
@@ -46,10 +45,8 @@ object MinecraftData {
LorenzWorldChangeEvent().postAndCatch()
}
- @SubscribeEvent(receiveCanceled = true)
- fun onParticlePacketReceive(event: PacketEvent.ReceiveEvent) {
- if (!LorenzUtils.inSkyBlock) return
-
+ @HandleEvent(receiveCancelled = true, onlyOnSkyblock = true)
+ fun onParticlePacketReceive(event: PacketReceivedEvent) {
val packet = event.packet
if (packet !is S2APacketParticles) return