Class CommandUtils
java.lang.Object
org.strassburger.lifestealz.util.commands.CommandUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDisplayOptions
(List<String> options, String input) Gets a list of options that start with the inputgetDisplayOptions
(Set<String> options, String input) Gets a list of options that start with the inputgetOfflinePlayersTabCompletion
(boolean allowStar, boolean allowPlus, LifeStealZ plugin) getPlayersTabCompletion
(boolean allowStar) Gets a list of player names for tab completiongetPlayersTabCompletion
(boolean allowPlus, LifeStealZ plugin) Gets a list of player names for tab completionstatic List
<org.bukkit.OfflinePlayer> parseOfflinePlayer
(String playerName, boolean allowStar, boolean allowPlus) static List
<org.bukkit.OfflinePlayer> parseOfflinePlayer
(String playerName, boolean allowStar, boolean allowPlus, LifeStealZ plugin) static List
<org.bukkit.entity.Player> parsePlayerName
(String playerName, boolean allowPlus) Parses a player name (or a star) to a list of playersstatic List
<org.bukkit.entity.Player> parsePlayerName
(String playerName, boolean allowPlus, LifeStealZ plugin) Parses a player name (or a star) to a list of playersstatic void
throwPermissionError
(org.bukkit.command.CommandSender sender) static void
throwUsageError
(org.bukkit.command.CommandSender sender, String usage)
-
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 playerallowPlus
- If true, the plus will be allowed as a wildcard for all online playersplugin
- The plugin instance- Returns:
- A list of players (or an empty list if the player is not online)
-
parsePlayerName
Parses a player name (or a star) to a list of players- Parameters:
playerName
- The name of the playerallowPlus
- 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
Gets a list of player names for tab completion- Parameters:
allowPlus
- If true, the plus will be allowed as a wildcard for all online playersplugin
- The plugin instance- Returns:
- A list of player names
-
getPlayersTabCompletion
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
-
getOfflinePlayersTabCompletion
public static List<String> getOfflinePlayersTabCompletion(boolean allowStar, boolean allowPlus, LifeStealZ plugin) -
throwUsageError
-
throwPermissionError
public static void throwPermissionError(org.bukkit.command.CommandSender sender) -
getDisplayOptions
Gets a list of options that start with the input- Parameters:
options
- The list of optionsinput
- The input- Returns:
- A list of options that start with the input
-
getDisplayOptions
Gets a list of options that start with the input- Parameters:
options
- The list of optionsinput
- The input- Returns:
- A list of options that start with the input
-