Class TemporaryAdventureConverter
java.lang.Object
org.geysermc.geyser.platform.velocity.TemporaryAdventureConverter
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 TypeMethodDescriptionstatic com.velocitypowered.api.proxy.server.ServerPing.Builderdescription(com.velocitypowered.api.proxy.server.ServerPing.Builder builder, @Nullable Object nativeComponent) Sets aServerPing.Builder's description from a native (unrelocated) Component.static @Nullable ObjectgetDescriptionComponent(com.velocitypowered.api.proxy.server.ServerPing ping) Gets aServerPing's description as a native (unrelocated) Component.static @Nullable Objectmotd(com.velocitypowered.api.proxy.config.ProxyConfig config) Gets the configured MOTD as a native (unrelocated) Component.static voidsendMessage(com.velocitypowered.api.command.CommandSource target, String message) static voidsendMessage(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 StringSerializes a native (unrelocated) Component - e.g.static @Nullable ObjecttoNativeComponentFromLegacyString(String message) Converts legacy-formatted text directly into an unrelocated Componentstatic @Nullable ObjecttoNativeComponentFromLegacyString(net.kyori.adventure.text.Component component) Converts one of our (shaded) Components into an unrelocated Component.
-
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
Converts legacy-formatted text directly into an unrelocated Component -
toJson
Serializes a native (unrelocated) Component - e.g. one obtained from Velocity's own API - into json. -
motd
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 aServerPing.Builder's description from a native (unrelocated) Component. -
getDescriptionComponent
public static @Nullable Object getDescriptionComponent(com.velocitypowered.api.proxy.server.ServerPing ping) Gets aServerPing's description as a native (unrelocated) Component.
-