Class VoxelSniperText

java.lang.Object
com.thevoxelbox.voxelsniper.util.message.VoxelSniperText

public class VoxelSniperText extends Object
Component text utilities for VoxelSniper.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.enginehub.piston.config.ConfigHolder
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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).
    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).
    static com.sk89q.worldedit.util.formatting.text.Component
    getStatus(boolean status)
    Gets corresponding status.
    static void
    print(CommandSender target, com.sk89q.worldedit.util.formatting.text.Component component)
    Print.
    static void
    print(CommandSender target, com.sk89q.worldedit.util.formatting.text.Component component, boolean prefix)
    Prints a component.
    static void
    print(CommandSender target, com.sk89q.worldedit.util.formatting.text.Component component, Locale locale, boolean prefix)
    Prints a component.
    static String
    reduceToText(com.sk89q.worldedit.util.formatting.text.Component component, Locale locale, boolean prefix)
    Reduces a caption to plain text.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 target
      component - 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 target
      component - the component
      prefix - 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 target
      component - the component
      locale - the locale
      prefix - 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 component
      locale - the locale
      prefix - 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 component
      locale - the locale
      prefix - 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 collection
      compareFunction - the compare function, compares two collection objects
      transformFunction - the transform function, transforms a collection object to a component
      path - 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 collection
      compareFunction - the compare function, compares two collection objects
      transformFunction - the transform function, transforms a collection object to a component
      extractFunction - the extract function, transforms a collection object to a current comparable object
      current - the current
      path - the path
      Returns:
      the component
      Since:
      2.7.0