Interface EntityVolume
- All Superinterfaces:
Volume
- All Known Subinterfaces:
ClientWorld
,EntityChunk
,EntityVolume.Immutable
,EntityVolume.Modifiable<M>
,EntityVolume.Mutable
,EntityVolume.Streamable<E>
,EntityVolume.Unmodifiable<U>
,GenerationRegion
,ServerWorld
,World<W,
,L> WorldChunk
,WorldLike<P>
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
static interface
static interface
EntityVolume.Modifiable<M extends EntityVolume.Modifiable<M>>
static interface
static interface
EntityVolume.Streamable<E extends EntityVolume.Streamable<E>>
static interface
EntityVolume.Unmodifiable<U extends EntityVolume.Unmodifiable<U>>
-
Method Summary
Modifier and TypeMethodDescriptionCollection
<? extends Entity> entities()
Gets all the loaded entities in this entity volume, in no particular order.default <T extends Entity>
Collection<? extends T> <T extends Entity>
Collection<? extends T> default Collection
<? extends Entity> Gets all the entities that intersect the bounding box, in no particular order.Collection
<? extends Entity> Gets all the entities that intersect the bounding box, in no particular order, as long as the pass the given filter test.Gets the entity whoseUUID
matches 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 withindistance
blocks of the specified location.nearestPlayer
(double x, double y, double z, double distance, @Nullable Predicate<? super Entity> predicate) Collection
<? extends Player> players()
-
Method Details
-
players
Collection<? extends Player> players()Gets aList
of availableplayers
within this volume. The provided list may be a copy or an unmodifiable collection.- Returns:
- An unmodifiable or copied collection of available players
-
entity
Gets the entity whoseUUID
matches 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
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
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
-
nearbyEntities
Return a collection of entities contained withindistance
blocks 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
-