Interface EntityVolume
-
- All Superinterfaces:
Volume
- All Known Subinterfaces:
ClientWorld,EntityVolume.Immutable,EntityVolume.Modifiable<M>,EntityVolume.Mutable,EntityVolume.Streamable<E>,EntityVolume.Unmodifiable<U>,GenerationRegion,ServerWorld,World<W,L>,WorldChunk,WorldLike<P>
public interface EntityVolume extends Volume
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceEntityVolume.EntityVolumeFactorystatic interfaceEntityVolume.Immutablestatic interfaceEntityVolume.Modifiable<M extends EntityVolume.Modifiable<M>>static interfaceEntityVolume.Mutablestatic interfaceEntityVolume.Streamable<E extends EntityVolume.Streamable<E>>static interfaceEntityVolume.Unmodifiable<U extends EntityVolume.Unmodifiable<U>>
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Collection<? extends Entity>entities()Gets all the loaded entities in this entity volume, in no particular order.default <T extends Entity>
Collection<? extends T>entities(Class<? extends T> entityClass, AABB box)<T extends Entity>
Collection<? extends T>entities(Class<? extends T> entityClass, AABB box, @Nullable Predicate<? super T> predicate)default Collection<? extends Entity>entities(AABB box)Gets all the entities that intersect the bounding box, in no particular order.Collection<? extends Entity>entities(AABB box, Predicate<? super Entity> filter)Gets all the entities that intersect the bounding box, in no particular order, as long as the pass the given filter test.Optional<Entity>entity(UUID uuid)Gets the entity whoseUUIDmatches the provided id, possibly returning no entity if the entity is not loaded or non-existent.default Collection<? extends Entity>nearbyEntities(Vector3d location, double distance)Return a collection of entities contained withindistanceblocks of the specified location.default Optional<? extends Player>nearestPlayer(double x, double y, double z, double distance, @Nullable Predicate<? super Entity> predicate)Collection<? extends Player>players()
-
-
-
Method Detail
-
players
Collection<? extends Player> players()
Gets aListof availableplayerswithin this volume. The provided list may be a copy or an unmodifiable collection.- Returns:
- An unmodifiable or copied collection of available players
-
entity
Optional<Entity> entity(UUID uuid)
Gets the entity whoseUUIDmatches the provided id, possibly returning no entity if the entity is not loaded or non-existent.For world implementations, only some parts of the world is usually loaded, so this method may return no entity if the entity is not loaded.
- Parameters:
uuid- The unique id- Returns:
- An entity, if available
-
entities
Collection<? extends Entity> entities()
Gets all the loaded entities in this entity volume, in no particular order.This collection is unmodifiable.
- Returns:
- All entities in this volume.
-
entities
default Collection<? extends Entity> entities(AABB box)
Gets all the entities that intersect the bounding box, in no particular order.- Parameters:
box- The intersection box- Returns:
- All the intersecting entities
-
entities
<T extends Entity> Collection<? extends T> entities(Class<? extends T> entityClass, AABB box, @Nullable Predicate<? super T> predicate)
-
entities
Collection<? extends Entity> entities(AABB box, Predicate<? super Entity> filter)
Gets all the entities that intersect the bounding box, in no particular order, as long as the pass the given filter test.- Parameters:
box- The intersection boxfilter- The filter test- Returns:
- All the intersecting entities that pass the filter test
-
entities
default <T extends Entity> Collection<? extends T> entities(Class<? extends T> entityClass, AABB box)
-
nearestPlayer
default Optional<? extends Player> nearestPlayer(double x, double y, double z, double distance, @Nullable Predicate<? super Entity> predicate)
-
nearbyEntities
default Collection<? extends Entity> nearbyEntities(Vector3d location, double distance)
Return a collection of entities contained withindistanceblocks of the specified location. This uses a sphere to test distances.For world implementations, only some parts of the world is usually loaded, so this method will only return entities within those loaded parts.
- Parameters:
location- The location at the center of the search radiusdistance- The search radius- Returns:
- A collection of nearby entities
-
-