`ExtendedScreenHandlerType` requires `RegistryByteBuf` Packet Codecs
Kneelawk opened this issue ยท 4 comments
The Issue
Currently, the ExtendedScreenHandlerType constructor takes a PacketCodec<RegistryByteBuf, D>. This forces all codecs being used to accept a RegistryByteBuf. ExtendedScreenHandlerType's constructor should probably take a PacketCodec<? super RegistryByteBuf, D> instead.
I'll let @deirn investigate this
That only a problem if you reuse PacketCodec from another code, which I doubt most people are.
I would imagine most screen handlers require a custom data record.
Even if you reuse the codec, can't you just call PacketCodec#cast to make the compiler happy?
Yes, cast() works. It's just a mild annoyance. Sometimes you just want to send a BlockPos as your whole payload.