Class OnlinePlayerArgument

  • All Implemented Interfaces:
    CommandArgument<me.lucyy.squirtgun.platform.audience.SquirtgunPlayer>

    public class OnlinePlayerArgument
    extends AbstractArgument<me.lucyy.squirtgun.platform.audience.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 Summary

      Constructors 
      Constructor Description
      OnlinePlayerArgument​(java.lang.String name, java.lang.String description, boolean isOptional, me.lucyy.squirtgun.platform.Platform platform)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      me.lucyy.squirtgun.platform.audience.SquirtgunPlayer getValue​(java.util.Queue<java.lang.String> args, CommandContext<?> ctx)
      Reads from a queue to get the value for this argument.
      @Nullable java.util.List<java.lang.String> tabComplete​(java.util.Queue<java.lang.String> args, CommandContext<?> ctx)
      Tab-completes this node.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • OnlinePlayerArgument

        public OnlinePlayerArgument​(java.lang.String name,
                                    java.lang.String description,
                                    boolean isOptional,
                                    me.lucyy.squirtgun.platform.Platform platform)
    • Method Detail

      • getValue

        public me.lucyy.squirtgun.platform.audience.SquirtgunPlayer getValue​(java.util.Queue<java.lang.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 java.util.List<java.lang.String> tabComplete​(java.util.Queue<java.lang.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