Repository navigation
fix double item remap in set_entity_data translation - #664
Open
DustinReynoldsPE wants to merge 1 commit into
Open
DustinReynoldsPE wants to merge 1 commit into
DustinReynoldsPE wants to merge 1 commit into
Conversation
translate_entity_data already remaps item-stack values while rewriting serializer ids, so remap_inbound's SetEntityData arm applied the wire-to- native item remap a second time. On a 26.3 wire an oak_log (163) arrived as waxed_weathered_cut_copper_slab: 163 -> 161 at the frame level, then 161 -> 159 through the typed pass. Item entities and any other metadata item stacks rendered as wrong items on every non-765 translated session. Gate the typed remap on the wire version whose frame rewrite leaves the item id in wire space (1.21.5 / translate_item_765).
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.
Fixes #663
Summary
translate_entity_dataalready remaps item-stack values while rewriting serializer ids, soremap_inbound'sSetEntityDataarm applied the wire-to-native item remap a second time. On a 26.3 wire anoak_log(163) arrived aswaxed_weathered_cut_copper_slab: 163 -> 161 at the frame level, then 161 -> 159 through the typed pass. Item entities and any other metadata item stacks rendered as wrong items on every translated session except 765, wheretranslate_item_765deliberately leaves the id in wire space for this pass.The fix gates the typed remap on
game_ids.is_none_or(|g| g.v765.is_some())so it only runs when the frame-level rewrite left the item id in wire space.Test plan
entity_data_item_remaps_once_777— 777set_entity_dataframe carrying oak_log (163) decodes toItemKind::OakLogaftertranslate_decode_and_remap; fails without the fix (decodes aswaxed_weathered_cut_copper_slab), passes with itentity_data_item_remaps_765— 765 wire stack (765 item id 27) still decodes toGrassBlock, so the typed remap remains active where the frame rewrite doesn't cover itoak_logitem entities rendered as copper slabs before, render correctly after