Class CommandUtils

java.lang.Object
org.strassburger.lifestealz.util.commands.CommandUtils

public final class CommandUtils extends Object
  • Constructor Details

    • CommandUtils

      public CommandUtils()
  • Method Details

    • parsePlayerName

      public static List<org.bukkit.entity.Player> parsePlayerName(String playerName, boolean allowPlus, LifeStealZ plugin)
      Parses a player name (or a star) to a list of players
      Parameters:
      playerName - The name of the player
      allowPlus - If true, the plus will be allowed as a wildcard for all online players
      plugin - The plugin instance
      Returns:
      A list of players (or an empty list if the player is not online)
    • parsePlayerName

      public static List<org.bukkit.entity.Player> parsePlayerName(String playerName, boolean allowPlus)
      Parses a player name (or a star) to a list of players
      Parameters:
      playerName - The name of the player
      allowPlus - If true, the plus will be allowed as a wildcard for all online players
      Returns:
      A list of players (or an empty list if the player is not online)
    • getPlayersTabCompletion

      public static List<String> getPlayersTabCompletion(boolean allowPlus, LifeStealZ plugin)
      Gets a list of player names for tab completion
      Parameters:
      allowPlus - If true, the plus will be allowed as a wildcard for all online players
      plugin - The plugin instance
      Returns:
      A list of player names
    • getPlayersTabCompletion

      public static List<String> getPlayersTabCompletion(boolean allowStar)
      Gets a list of player names for tab completion
      Parameters:
      allowStar - If true, the star will be allowed as a wildcard
      Returns:
      A list of player names
    • parseOfflinePlayer

      public static List<org.bukkit.OfflinePlayer> parseOfflinePlayer(String playerName, boolean allowStar, boolean allowPlus, LifeStealZ plugin)
    • parseOfflinePlayer

      public static List<org.bukkit.OfflinePlayer> parseOfflinePlayer(String playerName, boolean allowStar, boolean allowPlus)
    • getOfflinePlayersTabCompletion

      public static List<String> getOfflinePlayersTabCompletion(boolean allowStar, boolean allowPlus, LifeStealZ plugin)
    • throwUsageError

      public static void throwUsageError(org.bukkit.command.CommandSender sender, String usage)
    • throwPermissionError

      public static void throwPermissionError(org.bukkit.command.CommandSender sender)
    • getDisplayOptions

      public static List<String> getDisplayOptions(List<String> options, String input)
      Gets a list of options that start with the input
      Parameters:
      options - The list of options
      input - The input
      Returns:
      A list of options that start with the input
    • getDisplayOptions

      public static List<String> getDisplayOptions(Set<String> options, String input)
      Gets a list of options that start with the input
      Parameters:
      options - The list of options
      input - The input
      Returns:
      A list of options that start with the input