Repository navigation
remap set_player_inventory item kinds on translated wires - #683
Closed
DustinReynoldsPE wants to merge 1 commit into
Closed
DustinReynoldsPE wants to merge 1 commit into
DustinReynoldsPE wants to merge 1 commit into
Conversation
Hotbar syncs arrive via set_player_inventory, which remap_inbound skipped, so every held stack kept the wire-version id decoded through the native item table (26.3 iron_shovel -> milk_bucket). Default-component lookups then found no Tool component and tools mined at bare-hand speed; hotbar slots also rendered the wrong item.
Collaborator
|
Thanks for this. This was sorted via #722 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
remap_inboundskipsClientboundGamePacket::SetPlayerInventory, so its itemstack keeps the wire-version id decoded through the native registry table on
any translated connection. Between 26.2 (native) and 26.3, 1465 item ids
shifted; e.g. a server-sent
iron_shovel(26.3 id 1046) decodes asmilk_bucketandoak_log(163) asbirch_log.This is the same class of bug as #664 (
set_entity_data), one packet over:set_player_inventoryis how servers sync hotbar/player-inventory slots in26.x (it replaced
container_set_slotwithcontainer_id = -2).Impact on non-native servers
destroy_progressresolves theTooldefault component by
ItemKind; a wrong kind has noTooldefault, somining speed falls back to 1.0. Reported against a 26.3 server: an iron
shovel broke dirt no faster than an empty hand.
between the wire and native versions (often subtle, e.g. log variants
mapping to other logs).
Fix
Add the missing arm calling
remap_stackonp.contents, matching theadjacent
ContainerSetSlot/SetCursorItem/SetEquipmenthandling.This completes the item-carrying packet coverage; the only remaining
unremapped paths are advancement icons (existing TODO) and
commandsbrigadier suggestions, both cosmetic.
Test plan
cargo test -p pomme-client player_inventory_item_remaps_777— newwire-level regression test: a 26.3
set_player_inventoryframe carryingitem id 163 decodes to
ItemKind::OakLogafter remap, notBirchLog.cargo test -p pomme-client remap— all remap tests pass.cargo fmt --all --checkclean.speed again after the fix.