Class TemporaryAdventureConverter

java.lang.Object
org.geysermc.geyser.platform.velocity.TemporaryAdventureConverter

public final class TemporaryAdventureConverter extends Object
Utility class for converting our shaded Adventure into the Adventure bundled in Velocity. TODO THIS IS TEMPORARY UNTIL VELOCITY UPDATES TO ADVENTURE 5.x!
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.velocitypowered.api.proxy.server.ServerPing.Builder
    description(com.velocitypowered.api.proxy.server.ServerPing.Builder builder, @Nullable Object nativeComponent)
    Sets a ServerPing.Builder's description from a native (unrelocated) Component.
    static @Nullable Object
    getDescriptionComponent(com.velocitypowered.api.proxy.server.ServerPing ping)
    Gets a ServerPing's description as a native (unrelocated) Component.
    static @Nullable Object
    motd(com.velocitypowered.api.proxy.config.ProxyConfig config)
    Gets the configured MOTD as a native (unrelocated) Component.
    static void
    sendMessage(com.velocitypowered.api.command.CommandSource target, String message)
     
    static void
    sendMessage(com.velocitypowered.api.command.CommandSource target, net.kyori.adventure.text.Component component)
    Sends one of our (shaded) Components to a Velocity CommandSource, going through its native Adventure.
    static @Nullable String
    toJson(@Nullable Object nativeComponent)
    Serializes a native (unrelocated) Component - e.g.
    static @Nullable Object
    Converts legacy-formatted text directly into an unrelocated Component
    static @Nullable Object
    toNativeComponentFromLegacyString(net.kyori.adventure.text.Component component)
    Converts one of our (shaded) Components into an unrelocated Component.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • sendMessage

      public static void sendMessage(com.velocitypowered.api.command.CommandSource target, net.kyori.adventure.text.Component component)
      Sends one of our (shaded) Components to a Velocity CommandSource, going through its native Adventure.
    • toNativeComponentFromLegacyString

      public static @Nullable Object toNativeComponentFromLegacyString(net.kyori.adventure.text.Component component)
      Converts one of our (shaded) Components into an unrelocated Component.
    • sendMessage

      public static void sendMessage(com.velocitypowered.api.command.CommandSource target, String message)
    • toNativeComponentFromLegacyString

      public static @Nullable Object toNativeComponentFromLegacyString(String message)
      Converts legacy-formatted text directly into an unrelocated Component
    • toJson

      public static @Nullable String toJson(@Nullable Object nativeComponent)
      Serializes a native (unrelocated) Component - e.g. one obtained from Velocity's own API - into json.
    • motd

      public static @Nullable Object motd(com.velocitypowered.api.proxy.config.ProxyConfig config)
      Gets the configured MOTD as a native (unrelocated) Component.
    • description

      public static com.velocitypowered.api.proxy.server.ServerPing.Builder description(com.velocitypowered.api.proxy.server.ServerPing.Builder builder, @Nullable Object nativeComponent)
      Sets a ServerPing.Builder's description from a native (unrelocated) Component.
    • getDescriptionComponent

      public static @Nullable Object getDescriptionComponent(com.velocitypowered.api.proxy.server.ServerPing ping)
      Gets a ServerPing's description as a native (unrelocated) Component.