Fabric API

Fabric API

108M Downloads

ExtendedScreenHandlerFactory is not passed ScreenHandler for context

Devan-Kerman opened this issue ยท 1 comments

commented

ExtendedScreenHandlerFactory has method void writeScreenOpeningData(ServerPlayerEntity player, PacketByteBuf buf), however this method is not passed the ScreenHandler that is being written. This makes it rather annoying to take data straight from the ScreenHandler and write it on open. As a result the same code can't be used for sync-on-change and sync-on-open.

image

This can be fixed by either changing the signature of the method or creating a ContextAwareExtendedScreenHandlerFactory of sorts to retain compatibility.

commented

With #3077, the screen handler can be accessed via the passed player object.