[SPIGOT-6303] Itemstack serialization bug (lines missing from lore) Created: 01/Jan/21 Updated: 02/Jan/21 Resolved: 02/Jan/21 |
|
| Status: | Resolved |
| Project: | Spigot |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | steve | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
1.16.4 |
||
| Version: | 1.16.4 |
| Guidelines Read: | Yes |
| Description |
|
Itemstacks serialized in yaml before: Itemstacks now: {{ {"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"green","text":"Jump Boots"}}} ],"text":""}'_ {{ {"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"green","text":"Increases Jump"}}} ],"text":""}'_ {{ {"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"green","text":"Increases Speed}}} ],"text":""}'_ {{ {"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"green","text":"Jumps: 10"}}} ],"text":""}'_ This wouldn't be a problem except that the line break "- ''" isn't read and results in the line break being removed when loaded. Please convert all - '' lines to - '{"text":""}' to fix this. |
| Comments |
| Comment by blablubbabc [ 02/Jan/21 ] |
|
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/780/ |
| Comment by blablubbabc [ 02/Jan/21 ] |
|
Apparently Gson parses empty Strings as null instead of throwing an parse exception (https://github.com/google/gson/blob/master/gson/src/main/java/com/google/gson/internal/Streams.java#L55), so this will need to be specifically checked by us. Currently we only react to parse exceptions and otherwise assume that the parsing was successful. PR is on the way. |
| Comment by steve [ 02/Jan/21 ] |
|
I wrote a plugin to fix this by replacing null lore basecomponents with empty basecomponents, sorry for the trouble |
| Comment by Phoenix616 [ 02/Jan/21 ] |
|
@steve could you provide that in a code block so that the yaml formatting is preserved? |
| Comment by md_5 [ 01/Jan/21 ] |
|
> After the 1.16 lore screw up you think a lesson would have been learned, i guess not. We're trying our absolute best to fix what is an extremely complicated and suboptimal system. Unless you have something useful to contribute the commentary isn't necesssary, helpful, or welcome. |