Class AdventureSerializer

java.lang.Object
com.github.retrooper.packetevents.util.adventure.AdventureSerializer
All Implemented Interfaces:
NbtDecoder<net.kyori.adventure.text.Component>, NbtEncoder<net.kyori.adventure.text.Component>

@NullMarked public final class AdventureSerializer extends Object implements NbtEncoder<net.kyori.adventure.text.Component>, NbtDecoder<net.kyori.adventure.text.Component>
  • Method Details

    • serializer

      public static AdventureSerializer serializer(PacketWrapper<?> wrapper)
    • serializer

      public static AdventureSerializer serializer(ClientVersion version)
    • serializer

      public static AdventureSerializer serializer()
      Please use serializer(ClientVersion) instead of this if possible
    • getGsonSerializer

      @Deprecated public static net.kyori.adventure.text.serializer.gson.GsonComponentSerializer getGsonSerializer()
      Deprecated.
      use gson() instead
    • getLegacyGsonSerializer

      @Deprecated public static net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer getLegacyGsonSerializer()
      Deprecated.
      use legacy() instead
    • getLegacySerializer

      @Deprecated public static net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer getLegacySerializer()
      Deprecated.
      use legacy() instead
    • getNBTSerializer

      @Deprecated public static AdventureNBTSerializer getNBTSerializer()
      Deprecated.
      use nbt() instead
    • asVanilla

      @Deprecated public static String asVanilla(net.kyori.adventure.text.Component component)
      Deprecated.
    • fromLegacyFormat

      @Deprecated public static net.kyori.adventure.text.Component fromLegacyFormat(String legacyMessage)
      Deprecated.
      use fromLegacy(String) instead
    • toLegacyFormat

      @Deprecated public static String toLegacyFormat(net.kyori.adventure.text.Component component)
      Deprecated.
    • parseComponent

      @Deprecated public static net.kyori.adventure.text.Component parseComponent(String json)
      Deprecated.
      use fromJson(String) instead
    • parseJsonTree

      @Deprecated public static net.kyori.adventure.text.Component parseJsonTree(com.google.gson.JsonElement json)
      Deprecated.
    • toJson

      @Deprecated public static String toJson(net.kyori.adventure.text.Component component)
      Deprecated.
      use asJson(Component) instead
    • toJsonTree

      @Deprecated public static com.google.gson.JsonElement toJsonTree(net.kyori.adventure.text.Component component)
      Deprecated.
    • fromNbt

      @Deprecated public static net.kyori.adventure.text.Component fromNbt(NBT tag)
      Deprecated.
    • toNbt

      @Deprecated public static NBT toNbt(net.kyori.adventure.text.Component component)
      Deprecated.
    • fromLegacy

      public net.kyori.adventure.text.Component fromLegacy(String legacy)
    • asLegacy

      public String asLegacy(net.kyori.adventure.text.Component component)
    • fromJson

      public net.kyori.adventure.text.Component fromJson(String json)
    • asJson

      public String asJson(net.kyori.adventure.text.Component component)
    • fromJsonTree

      @Contract("!null -> !null") @Nullable public @Nullable net.kyori.adventure.text.Component fromJsonTree(@Nullable @Nullable com.google.gson.JsonElement json)
    • asJsonTree

      @Contract("!null -> !null") @Nullable public @Nullable com.google.gson.JsonElement asJsonTree(@Nullable @Nullable net.kyori.adventure.text.Component component)
    • fromNbtTag

      @Deprecated public net.kyori.adventure.text.Component fromNbtTag(NBT tag)
      Deprecated.
    • fromNbtTag

      public net.kyori.adventure.text.Component fromNbtTag(NBT tag, PacketWrapper<?> wrapper)
    • asNbtTag

      @Deprecated public NBT asNbtTag(net.kyori.adventure.text.Component component)
      Deprecated.
    • asNbtTag

      public NBT asNbtTag(net.kyori.adventure.text.Component component, PacketWrapper<?> wrapper)
    • gson

      public net.kyori.adventure.text.serializer.gson.GsonComponentSerializer gson()
    • legacy

      public net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer legacy()
    • nbt

      public AdventureNBTSerializer nbt()
    • decode

      public net.kyori.adventure.text.Component decode(NBT nbt, PacketWrapper<?> wrapper)
      Specified by:
      decode in interface NbtDecoder<net.kyori.adventure.text.Component>
    • encode

      public NBT encode(PacketWrapper<?> wrapper, net.kyori.adventure.text.Component value)
      Specified by:
      encode in interface NbtEncoder<net.kyori.adventure.text.Component>