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 interface
EntityVolume.EntityVolumeFactory
static interface
EntityVolume.Immutable
static interface
EntityVolume.Modifiable<M extends EntityVolume.Modifiable<M>>
static interface
EntityVolume.Mutable
static interface
EntityVolume.Streamable<E extends EntityVolume.Streamable<E>>
static interface
EntityVolume.Unmodifiable<U extends EntityVolume.Unmodifiable<U>>
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.Collection<? extends Entity>
entities()
Gets all the loaded entities in this entity volume, in no particular order.default <T extends Entity>
java.util.Collection<? extends T>entities(java.lang.Class<? extends T> entityClass, AABB box)
<T extends Entity>
java.util.Collection<? extends T>entities(java.lang.Class<? extends T> entityClass, AABB box, @Nullable java.util.function.Predicate<? super T> predicate)
default java.util.Collection<? extends Entity>
entities(AABB box)
Gets all the entities that intersect the bounding box, in no particular order.java.util.Collection<? extends Entity>
entities(AABB box, java.util.function.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.java.util.Optional<Entity>
entity(java.util.UUID uuid)
Gets the entity whoseUUID
matches the provided id, possibly returning no entity if the entity is not loaded or non-existent.default java.util.Collection<? extends Entity>
nearbyEntities(Vector3d location, double distance)
Return a collection of entities contained withindistance
blocks of the specified location.default java.util.Optional<? extends Player>
nearestPlayer(double x, double y, double z, double distance, @Nullable java.util.function.Predicate<? super Entity> predicate)
java.util.Collection<? extends Player>
players()
Gets aList
of availableplayers
within this volume.
-
-
-
Method Detail
-
players
java.util.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
java.util.Optional<Entity> entity(java.util.UUID uuid)
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
java.util.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 java.util.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> java.util.Collection<? extends T> entities(java.lang.Class<? extends T> entityClass, AABB box, @Nullable java.util.function.Predicate<? super T> predicate)
-
entities
java.util.Collection<? extends Entity> entities(AABB box, java.util.function.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> java.util.Collection<? extends T> entities(java.lang.Class<? extends T> entityClass, AABB box)
-
nearestPlayer
default java.util.Optional<? extends Player> nearestPlayer(double x, double y, double z, double distance, @Nullable java.util.function.Predicate<? super Entity> predicate)
-
nearbyEntities
default java.util.Collection<? extends Entity> nearbyEntities(Vector3d location, double distance)
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
-
-