Class CommandUtils

java.lang.Object
com.gamersafer.minecraft.auth.common.commands.CommandUtils

public class CommandUtils extends Object
  • Field Details

  • Constructor Details

    • CommandUtils

      public CommandUtils()
  • Method Details

    • lookupUserFromPlayerName

      public static GSAuthApi.LookupResult lookupUserFromPlayerName(IPlayerStorage playerStorage, ISender sender, String name)
      Finds the player uuid, last known IP address (always null if SharedConfiguration.isIpBasedPunishments() is false) and GamerSafer for a given player name. Also adjusts capitalization of the player name.
      Parameters:
      playerStorage - the PlayersDB containing the relevant data to do the lookup
      sender - the ISender to send error messages to
      name - the player name as input for the lookup
      Returns:
      a GSAuthApi.LookupResult with the resolved data, GSAuthApi.LookupResult.success() will be true if all lookup succeeded, otherwise false
    • lookupSender

      public static GSAuthApi.LookupResult lookupSender(IPlayerStorage playerStorage, ISender sender)
    • parseDur

      public static Long parseDur(ISender sender, String s)
      Parses a duration input of the format 1d1h, 1d, or 1h.
      Parameters:
      sender - the sender to send error messages to
      s - the input string
      Returns:
      the parsed duration in milliseconds or null if parsing failed