Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't know how to turn into a Component #10319

Open
ghost opened this issue Mar 12, 2024 · 0 comments
Open

Don't know how to turn into a Component #10319

ghost opened this issue Mar 12, 2024 · 0 comments
Labels
status: needs triage type: bug Something doesn't work as it was intended to. version: 1.20.4 Game version 1.20.4

Comments

@ghost
Copy link

ghost commented Mar 12, 2024

Expected behavior

[12:06:11 WARN]: com.google.gson.JsonParseException: Don't know how to turn into a Component
[12:06:11 WARN]: at net.kyori.adventure.text.serializer.gson.ComponentSerializerImpl.notSureHowToDeserialize(ComponentSerializerImpl.java:337)
[12:06:11 WARN]: at net.kyori.adventure.text.serializer.gson.GsonComponentSerializerImpl.deserialize(GsonComponentSerializerImpl.java:90)
[12:06:11 WARN]: at net.kyori.adventure.text.serializer.gson.GsonComponentSerializerImpl.deserialize(GsonComponentSerializerImpl.java:41)
[12:06:11 WARN]: at io.papermc.paper.adventure.PaperAdventure.asAdventureFromJson(PaperAdventure.java:168)
[12:06:11 WARN]: at org.bukkit.craftbukkit.v1_20_R3.inventory.CraftMetaItem.lore(CraftMetaItem.java:929)

Calling .lore() fails on some old items. here is the old item NBT,

for some reason on some weird old version of paper or vanilla, its possible for lore component to be an empty string:

"Lore": [
"{"extra":[{"text":"Cool bow"}],"text":""}",
"{"extra":[{"text":"its a cool bow!"}],"text":""}",
"",
"{"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"gray","text":"Scaling 10"}],"text":""}"
],

This is exceedingly rare, I suspect this bug only existed for at most a day, I blame yaml itemstack serialization.

Full NBT:
{Count:1b,DataVersion:3700,id:"minecraft:bow",tag:{Damage:0,Enchantments:[{id:"minecraft:flame",lvl:5s},{id:"minecraft:infinity",lvl:1s},{id:"minecraft:power",lvl:7s},{id:"minecraft:unbreaking",lvl:6s}],display:{Lore:['{"extra":[{"text":"Cool bow"}],"text":""}','{"extra":[{"text":"its a cool bow!"}],"text":""}',"",'{"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"gray","text":"Scaling 10"}],"text":""}'],Name:'{"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"red","text":"Warpus"}],"text":""}'}}}

Steps/models to reproduce

Call .lore() on weird old nbt item:

/give bow{Damage:0,Enchantments:[{id:"minecraft:flame",lvl:5s},{id:"minecraft:infinity",lvl:1s},{id:"minecraft:power",lvl:7s},{id:"minecraft:unbreaking",lvl:6s}],display:{Lore:['{"extra":[{"text":"Cool bow"}],"text":""}','{"extra":[{"text":"its a cool bow!"}],"text":""}',"",'{"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"gray","text":"Scaling 10"}],"text":""}'],Name:'{"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"red","text":"Warpus"}],"text":""}'}}

item.lore() (adventure component)

Plugin and Datapack List

N/A

Paper version

This server is running Paper version git-Paper-"a0931f4" (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) (Git: a0931f4)
You are 2 version(s) behind
Download the new version at: https://papermc.io/downloads/paper
Previous version: git-Paper-"0052e2d" (MC: 1.20.4)

Other

No response

@ghost ghost added status: needs triage type: bug Something doesn't work as it was intended to. labels Mar 12, 2024
@kashike kashike added the version: 1.20.4 Game version 1.20.4 label Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage type: bug Something doesn't work as it was intended to. version: 1.20.4 Game version 1.20.4
Projects
Status: 🕑 Needs Triage
Development

No branches or pull requests

1 participant