Skip to content

Instantly share code, notes, and snippets.

@sylv256
Created July 7, 2023 01:59
Show Gist options
  • Save sylv256/710c5ec462c0eb6926c29782e311fb31 to your computer and use it in GitHub Desktop.
Save sylv256/710c5ec462c0eb6926c29782e311fb31 to your computer and use it in GitHub Desktop.
Quilt Kotlin Modding Idioms (1.20.1 Edition) WIP
/**
* Here's a basic idiom for writing packets.
*
* Notes:
* C2SPackets refers to the class in which the identifier for your packet is located.
*/
fun writePacket() {
val buf = PacketByteBufs.create()
val packet = FooC2SPacket(this.foo)
packet.write(buf)
ClientPlayNetworking.send(C2SPackets.FOO, buf)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment