Skip to content

Avoid re-sending potion mixes in quick succession#6372

Merged
onebeastchris merged 3 commits into
GeyserMC:masterfrom
onebeastchris:fix/crafting-data-resend
May 11, 2026
Merged

Avoid re-sending potion mixes in quick succession#6372
onebeastchris merged 3 commits into
GeyserMC:masterfrom
onebeastchris:fix/crafting-data-resend

Conversation

@onebeastchris
Copy link
Copy Markdown
Member

Recent testing showed that re-sending "clean" CraftingDataPackets rapidly - e.g. on join with a backend server switch - could cause clients to load worlds much slower. This patch partially avoids this by adding onto existing recipes (sent when the configuration stage finishes) upon receiving the ClientboundUpdateRecipesPacket instead of always re-sending the full packet.

Copilot AI review requested due to automatic review settings May 8, 2026 16:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Reduces Bedrock-side load delays by avoiding re-sending the full “clean” CraftingDataPacket payload (cartography recipes + potion mixes + cached recipes) when ClientboundUpdateRecipesPacket arrives shortly after the configuration phase.

Changes:

  • Conditionally sends “base” recipe data in JavaUpdateRecipesTranslator based on a new session flag (cleanRecipesRequired).
  • Sets cleanRecipesRequired to false after JavaFinishConfigurationTranslator sends the initial clean recipe packet, so the next update can be incremental.
  • Initializes recipe-related session maps/fields with defaults in GeyserSession (including the new flag).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaUpdateRecipesTranslator.java Avoids re-sending base recipe data unless a clean reset is required.
core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaFinishConfigurationTranslator.java Sends the initial clean recipe packet and disables subsequent immediate clean resend.
core/src/main/java/org/geysermc/geyser/session/GeyserSession.java Adds cleanRecipesRequired state and adjusts recipe map initialization defaults.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@onebeastchris onebeastchris added the PR: Optimization When a PR doesn't necessarily add anything new or fix anything, but improves upon the code label May 8, 2026
Copilot AI review requested due to automatic review settings May 11, 2026 20:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@onebeastchris onebeastchris merged commit ae4e65a into GeyserMC:master May 11, 2026
6 checks passed
@onebeastchris onebeastchris deleted the fix/crafting-data-resend branch May 11, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Optimization When a PR doesn't necessarily add anything new or fix anything, but improves upon the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants