Class Formats


  • public final class Formats
    extends Object
    Message creators for use in command output.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static net.kyori.adventure.text.Component COMMA  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static net.kyori.adventure.text.Component bool​(boolean value)  
      static net.kyori.adventure.text.Component contexts​(Set<ca.stellardrift.permissionsex.context.ContextValue<?>> contexts)  
      static String formatCommand​(cloud.commandframework.Command.Builder<?> command, Map<cloud.commandframework.arguments.CommandArgument<?,​?>,​String> placeholders)
      Format the specified command, filling in arguments as provided until the first unset non-static argument is encountered.
      static String formatCommand​(cloud.commandframework.Command<?> command, cloud.commandframework.arguments.CommandArgument<?,​?> arg1, String val1)  
      static String formatCommand​(cloud.commandframework.Command<?> command, cloud.commandframework.arguments.CommandArgument<?,​?> arg1, String val1, cloud.commandframework.arguments.CommandArgument<?,​?> arg2, String val2)  
      static String formatCommand​(cloud.commandframework.Command<?> command, Map<cloud.commandframework.arguments.CommandArgument<?,​?>,​String> placeholders)
      Format the specified command, filling in arguments as provided until the first unset non-static argument is encountered.
      static net.kyori.adventure.text.format.TextColor lerp​(float pct, net.kyori.adventure.text.format.TextColor from, net.kyori.adventure.text.format.TextColor to)  
      static net.kyori.adventure.text.Component message​(Throwable throwable)  
      static net.kyori.adventure.text.Component option​(String option, String value)  
      static net.kyori.adventure.text.Component permission​(String permission, int value)
      Represent a permission and its value in a user-visible way.
      static net.kyori.adventure.text.Component permissionValue​(int value)  
    • Field Detail

      • COMMA

        public static final net.kyori.adventure.text.Component COMMA
    • Method Detail

      • permission

        public static net.kyori.adventure.text.Component permission​(String permission,
                                                                    int value)
        Represent a permission and its value in a user-visible way. The output will appear as <permisison>=<value>.
        Parameters:
        permission - the permission
        value - its value, listed and used for colouring
        Returns:
        the formatted permission
        Since:
        2.0.0
      • permissionValue

        public static net.kyori.adventure.text.Component permissionValue​(int value)
      • option

        public static net.kyori.adventure.text.Component option​(String option,
                                                                String value)
      • bool

        public static net.kyori.adventure.text.Component bool​(boolean value)
      • contexts

        public static net.kyori.adventure.text.Component contexts​(Set<ca.stellardrift.permissionsex.context.ContextValue<?>> contexts)
      • formatCommand

        public static String formatCommand​(cloud.commandframework.Command<?> command,
                                           Map<cloud.commandframework.arguments.CommandArgument<?,​?>,​String> placeholders)
        Format the specified command, filling in arguments as provided until the first unset non-static argument is encountered.
        Parameters:
        command - the command to format
        placeholders - arguments to fill in
        Returns:
        the formatted command
      • formatCommand

        public static String formatCommand​(cloud.commandframework.Command.Builder<?> command,
                                           Map<cloud.commandframework.arguments.CommandArgument<?,​?>,​String> placeholders)
        Format the specified command, filling in arguments as provided until the first unset non-static argument is encountered.
        Parameters:
        command - the command to format
        placeholders - arguments to fill in
        Returns:
        the formatted command
      • formatCommand

        public static String formatCommand​(cloud.commandframework.Command<?> command,
                                           cloud.commandframework.arguments.CommandArgument<?,​?> arg1,
                                           String val1)
      • formatCommand

        public static String formatCommand​(cloud.commandframework.Command<?> command,
                                           cloud.commandframework.arguments.CommandArgument<?,​?> arg1,
                                           String val1,
                                           cloud.commandframework.arguments.CommandArgument<?,​?> arg2,
                                           String val2)
      • message

        public static net.kyori.adventure.text.Component message​(Throwable throwable)
      • lerp

        public static net.kyori.adventure.text.format.TextColor lerp​(float pct,
                                                                     net.kyori.adventure.text.format.TextColor from,
                                                                     net.kyori.adventure.text.format.TextColor to)