Class SafeOverrideableArgument<T,S>

java.lang.Object
dev.jorel.commandapi.AbstractArgumentTree<Argument<T>, Argument<?>, org.bukkit.command.CommandSender>
dev.jorel.commandapi.arguments.AbstractArgument<T, Argument<T>, Argument<?>, org.bukkit.command.CommandSender>
dev.jorel.commandapi.arguments.Argument<T>
dev.jorel.commandapi.arguments.SafeOverrideableArgument<T,S>
Type Parameters:
T - The type of the underlying object that this argument casts to
S - A custom type which is represented by this argument. For example, a StringArgument will have a custom type String
All Implemented Interfaces:
SafeOverrideable<T, S, Argument<T>, Argument<?>, org.bukkit.command.CommandSender>, BukkitExecutable<Argument<T>>, ChainableBuilder<Argument<T>>, PlatformExecutable<Argument<T>, org.bukkit.command.CommandSender>
Direct Known Subclasses:
AdvancementArgument, AngleArgument, AxisArgument, BiomeArgument, BiomeArgument.NamespacedKey, BooleanArgument, DoubleArgument, DoubleRangeArgument, EnchantmentArgument, EntityTypeArgument, FloatArgument, FunctionArgument, GreedyStringArgument, IntegerArgument, IntegerRangeArgument, ItemStackArgument, Location2DArgument, LocationArgument, LongArgument, LootTableArgument, MathOperationArgument, NamespacedKeyArgument, NBTCompoundArgument, ObjectiveArgument, ParticleArgument, PotionEffectArgument, PotionEffectArgument.NamespacedKey, RotationArgument, ScoreboardSlotArgument, SoundArgument, SoundArgument.NamespacedKey, TeamArgument, TimeArgument, UUIDArgument, WorldArgument

public abstract class SafeOverrideableArgument<T,S> extends Argument<T> implements SafeOverrideable<T, S, Argument<T>, Argument<?>, org.bukkit.command.CommandSender>
An interface declaring methods required to override argument suggestions
  • Field Details

  • Constructor Details

    • SafeOverrideableArgument

      protected SafeOverrideableArgument(String nodeName, Supplier<com.mojang.brigadier.arguments.ArgumentType<?>> rawType, Function<S,String> mapper)
      Instantiates this argument and assigns the mapper to the provided mapper
      Parameters:
      nodeName - the node name of this argument
      rawType - the NMS raw argument type of this argument
      mapper - the mapping function that maps this argument type to a string for suggestions
  • Method Details

    • getMapper

      public Function<S,String> getMapper()
      Specified by:
      getMapper in interface SafeOverrideable<T, S, Argument<T>, Argument<?>, org.bukkit.command.CommandSender>
    • fromKey

      public static <S> Function<S,String> fromKey(Function<S, org.bukkit.NamespacedKey> mapper)

      Composes a S to a NamespacedKey mapping function to convert S to a String

      Parameters:
      mapper - the mapping function from S to NamespacedKey
      Returns:
      a composed function that converts S to String
    • getExecutor

      public CommandAPIExecutor<org.bukkit.command.CommandSender, AbstractCommandSender<? extends org.bukkit.command.CommandSender>> getExecutor()
    • setExecutor

      public void setExecutor(CommandAPIExecutor<org.bukkit.command.CommandSender, AbstractCommandSender<? extends org.bukkit.command.CommandSender>> arg0)
    • clearExecutors

      public Argument<T> clearExecutors()