hey, as someone really unfamiliar with the fabric networking api rework for 1.20.5 - how would i best adapt these two to be able to receive/send esssentially byte arrays?
https://github.com/GeyserMC/Floodgate-Fabric/blob/master/src/main/java/org/geysermc/floodgate/pluginmessage/FabricPluginMessageUtils.java
https://github.com/GeyserMC/Floodgate-Fabric/blob/master/src/main/java/org/geysermc/floodgate/pluginmessage/FabricPluginMessageRegistration.java
Would appreciate any pointers :)
#Help with Networking api (port to 1.20.5)
14 messages · Page 1 of 1 (latest)
That won't be easy as the api to send packets on arbitrary channels was removed. You now have to register a packet codec for each channel. Then the handler and sender have to use those payloads.
Actually, looking closer it seems like you just need to use byte[] as your payload type
that's fine, I know all the channels in advance :)
as long as I don't have to change the payload type, that'd be awesome
Actually you need to wrap it in a record to implement the interface
The payload has to implement CustomPayload
But you can do that wrapping internally
is that a fabric interface, or a yarn name?
It's a yarn name
I see, thank you :)
I'll see what it's called in mojmap, and going to give this a try. Thanks!!
I assume that i also need to register outgoing packets under PayloadTypeRegistry.playS2C()?
does your payload (FormPayload) implement CustomPayload?