Enum Class MinecraftArgumentType

java.lang.Object
java.lang.Enum<MinecraftArgumentType>
studio.mevera.imperat.brigadier.MinecraftArgumentType
All Implemented Interfaces:
Serializable, Comparable<MinecraftArgumentType>, Constable

public enum MinecraftArgumentType extends Enum<MinecraftArgumentType>
  • Enum Constant Details

  • Method Details

    • values

      public static MinecraftArgumentType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MinecraftArgumentType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • ensureSetup

      public static void ensureSetup()
    • getConsumedArgs

      public int getConsumedArgs()
      Returns the number of raw input arguments this argument type consumes.
    • getParsedType

      @Nullable public <T> @Nullable Class<T> getParsedType()
      Returns the Class representing the type that this argument parses into. For example, BLOCK_POS returns BlockPos.class, ENTITY returns EntitySelector.class, etc.
      Type Parameters:
      T - The expected type
      Returns:
      The Class object, or null if not resolvable in current version
    • isSupported

      public boolean isSupported()
      Checks if this argument valueType is supported in this Minecraft version
    • requiresParameters

      public boolean requiresParameters()
      Checks if this argument valueType requires parameters
    • get

      @NotNull public <T> @NotNull com.mojang.brigadier.arguments.ArgumentType<T> get()
    • create

      @NotNull public <T> @NotNull com.mojang.brigadier.arguments.ArgumentType<T> create(Object... arguments)
    • getIfPresent

      @NotNull public <T> @NotNull Optional<com.mojang.brigadier.arguments.ArgumentType<T>> getIfPresent()
    • createIfPresent

      @NotNull public <T> @NotNull Optional<com.mojang.brigadier.arguments.ArgumentType<T>> createIfPresent(Object... arguments)