Package ke.ric.renderer.api
Class EntitySelector
java.lang.Object
ke.ric.renderer.api.EntitySelector
Immutable predicate over copied entity metadata. It never reads a live Bukkit entity and does
not capture additional entities. Use types, UUIDs and living/player categories, then combine
selectors with
and(EntitySelector), or(EntitySelector) and not().
Selectors cannot override request exclusions or viewer privacy.-
Method Summary
Modifier and TypeMethodDescriptionstatic EntitySelectorall()Matches every entity present in captured evidence.and(EntitySelector other) Requires both this selector and the supplied selector to match.static EntitySelectorids(Collection<UUID> ids) Matches any supplied UUID without retaining the caller's collection.static EntitySelectorMatches any supplied UUID; the array is defensively copied.static EntitySelectorliving()Matches metadata marked as living, including players.booleanTests copied or caller-supplied metadata without reading Bukkit state.static EntitySelectornone()Matches no entity.not()Negates this predicate within existing captured evidence.or(EntitySelector other) Accepts a match from either this selector or the supplied selector.static EntitySelectorplayers()Matches the captured namespaced type minecraft:player.static EntitySelectorMatches any supplied lowercase namespaced entity type.
-
Method Details
-
all
Matches every entity present in captured evidence.- Returns:
- an unrestricted selector
-
none
Matches no entity.- Returns:
- an empty selector
-
living
Matches metadata marked as living, including players.- Returns:
- a living-entity selector
-
players
Matches the captured namespaced type minecraft:player.- Returns:
- a player selector
-
types
Matches any supplied lowercase namespaced entity type. The values are defensively copied.- Parameters:
namespacedTypes- type keys such as minecraft:zombie; an empty array matches nothing- Returns:
- a type selector
- Throws:
IllegalArgumentException- for a null or malformed type key
-
ids
Matches any supplied UUID without retaining the caller's collection.- Parameters:
ids- entity identities; an empty collection matches nothing- Returns:
- an identity selector
- Throws:
NullPointerException- if the collection or an element is null
-
ids
Matches any supplied UUID; the array is defensively copied.- Parameters:
ids- entity identities; an empty array matches nothing- Returns:
- an identity selector
- Throws:
NullPointerException- if the array or an element is null
-
and
Requires both this selector and the supplied selector to match.- Parameters:
other- predicate to intersect- Returns:
- an immutable intersection
-
or
Accepts a match from either this selector or the supplied selector. Capture exclusions and privacy still apply outside the selector.- Parameters:
other- predicate to union- Returns:
- an immutable union
-
not
Negates this predicate within existing captured evidence.- Returns:
- an immutable complement selector
-
matches
Tests copied or caller-supplied metadata without reading Bukkit state.- Parameters:
id- entity UUIDnamespacedType- captured type key, such as minecraft:playerliving- whether the source metadata marks this entity as living- Returns:
- whether this predicate accepts the metadata
-