Class EntityManager

java.lang.Object
net.glowstone.entity.EntityManager
All Implemented Interfaces:
Iterable<GlowEntity>

public class EntityManager extends Object implements Iterable<GlowEntity>
A class which manages all of the entities within a world.
  • Constructor Details

    • EntityManager

      public EntityManager()
  • Method Details

    • getAll

      public <T extends GlowEntity> Collection<T> getAll(Class<T> type)
      Returns all entities with the specified type.
      Type Parameters:
      T - The type of entity.
      Parameters:
      type - The Class for the type.
      Returns:
      A collection of entities with the specified type.
    • getAll

      public Collection<GlowEntity> getAll()
      Gets all entities.
      Returns:
      A collection of entities.
    • getEntity

      public GlowEntity getEntity(int id)
      Gets an entity by its id.
      Parameters:
      id - The id.
      Returns:
      The entity, or null if it could not be found.
    • iterator

      public Iterator<GlowEntity> iterator()
      Specified by:
      iterator in interface Iterable<GlowEntity>
    • getEntitiesInside

      public 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.
      Parameters:
      searchBox - the bounding box to search inside
      except - the entity to exclude, or null to include all
      Returns:
      the entities contained in or touching searchBox, other than except