Skip to content

Conversation

modmuss50
Copy link
Member

In a pack with a large amount of recipes the RecipeBookAddS2CPacket can exceed the packet size limit. This PR splits the single RecipeBookAddS2CPacket into multiple packets when needed. This is compatible with vanilla clients as they can accept multiple packets.

@modmuss50 modmuss50 added enhancement New feature or request module: networking api Pull requests and issues related to the networking api priority: low Low priority PRs that don't immediately need to be resolved labels Apr 20, 2025
packetSender.accept(new RecipeBookAddS2CPacket(collectedEntries, shouldReplace));

collectedEntries = new ArrayList<>();
byteBuf = new RegistryByteBuf(PacketByteBufs.create(), networkHandler.getPlayer().getRegistryManager());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we reuse the old byte buf? Or maybe even use this one as the packet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request module: networking api Pull requests and issues related to the networking api priority: low Low priority PRs that don't immediately need to be resolved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant