Class VersionedComponentSerializer
java.lang.Object
com.kamikazejam.kamicommon.nms.serializer.VersionedComponentSerializer
Provider for version-specific adventure component wrappers.
This provider selects the appropriate VersionedComponent implementation
based on the current Minecraft version, handling the evolution of
the adventure api and its integration natively into paper.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull VersionedComponentdeserializeMiniMessage(@NotNull String miniMessage) Deserialize a MiniMessage string into aVersionedComponent.@NotNull VersionedComponentfromInternalComponent(com.kamikazejam.kamicommon.nms.text.kyori.adventure.text.Component component) Convert a string (treated as plain text) into aVersionedComponentfor this version.
Does not support any color codes or mini message parsings.@NotNull VersionedComponentfromLegacyAmpersand(@NotNull String legacy) Convert a legacy ampersand (&) string into aVersionedComponentfor this version.
Will ignore section (§) codes.@NotNull VersionedComponentfromLegacySection(@NotNull String legacy) Convert a legacy section (§) string into aVersionedComponentfor this version.
Will ignore ampersand (&) codes.@NotNull VersionedComponentfromMiniMessage(@NotNull String miniMessage) Convert a MiniMessage string into aVersionedComponentfor this version.
Does not convert or support legacy codes (& or §).@NotNull VersionedComponentfromPlainText(@NotNull String text) Convert a string (treated as plain text) into aVersionedComponentfor this version.
Does not support any color codes or mini message parsings.@NotNull StringserializeMiniMessage(@NotNull VersionedComponent component) Serialize aVersionedComponentback into a MiniMessage string.
-
Constructor Details
-
VersionedComponentSerializer
public VersionedComponentSerializer()
-
-
Method Details
-
fromInternalComponent
@NotNull public @NotNull VersionedComponent fromInternalComponent(@NotNull com.kamikazejam.kamicommon.nms.text.kyori.adventure.text.Component component) Convert a string (treated as plain text) into aVersionedComponentfor this version.
Does not support any color codes or mini message parsings. See other methods for those. -
fromPlainText
Convert a string (treated as plain text) into aVersionedComponentfor this version.
Does not support any color codes or mini message parsings. See other methods for those. -
fromMiniMessage
Convert a MiniMessage string into aVersionedComponentfor this version.
Does not convert or support legacy codes (& or §). SeefromLegacyAmpersand(String)andfromLegacySection(String)for those. -
fromLegacyAmpersand
Convert a legacy ampersand (&) string into aVersionedComponentfor this version.
Will ignore section (§) codes. SeefromLegacySection(String)for that. -
fromLegacySection
Convert a legacy section (§) string into aVersionedComponentfor this version.
Will ignore ampersand (&) codes. SeefromLegacyAmpersand(String)for that. -
serializeMiniMessage
@NotNull public @NotNull String serializeMiniMessage(@NotNull @NotNull VersionedComponent component) Serialize aVersionedComponentback into a MiniMessage string. -
deserializeMiniMessage
@NotNull public @NotNull VersionedComponent deserializeMiniMessage(@NotNull @NotNull String miniMessage) Deserialize a MiniMessage string into aVersionedComponent.
-