Class Selector<T>

java.lang.Object
xyz.srnyx.annoyingapi.command.selector.Selector<T>
Type Parameters:
T - the type of object the selector expands to
Direct Known Subclasses:
AllPlayersSelector, EntitiesSelector, NearestEntitySelector, NearestPlayerSelector, OfflineSelector, OnlineSelector, RandomEntitySelector, RandomPlayerSelector, SelfSelector

public abstract class Selector<T> extends Object
Interface for target selectors for commands
  • Constructor Details

    • Selector

      public Selector()
  • Method Details

    • getType

      @NotNull public abstract @NotNull Class<T> getType()
      Gets the type of object the selector expands to
      Returns:
      the type of object the selector expands to
    • getAllowedSenders

      @Nullable public @Nullable Set<Class<? extends org.bukkit.command.CommandSender>> getAllowedSenders()
      Gets the allowed senders for the selector
      Returns:
      the allowed senders for the selector, or null if all senders are allowed
    • expandImplementation

      @Nullable protected abstract @Nullable List<T> expandImplementation(@NotNull @NotNull AnnoyingSender sender)
    • expand

      @Nullable public @Nullable List<T> expand(@NotNull @NotNull AnnoyingSender sender)
      Expands the selector to a list of objects
      Parameters:
      sender - the AnnoyingSender who executed the command
      Returns:
      the list of objects the selector expands to, or null if invalid sender