#Help with Networking api (port to 1.20.5)

14 messages · Page 1 of 1 (latest)

wintry light
#

Help with Networking api (port to 1.20.5)

fossil pagoda
#

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

wintry light
#

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

fossil pagoda
#

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

wintry light
#

is that a fabric interface, or a yarn name?

fossil pagoda
#

It's a yarn name

wintry light
#

I see, thank you :)
I'll see what it's called in mojmap, and going to give this a try. Thanks!!

wintry light
#

I assume that i also need to register outgoing packets under PayloadTypeRegistry.playS2C()?

main oxide
#

does your payload (FormPayload) implement CustomPayload?