Package net.glowstone.command
Class GameModeUtils
java.lang.Object
net.glowstone.command.GameModeUtils
Utility class to create GameMode.
-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable org.bukkit.GameMode
Create a GameMode from a string.partialMatchingGameModes
(String arg, @Nullable Locale locale) Returns autocomplete suggestions that are game-mode names.static String
prettyPrint
(org.bukkit.GameMode gameMode, @Nullable Locale locale) Pretty print the given GameMode.
-
Method Details
-
build
@Nullable public static @Nullable org.bukkit.GameMode build(@Nullable @Nullable String mode, @Nullable @Nullable Locale locale) Create a GameMode from a string.- Parameters:
mode
- The mode to convertlocale
- The input locale- Returns:
- The matching mode if any, null otherwise.
-
prettyPrint
Pretty print the given GameMode.- Parameters:
gameMode
- The mode to printlocale
- The output locale- Returns:
- the pretty name of the mode or 'Unknown' if the mode is not known
-
partialMatchingGameModes
@NotNull public static @NotNull List<String> partialMatchingGameModes(String arg, @Nullable @Nullable Locale locale) Returns autocomplete suggestions that are game-mode names.- Parameters:
arg
- The partial inputlocale
- The input locale- Returns:
- A list of autocomplete suggestions
-