Re-assembling chained-components doubles the contents
See original GitHub issueJust wondering if this is intended behaviour:
GsonComponentSerializer gsonComponentSerializer = GsonComponentSerializer.gson();
String jsonString = "[\"\",{\"text\":\"abc\",\"color\":\"dark_blue\"},{\"text\":\"de\",\"color\":\"blue\"},{\"text\":\"fghi\",\"color\":\"green\"},{\"text\":\"jklm\",\"color\":\"dark_purple\"},{\"text\":\"nop\",\"color\":\"light_purple\"},{\"text\":\"qrs\",\"color\":\"red\"},{\"text\":\"tuv\",\"color\":\"dark_red\"},{\"text\":\"wx\",\"color\":\"gold\"},{\"text\":\"yz\",\"color\":\"yellow\"}]";
Component component = gsonComponentSerializer.deserialize(jsonString);
commandSender.sendMessage(component);
List<Component> list = new ArrayList<>();
component.iterable(ComponentIteratorType.DEPTH_FIRST).forEach(list::add);
commandSender.sendMessage("component amount: " + list.size());
Component rebuiltComponent = Component.text("");
for (Component c : component.iterable(ComponentIteratorType.DEPTH_FIRST)) {
rebuiltComponent = rebuiltComponent.append(c);
commandSender.sendMessage(c);
}
commandSender.sendMessage("rebuilt component: ");
commandSender.sendMessage(rebuiltComponent);
Result: https://i.gyazo.com/c56bdee7ce3d1dc5687f0cceafb2db34.png
Expected result was for the rebuiltComponent to be re-assembled the same as component
paper:
This server is running Paper version git-Paper-399 (MC: 1.17.1) (Implementing API version 1.17.1-R0.1-SNAPSHOT) (Git: d4318a6 on ver/1.17.1)
You are 10 version(s) behind
Download the new version at: https://papermc.io/downloads
Previous version: git-Paper-388 (MC: 1.17.1)
Thank you
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Discovery of the structure of DNA (article) - Khan Academy
DNA nucleotides assemble in chains linked by covalent bonds, which form between the deoxyribose sugar of one nucleotide and the phosphate group of...
Read more >CH103 – Chapter 8: The Major Macromolecules – Chemistry
(a) This molecule of stearic acid has a long chain of carbon atoms. (b) Glycine, a component of proteins, contains carbon, nitrogen, oxygen,...
Read more >The Shape and Structure of Proteins - NCBI Bookshelf
The folded structure is stabilized by noncovalent interactions between different parts of the polypeptide chain. The amino acids with hydrophobic side chains ...
Read more >Lipids - Fatty Acids - MSU chemistry
The common feature of these lipids is that they are all esters of moderate to long chain fatty acids. Acid or base-catalyzed hydrolysis...
Read more >A Complete Look at How to Assemble a Wedding Invitation Suite
The names of all invited guests should be placed on the front along with the mailing address. Your return address should be placed...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

If you can think of a good way to word this then feel free to submit a PR.
Well, it may be obvious to you, but wasn’t to me - to the point of me hard-crashing my test server and opening an issue. Putting information like that the javadocs would spare people that aren’t as well-versed as y’all a bunch of trouble.