Class TextComponentCutter


  • public class TextComponentCutter
    extends Object
    Cut components into a list based on a specified max length.
    • Constructor Detail

      • TextComponentCutter

        public TextComponentCutter​(@org.jetbrains.annotations.Range(from=0L, to=2147483647L) int cutLength,
                                   @org.jetbrains.annotations.Range(from=0L, to=2147483647L) int maxLength)
        Create a new component cutter.
        Parameters:
        cutLength - the length to start looking for a space for a clean cut
        maxLength - the max length to stop looking for spaces and cut with a dash
    • Method Detail

      • cutComponent

        @NotNull
        public @NotNull List<net.kyori.adventure.text.Component> cutComponent​(@NotNull
                                                                              @NotNull net.kyori.adventure.text.Component component)
        Cut a component into a list of components of the correct length.
        Parameters:
        component - the component to cut
        Returns:
        list of components of appropriate length