Class VersionedComponentSerializer
java.lang.Object
com.kamikazejam.kamicommon.nms.serializer.VersionedComponentSerializer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull NmsBundlebundleFor(int ver) The one ladder that decides which module builds aVersionedComponentfor this server.@NotNull VersionedComponentdeserializeMiniMessage(@NotNull String miniMessage) @NotNull VersionedComponentBuilds a component from Minecraft's JSON representation.@NotNull VersionedComponentfromLegacyAmpersand(@NotNull String legacy) @NotNull VersionedComponentfromLegacySection(@NotNull String legacy) @NotNull VersionedComponentfromMiniMessage(@NotNull String miniMessage) @NotNull VersionedComponentfromMiniMessage(@NotNull String miniMessage, @NotNull TextPlaceholder... placeholders) MiniMessage with tag replacements.@NotNull VersionedComponentfromPlainText(@NotNull String text) @NotNull StringserializeMiniMessage(@NotNull VersionedComponent component)
-
Constructor Details
-
VersionedComponentSerializer
public VersionedComponentSerializer()
-
-
Method Details
-
bundleFor
The one ladder that decides which module builds aVersionedComponentfor this server.Public because
VersionedComponentUtilmust use the same one. Its ItemMeta read methods construct components too, and the concrete type decides whether the result can carry a hex colour when it is later sent. Two ladders meant two answers for the same server.- Parameters:
ver- the formatted NMS integer for the running server- Returns:
- the module to construct through
-
fromJson
Builds a component from Minecraft's JSON representation.Replaced
fromInternalComponent(Component), removed 2026-08-30. That method required the caller to construct a relocated Adventure component, which is impossible once the relocated package is hidden, so it was unusable in the same way its counterpart was. -
fromPlainText
-
fromMiniMessage
-
fromMiniMessage
@NotNull public @NotNull VersionedComponent fromMiniMessage(@NotNull @NotNull String miniMessage, @NotNull @NotNull TextPlaceholder... placeholders) MiniMessage with tag replacements.Replaces the pattern of building an Adventure
TagResolverat the call site and passing the result through the removed fromInternalComponent, which required naming the shaded Adventure copy from outside theversions/*modules. -
fromLegacyAmpersand
-
fromLegacySection
-
serializeMiniMessage
@NotNull public @NotNull String serializeMiniMessage(@NotNull @NotNull VersionedComponent component) -
deserializeMiniMessage
@NotNull public @NotNull VersionedComponent deserializeMiniMessage(@NotNull @NotNull String miniMessage)
-