DataConverter V5007 leaves minecraft:swing_animation in tooltip_display hidden_components, items fail to decode
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 82/100
Hướng nghiên cứu
Tìm bước nâng cấp V5007 trong mã nguồn của DataConverter (tiêu đề issue có nêu tên nó) và đọc cách nó hiện tách minecraft:swing_animation thành attack_animation/interact_animation cho chính component. Mở rộng đúng phép ánh xạ đó để viết lại các id bên trong danh sách hidden_components của minecraft:tooltip_display, sau đó tái tạo với một stack 26.2 (hoặc ví dụ /give) và xác nhận rằng decode của Item thành công trên 26.3.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Expected behavior
A 26.2 item stack whose minecraft:tooltip_display lists minecraft:swing_animation in hidden_components loads on 26.3, with that entry replaced by minecraft:attack_animation and minecraft:interact_animation. That's the same split V5007 already applies to the component itself.
Observed/Actual behavior
The converter moves the minecraft:swing_animation component but leaves the id in tooltip_display.hidden_components. TooltipDisplay.CODEC decodes that list with plain DataComponentType.CODEC.listOf(), so the unknown id fails the whole stack:
java.lang.IllegalStateException: Unknown registry key in ResourceKey[minecraft:root / minecraft:data_component_type]: minecraft:swing_animation missed input: {"minecraft:tooltip_display":{hidden_components:["minecraft:enchantments","minecraft:item_model","minecraft:max_stack_size","minecraft:repair_cost","minecraft:food","minecraft:swing_animation","minecraft:tooltip_display","minecraft:custom_data","minecraft:use_effects","minecraft:rarity","minecraft:break_sound","minecraft:consumable"]}}
at com.mojang.serialization.DataResult$Error.getOrThrow(DataResult.java:287)
at com.mojang.serialization.DataResult.getOrThrow(DataResult.java:81)
at io.papermc.paper.util.MCUtil.deserializeItem(MCUtil.java:295)
at io.papermc.paper.PaperServerInternalAPIBridge.deserializeItem(PaperServerInternalAPIBridge.java:199)
at org.bukkit.inventory.ItemStack.deserializeBytes(ItemStack.java:770)
...
Steps/models to reproduce
Plugin route (what we hit):
- On 26.2, store the result of
ItemStack#serializeAsBytes()for any stack whose tooltip_display listsminecraft:swing_animationinhidden_components. - On 26.3, pass those bytes to
ItemStack.deserializeBytes(...). It throws the exception above.
In-world route:
- On 26.2:
/give @s minecraft:diamond_sword[minecraft:tooltip_display={hidden_components:["minecraft:swing_animation"]}] - Stop the server and upgrade to 26.3.
- Join. The stack fails to decode while the player data loads.
Plugin and Datapack List
None / just a test plugin
Paper version
This server is running Paper version 26.3-159-main@a4b87cf (2026-10-06T18:24:33Z) (Implementing API version 26.3.build.159-beta)
You are running the latest version
Previous version: 26.3-158-bfb089d (MC: 26.3)
Other
No response
- Ngôn ngữ chính
- Java
- Star
- 77
- Fork
- 12
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của PaperMC/DataConverter
-
Failed to convert json to nbtĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
PaperMC/DataConverter#26 · 5 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
PaperMC/DataConverter#14 · 1 reaction ·
Tất cả issue của PaperMC/DataConverter
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
tchiotludo/akhq#3438 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Paul-Austin-Oswego-CSC480-HCI521/gift-app#266 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
ome/bioformats#4509 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày