Package net.glowstone.entity
Class EntityManager
java.lang.Object
net.glowstone.entity.EntityManager
- All Implemented Interfaces:
Iterable<GlowEntity>
A class which manages all of the entities within a world.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetAll()
Gets all entities.<T extends GlowEntity>
Collection<T>Returns all entities with the specified type.List<org.bukkit.entity.Entity>
getEntitiesInside
(BoundingBox searchBox, GlowEntity except) Returns all entities that are inside or partly inside the given bounding box, with optionally one exception.getEntity
(int id) Gets an entity by its id.iterator()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
EntityManager
public EntityManager()
-
-
Method Details
-
getAll
Returns all entities with the specified type.- Type Parameters:
T
- The type of entity.- Parameters:
type
- TheClass
for the type.- Returns:
- A collection of entities with the specified type.
-
getAll
Gets all entities.- Returns:
- A collection of entities.
-
getEntity
Gets an entity by its id.- Parameters:
id
- The id.- Returns:
- The entity, or
null
if it could not be found.
-
iterator
- Specified by:
iterator
in interfaceIterable<GlowEntity>
-
getEntitiesInside
Returns all entities that are inside or partly inside the given bounding box, with optionally one exception.- Parameters:
searchBox
- the bounding box to search insideexcept
- the entity to exclude, or null to include all- Returns:
- the entities contained in or touching
searchBox
, other thanexcept
-