Class VersionedComponentSerializer

java.lang.Object
com.kamikazejam.kamicommon.nms.serializer.VersionedComponentSerializer

public class VersionedComponentSerializer extends Object
  • Constructor Details

    • VersionedComponentSerializer

      public VersionedComponentSerializer()
  • Method Details

    • bundleFor

      @NotNull public static @NotNull NmsBundle bundleFor(int ver)
      The one ladder that decides which module builds a VersionedComponent for this server.

      Public because VersionedComponentUtil must 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

      @NotNull public @NotNull VersionedComponent fromJson(@NotNull @NotNull String json)
      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

      @NotNull public @NotNull VersionedComponent fromPlainText(@NotNull @NotNull String text)
    • fromMiniMessage

      @NotNull public @NotNull VersionedComponent fromMiniMessage(@NotNull @NotNull String miniMessage)
    • 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 TagResolver at the call site and passing the result through the removed fromInternalComponent, which required naming the shaded Adventure copy from outside the versions/* modules.

    • fromLegacyAmpersand

      @NotNull public @NotNull VersionedComponent fromLegacyAmpersand(@NotNull @NotNull String legacy)
    • fromLegacySection

      @NotNull public @NotNull VersionedComponent fromLegacySection(@NotNull @NotNull String legacy)
    • serializeMiniMessage

      @NotNull public @NotNull String serializeMiniMessage(@NotNull @NotNull VersionedComponent component)
    • deserializeMiniMessage

      @NotNull public @NotNull VersionedComponent deserializeMiniMessage(@NotNull @NotNull String miniMessage)