Class OnlinePlayerArgument

java.lang.Object
net.lucypoulton.squirtgun.command.argument.AbstractArgument<SquirtgunPlayer>
net.lucypoulton.squirtgun.command.argument.OnlinePlayerArgument
All Implemented Interfaces:
CommandArgument<SquirtgunPlayer>

public class OnlinePlayerArgument extends AbstractArgument<SquirtgunPlayer>
An argument that gets a player. This will tabcomplete for online players, but will provide any player, regardless of if they are online or not.
  • Constructor Details

    • OnlinePlayerArgument

      public OnlinePlayerArgument(String name, String description, boolean isOptional, Platform platform)
  • Method Details

    • getValue

      public SquirtgunPlayer getValue(Queue<String> args, CommandContext ctx)
      Description copied from interface: CommandArgument
      Reads from a queue to get the value for this argument.
      Parameters:
      args - a queue of strings containing the raw arguments. Pop as many as needed and no more.
      ctx - the context that this command has been executed in. Be aware that arguments may not yet be populated.
      Returns:
      the parsed string value of this argument.
    • tabComplete

      @Nullable public @Nullable List<String> tabComplete(Queue<String> args, CommandContext ctx)
      Description copied from interface: CommandArgument
      Tab-completes this node.
      Parameters:
      args - a queue of strings containing the raw arguments. Pop as many as needed and no more.
      ctx - the context that this command has been executed in. Be aware that arguments may not yet be populated.
      Returns:
      the tabcompleted value of this node, or if not applicable, null