Class VoxelSniperText
java.lang.Object
com.thevoxelbox.voxelsniper.util.message.VoxelSniperText
Component text utilities for VoxelSniper.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.enginehub.piston.config.ConfigHolder -
Method Summary
Modifier and TypeMethodDescriptionstatic com.sk89q.worldedit.util.formatting.text.ComponentFormats a component according to locale, prefix presence and children.static <T> com.sk89q.worldedit.util.formatting.text.ComponentformatList(Collection<T> collection, BiFunction<T, T, Integer> compareFunction, Function<T, com.sk89q.worldedit.util.formatting.text.Component> transformFunction, String path) Formats simple list component (same delimiter).static <T> com.sk89q.worldedit.util.formatting.text.ComponentformatListWithCurrent(Collection<T> collection, BiFunction<T, T, Integer> compareFunction, Function<T, com.sk89q.worldedit.util.formatting.text.Component> transformFunction, Function<T, Object> extractFunction, Object current, String path) Formats list with current component (delimiter may differ).static com.sk89q.worldedit.util.formatting.text.ComponentgetStatus(boolean status) Gets corresponding status.static voidprint(CommandSender target, com.sk89q.worldedit.util.formatting.text.Component component) Print.static voidprint(CommandSender target, com.sk89q.worldedit.util.formatting.text.Component component, boolean prefix) Prints a component.static voidprint(CommandSender target, com.sk89q.worldedit.util.formatting.text.Component component, Locale locale, boolean prefix) Prints a component.static StringreduceToText(com.sk89q.worldedit.util.formatting.text.Component component, Locale locale, boolean prefix) Reduces a caption to plain text.
-
Field Details
-
CONFIG_HOLDER
public static final org.enginehub.piston.config.ConfigHolder CONFIG_HOLDER
-
-
Method Details
-
print
public static void print(CommandSender target, com.sk89q.worldedit.util.formatting.text.Component component) Print.- Parameters:
target- the targetcomponent- the component- Since:
- 2.7.0
-
print
public static void print(CommandSender target, com.sk89q.worldedit.util.formatting.text.Component component, boolean prefix) Prints a component.- Parameters:
target- the targetcomponent- the componentprefix- the prefix- Since:
- 2.7.0
-
print
public static void print(CommandSender target, com.sk89q.worldedit.util.formatting.text.Component component, Locale locale, boolean prefix) Prints a component.- Parameters:
target- the targetcomponent- the componentlocale- the localeprefix- the prefix- Since:
- 2.7.0
-
format
public static com.sk89q.worldedit.util.formatting.text.Component format(com.sk89q.worldedit.util.formatting.text.Component component, Locale locale, boolean prefix) Formats a component according to locale, prefix presence and children.- Parameters:
component- the componentlocale- the localeprefix- the prefix- Returns:
- the component
- Since:
- 2.7.0
-
reduceToText
public static String reduceToText(com.sk89q.worldedit.util.formatting.text.Component component, Locale locale, boolean prefix) Reduces a caption to plain text.- Parameters:
component- the componentlocale- the localeprefix- the prefix- Returns:
- the string
- Since:
- 2.7.0
-
getStatus
public static com.sk89q.worldedit.util.formatting.text.Component getStatus(boolean status) Gets corresponding status.- Parameters:
status- the status- Returns:
- the status component
- Since:
- 2.7.0
-
formatList
public static <T> com.sk89q.worldedit.util.formatting.text.Component formatList(Collection<T> collection, BiFunction<T, T, Integer> compareFunction, Function<T, com.sk89q.worldedit.util.formatting.text.Component> transformFunction, String path) Formats simple list component (same delimiter).- Type Parameters:
T- the provided collection type- Parameters:
collection- the collectioncompareFunction- the compare function, compares two collection objectstransformFunction- the transform function, transforms a collection object to a componentpath- the path- Returns:
- the component
- Since:
- 2.7.0
-
formatListWithCurrent
public static <T> com.sk89q.worldedit.util.formatting.text.Component formatListWithCurrent(Collection<T> collection, BiFunction<T, T, Integer> compareFunction, Function<T, com.sk89q.worldedit.util.formatting.text.Component> transformFunction, Function<T, Object> extractFunction, Object current, String path) Formats list with current component (delimiter may differ).- Type Parameters:
T- the provided collection type- Parameters:
collection- the collectioncompareFunction- the compare function, compares two collection objectstransformFunction- the transform function, transforms a collection object to a componentextractFunction- the extract function, transforms a collection object to a current comparable objectcurrent- the currentpath- the path- Returns:
- the component
- Since:
- 2.7.0
-