Class ChatMessages

java.lang.Object
ch.njol.skript.util.chat.ChatMessages

@Deprecated(since="2.15", forRemoval=true) public class ChatMessages extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Handles parsing chat messages.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    If color codes should also function as reset code.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Link parse mode for potential links which are not marked with tags.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Copies styles from component to another.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Parses a string that may only contain colour codes using the '§' character to a list of components.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Parses a string to list of chat message components.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs plain text only message component.
    static void
    registerAddonCode(@Nullable SkriptAddon addon, @Nullable ChatCode code)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Registers a chat code.
    static void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Registers language change listener for chat system.
    static void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    static String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Strips all styles from given string.
    static String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    static String
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class Object

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

    • linkParseMode

      public static LinkParseMode linkParseMode
      Deprecated, for removal: This API element is subject to removal in a future version.
      Link parse mode for potential links which are not marked with tags.
    • colorResetCodes

      public static boolean colorResetCodes
      Deprecated, for removal: This API element is subject to removal in a future version.
      If color codes should also function as reset code.
  • Constructor Details

    • ChatMessages

      public ChatMessages()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • registerListeners

      public static void registerListeners()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Registers language change listener for chat system. Called once by Skript, please don't call this addon developers.
    • parse

      public static List<MessageComponent> parse(String msg)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parses a string to list of chat message components.
      Parameters:
      msg - Input string.
      Returns:
      List with components.
    • parseToArray

      public static MessageComponent[] parseToArray(String msg)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • fromParsedString

      public static List<MessageComponent> fromParsedString(String msg)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parses a string that may only contain colour codes using the '§' character to a list of components.
    • toJson

      public static String toJson(String msg)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • toJson

      public static String toJson(List<MessageComponent> components)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • copyStyles

      public static void copyStyles(MessageComponent from, MessageComponent to)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Copies styles from component to another. Note that this only copies additional styling, i.e. if text was not bold and is bold, it will remain bold.
      Parameters:
      from -
      to -
    • shareStyles

      public static void shareStyles(MessageComponent[] components)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • plainText

      public static MessageComponent plainText(String str)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs plain text only message component.
      Parameters:
      str -
    • registerAddonCode

      public static void registerAddonCode(@Nullable @Nullable SkriptAddon addon, @Nullable @Nullable ChatCode code)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Registers a chat code. This is for addon developers.
      Parameters:
      code - Something that implements ChatCode. For inspiration, check SkriptChatCode source code.
    • stripStyles

      public static String stripStyles(String text)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Strips all styles from given string.
      Parameters:
      text - String to strip styles from.
      Returns:
      A string without styles.