Paper icon indicating copy to clipboard operation
Paper copied to clipboard

Some item text components are not correctly upgraded from 1.20.2 to 1.20.4+

Open OrangeCatUnderscore opened this issue 10 months ago • 9 comments

Expected behavior

The text components on the item are correctly upgraded to 1.20.4, regardless of if there is quotes around true/false text components.

Observed/Actual behavior

The item appears to have no name/lore if quotes are present around a true/false. While the quotes were technically still considered incorrect before 1.20.4, older versions were less strict and rendered names and lore fine.

Steps/models to reproduce

On a 1.20.2 server, /give yourself 2 items: /give @s cookie{display:{Name:'{"text":"Item with quotes on false","color":"yellow","italic":"false"}'}} /give @s cookie{display:{Name:'{"text":"Item without quotes on false","color":"yellow","italic":false}'}}

Both items should render correctly: 2024-04-07_01 48 55 2024-04-07_01 48 57

Update that server to 1.20.4, and the item with quotes around false loses it's name completely, while the one without continues to work fine: 2024-04-07_01 54 36 2024-04-07_01 54 39

Plugin and Datapack List

plugins [01:38:05 INFO]: Server Plugins (0): datapack list [01:38:28 INFO]: There are 2 data pack(s) enabled: [vanilla (built-in)], [file/bukkit (world)] [01:38:28 INFO]: There are no more data packs available

Paper version

version [01:57:25 INFO]: Checking version, please wait... [01:57:25 INFO]: This server is running Paper version git-Paper-477 (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) (Git: 1207162) You are running the latest version Previous version: git-Paper-318 (MC: 1.20.2)

Other

This is an upstream issue with vanilla, but due to the potential for it to damage custom items on servers, I feel that it is within scope for Paper to patch. I've created a report on Mojang's bug tracker here: https://bugs.mojang.com/browse/MC-270473 It's worth noting that Paper is worse off than vanilla here, as the items that have the now-invalid NBT just get the tag completely stripped rather than it just not rendering the name/lore.

OrangeCatUnderscore avatar Apr 07 '24 07:04 OrangeCatUnderscore

Kinda related to this vanilla issue, https://bugs.mojang.com/browse/MC-267221. This was caused by the recent change in how vanilla serializes/deserializes components, only using straight boolean values instead of coercing a boolean string into a boolean value.

Machine-Maker avatar Apr 07 '24 07:04 Machine-Maker

It's certainly related to that, yeah. This is probably something that should be in the vanilla DFU, but we may or may not see that in 1.20.5

OrangeCatUnderscore avatar Apr 07 '24 07:04 OrangeCatUnderscore

I would open an issue on the tracker specific to your issue here, I couldn't find one that exactly matches up. Worst case it gets closed and duplicate and linked to the one I did find.

I'm not sure we would even want to mess around with adding our own DFU/DataConverter logic to try and handle these cases if mojang didn't fix it themselves.

Machine-Maker avatar Apr 08 '24 00:04 Machine-Maker

I've already created an issue on the Mojang bug tracker, currently waiting to see where that goes.

OrangeCatUnderscore avatar Apr 08 '24 01:04 OrangeCatUnderscore

I've already created an issue on the Mojang bug tracker, currently waiting to see where that goes.

Oh lol, somehow I missed that at the bottom of your issue. nice.

Machine-Maker avatar Apr 08 '24 01:04 Machine-Maker

this is still present in vanilla 1.20.5/6, still nothing from the Mojang devs unfortunately

OrangeCatUnderscore avatar Apr 29 '24 20:04 OrangeCatUnderscore

Still present in vanilla 1.21-rc1.. Hopefully Mojang patches it before 1.21 releases.

OrangeCatUnderscore avatar Jun 11 '24 04:06 OrangeCatUnderscore

Just to update the status, it would seem Mojang has "resolved" the issue as "WontFix". https://bugs.mojang.com/browse/MC-270473?focusedId=1344637#comment-1344637

Risusama avatar Aug 24 '24 20:08 Risusama

the issue is somewhat more minor in 1.21+, the text color is preserved but not the formatting

OrangeCatUnderscore avatar Aug 24 '24 21:08 OrangeCatUnderscore