Class GameModeUtils

java.lang.Object
net.glowstone.command.GameModeUtils

public class GameModeUtils extends Object
Utility class to create 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 convert
      locale - The input locale
      Returns:
      The matching mode if any, null otherwise.
    • prettyPrint

      public static String prettyPrint(org.bukkit.GameMode gameMode, @Nullable @Nullable Locale locale)
      Pretty print the given GameMode.
      Parameters:
      gameMode - The mode to print
      locale - 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 input
      locale - The input locale
      Returns:
      A list of autocomplete suggestions