Class IntegerArgumentNode


public class IntegerArgumentNode extends ArgumentNode
An example of custom ArgumentNodes. Represents a number argument that can have numbers at the bounds of Integer. You can also put a minimum and maximum value.
  • Constructor Details

    • IntegerArgumentNode

      public IntegerArgumentNode(int min, int max, CommandNode... children)
      Creates a new node for use.
      Parameters:
      min - Minimum number for this argument.
      max - Maximum number for this argument.
      children - Any child to add to this node if you would like to. You can still add children using CommandNode.addChild(CommandNode) later.
    • IntegerArgumentNode

      public IntegerArgumentNode(CommandNode... children)
      Creates a new node for use.
      Parameters:
      children - Any child to add to this node if you would like to. You can still add children using CommandNode.addChild(CommandNode) later.
  • Method Details

    • isCorrect

      public boolean isCorrect(String given)
      Checks for a given argument and ensures that the argument is correct.
      Specified by:
      isCorrect in class ArgumentNode
      Parameters:
      given - Argument that was given for this node.
      Returns:
      Whether the argument is correct or not.
    • suggest

      public List<String> suggest(org.bukkit.command.CommandSender sender, List<String> args)
      Provides a list that can be added to the final list of tab completion.
      Specified by:
      suggest in class CommandNode
      Parameters:
      sender - Sender that needs a tab completion. Probably a Player since console doesn't need a tab completion.
      args - List of the other arguments given by the sender.
      Returns:
      A list for tab completion.