Class PredicateField<V>
java.lang.Object
studio.mevera.imperat.selector.field.AbstractField<V>
studio.mevera.imperat.selector.field.filters.PredicateField<V>
- Type Parameters:
V- The type of the value that the filter field handles.
- All Implemented Interfaces:
SelectionField<V>
The PredicateField interface extends the SelectionField interface to add filtering
functionality based on a specific value. Implementing this interface allows
defining a condition that can be used to filter entities.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Set<SelectionField<?>>static final Set<PredicateField<?>>static final PredicateField<Range<Double>>static final PredicateField<org.bukkit.GameMode>static final PredicateField<Range<Integer>>static final PredicateField<String>static final PredicateField<String>static final PredicateField<org.bukkit.entity.EntityType>Fields inherited from class studio.mevera.imperat.selector.field.AbstractField
name, suggestions, typeFields inherited from interface studio.mevera.imperat.selector.field.SelectionField
SEPARATOR, VALUE_EQUALS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPredicateField(String name, studio.mevera.imperat.util.TypeWrap<V> type) Constructs an AbstractField instance with the specified name and type. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract @NotNull EntityConditiongetCondition(V value, studio.mevera.imperat.context.internal.Cursor<BukkitCommandSource> cursor, studio.mevera.imperat.context.CommandContext<BukkitCommandSource> context) Generates anEntityConditionbased on the given value and command input stream.final booleanisApplicable(BukkitCommandSource sender, org.bukkit.entity.Entity entity, V value, studio.mevera.imperat.context.internal.Cursor<BukkitCommandSource> cursor, studio.mevera.imperat.context.CommandContext<BukkitCommandSource> ctx) Methods inherited from class studio.mevera.imperat.selector.field.AbstractField
getName, getSuggestions, getValueTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface studio.mevera.imperat.selector.field.SelectionField
parseFieldValue
-
Field Details
-
NAME
-
TYPE
-
LEVEL
-
DISTANCE
-
GAMEMODE
-
TAG
-
ALL_PREDICATES
-
ALL
-
-
Constructor Details
-
PredicateField
Constructs an AbstractField instance with the specified name and type.- Parameters:
name- The name of the selection field.type- The type information of the value that this field handles, wrapped in a TypeWrap object.
-
-
Method Details
-
getCondition
@NotNull protected abstract @NotNull EntityCondition getCondition(V value, studio.mevera.imperat.context.internal.Cursor<BukkitCommandSource> cursor, studio.mevera.imperat.context.CommandContext<BukkitCommandSource> context) Generates anEntityConditionbased on the given value and command input stream. This method is intended to be implemented by subclasses to provide specific filtering conditions for entities.- Parameters:
value- The value used to generate the condition.cursor- The stream providing command input data.context- the context.- Returns:
- The condition that will be used to filter entities based on the value and input data.
-
isApplicable
public final boolean isApplicable(BukkitCommandSource sender, org.bukkit.entity.Entity entity, V value, studio.mevera.imperat.context.internal.Cursor<BukkitCommandSource> cursor, studio.mevera.imperat.context.CommandContext<BukkitCommandSource> ctx) throws studio.mevera.imperat.exception.CommandException - Throws:
studio.mevera.imperat.exception.CommandException
-