Skip to content

Direct nbt component serialization#3860

Draft
Janmm14 wants to merge 5 commits intoSpigotMC:masterfrom
Janmm14:direct-nbt-component-serialization
Draft

Direct nbt component serialization#3860
Janmm14 wants to merge 5 commits intoSpigotMC:masterfrom
Janmm14:direct-nbt-component-serialization

Conversation

@Janmm14
Copy link
Contributor

@Janmm14 Janmm14 commented Jul 13, 2025

  • NBT to Components
  • Components to NBT
  • Test Components to NBT
  • NBT to Dialog
  • Dialog to NBT
  • Test Dialog

Input needed on these things

  • Please comment about the first part of the converter implementation.
  • Without thinking, I just created this in the proxy module, butI am open to creating a new module for this or putting it into some other module - please suggest where it should belong into.
  • Tests: Other potentially missing tests to add?
  • Tests: Possible improvents about the current way of testing?

Changes which will be done

  • Tests: I intend to add another test with extras in extras.
  • The toString stuff will be removed before final (just inside for easier testing).
  • Separate PR for ComponentBuilder.shadowColor created: Add shadowColor to ComponentBuilder #3861. Once it is merged, I will rebase, so those changes are no longer in here. (It is in here atm because of a test using this).

Closes #3852

@Janmm14 Janmm14 force-pushed the direct-nbt-component-serialization branch 3 times, most recently from 0ee714a to 43854e3 Compare July 13, 2025 19:01
{
context.deserialize( element, BaseComponent.class )
} );
return new Text( context.<BaseComponent>deserialize( element, BaseComponent.class ) );
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this change be in a separate PR?

@Janmm14 Janmm14 force-pushed the direct-nbt-component-serialization branch 2 times, most recently from 52a66a7 to 8e47954 Compare July 15, 2025 12:25
Janmm14 added 5 commits July 21, 2025 14:43
- stop mentioning null values
- use shorter names
- seamless integration of style's toString

Also use just one string builder and keep track of whether a comma is needed before the next property.
@Janmm14 Janmm14 force-pushed the direct-nbt-component-serialization branch from 8e47954 to 3535dfb Compare July 21, 2025 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Performance+: Direct (de-)serialization nbt <-> components

1 participant