aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/test
diff options
context:
space:
mode:
authorBrady <thatgravyboat@gmail.com>2024-06-08 06:48:29 -0230
committerGitHub <noreply@github.com>2024-06-08 11:18:29 +0200
commitf9cafb766115d5342f7d7e1f8b9e3a56504f0273 (patch)
treecd325dbd48a4f8cde6f7e3c74e49cf0ebef99cad /src/main/java/at/hannibal2/skyhanni/test
parentf677ce0fa1cab31feccab6eff2e5c35e2524d8a3 (diff)
downloadskyhanni-f9cafb766115d5342f7d7e1f8b9e3a56504f0273.tar.gz
skyhanni-f9cafb766115d5342f7d7e1f8b9e3a56504f0273.tar.bz2
skyhanni-f9cafb766115d5342f7d7e1f8b9e3a56504f0273.zip
Backend: Packet Events (#2025)
Co-authored-by: Cal <cwolfson58@gmail.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/test')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/PacketTest.kt14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/PacketTest.kt b/src/main/java/at/hannibal2/skyhanni/test/PacketTest.kt
index 1e2829d49..033f71999 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/PacketTest.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/PacketTest.kt
@@ -1,6 +1,8 @@
package at.hannibal2.skyhanni.test
-import at.hannibal2.skyhanni.events.PacketEvent
+import at.hannibal2.skyhanni.api.event.HandleEvent
+import at.hannibal2.skyhanni.events.minecraft.packet.PacketReceivedEvent
+import at.hannibal2.skyhanni.events.minecraft.packet.PacketSentEvent
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.EntityUtils
@@ -32,8 +34,6 @@ import net.minecraft.network.play.server.S1DPacketEntityEffect
import net.minecraft.network.play.server.S20PacketEntityProperties
import net.minecraft.network.play.server.S28PacketEffect
import net.minecraft.network.play.server.S2APacketParticles
-import net.minecraftforge.fml.common.eventhandler.EventPriority
-import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@SkyHanniModule
object PacketTest {
@@ -70,8 +70,8 @@ object PacketTest {
ChatUtils.chat("Packet test: $enabled")
}
- @SubscribeEvent
- fun onSendPacket(event: PacketEvent.SendEvent) {
+ @HandleEvent
+ fun onSendPacket(event: PacketSentEvent) {
if (!enabled) return
val packet = event.packet
@@ -91,8 +91,8 @@ object PacketTest {
println("Send: $packetName")
}
- @SubscribeEvent(priority = EventPriority.LOW, receiveCanceled = true)
- fun onPacketReceive(event: PacketEvent.ReceiveEvent) {
+ @HandleEvent(priority = HandleEvent.LOW, receiveCancelled = true)
+ fun onPacketReceive(event: PacketReceivedEvent) {
if (!enabled) return
val packet = event.packet
packet.print()