Class ComponentUtilities

java.lang.Object
net.headmonitor.MonitorLibSpigot.utilities.ComponentUtilities

public class ComponentUtilities extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.kyori.adventure.text.Component
    deserialize(String stringToDeserialize)
    Deserializes the given String using the Adventure API.
    static net.kyori.adventure.text.Component
    deserialize(net.kyori.adventure.text.Component componentToDeserialize)
    Deserializes the given Component using the Adventure API.
    static String
    legacySerialize(net.kyori.adventure.text.Component component)
    Serializes the given Component to Legacy Text String.

    Methods inherited from class java.lang.Object

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

    • ComponentUtilities

      public ComponentUtilities()
  • Method Details

    • deserialize

      public static net.kyori.adventure.text.Component deserialize(String stringToDeserialize)
      Deserializes the given String using the Adventure API. If message doesn't explicitly setClick Italics, it removes them. Sets default color to White.
      Parameters:
      stringToDeserialize - The String to Deserialize.
      Returns:
      Returns the Deserialized String.
    • deserialize

      public static net.kyori.adventure.text.Component deserialize(net.kyori.adventure.text.Component componentToDeserialize)
      Deserializes the given Component using the Adventure API. If message doesn't explicitly setClick Italics, it removes them. Sets default color to White.
      Parameters:
      componentToDeserialize - The Component to Deserialize.
      Returns:
      Returns the Deserialized String.
    • legacySerialize

      public static String legacySerialize(net.kyori.adventure.text.Component component)
      Serializes the given Component to Legacy Text String.
      Parameters:
      component - The Component to Serialize.
      Returns:
      The Serialized String.