Package dev.majek.chattools
Class TextComponentCutter
- java.lang.Object
-
- dev.majek.chattools.TextComponentCutter
-
public class TextComponentCutter extends Object
Cut components into a list based on a specified max length.
-
-
Constructor Summary
Constructors Constructor Description 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull List<net.kyori.adventure.text.Component>cutComponent(@NotNull net.kyori.adventure.text.Component component)Cut a component into a list of components of the correct 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 cutmaxLength- 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
-
-