DataConverter V5007 leaves minecraft:swing_animation in tooltip_display hidden_components, items fail to decode

Đang mở Phù hợp với người mới
#31 5 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
data

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ả

type: bug upstream: vanilla
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):

  1. On 26.2, store the result of ItemStack#serializeAsBytes() for any stack whose tooltip_display lists minecraft:swing_animation in hidden_components.
  2. On 26.3, pass those bytes to ItemStack.deserializeBytes(...). It throws the exception above.

In-world route:

  1. On 26.2: /give @s minecraft:diamond_sword[minecraft:tooltip_display={hidden_components:["minecraft:swing_animation"]}]
  2. Stop the server and upgrade to 26.3.
  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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PaperMC/DataConverter

Tất cả issue của PaperMC/DataConverter

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.