@ThreadSafe public final class EntityHandler extends Object
Modifier and Type | Method and Description |
---|---|
static EntityHandler |
create()
Constructs the EntityManager for use by the server ONLY
|
<T extends Entity> |
entities(Class<T> type)
Gets all entities with the given type class
|
Entity |
entityBy(int id)
Gets the entity with the given ID
|
void |
register(Entity entity)
Starts entity management and tracks the entity
|
void |
removeEntity(Entity entity)
Removes the entity from management
|
void |
trackMovement(Entity entity,
Position from,
Position to)
Tracks the movement of the entity, not for teleportation
|
public static EntityHandler create()
In other words, DON'T USE IT
public void register(Entity entity)
entity
- the entity to managepublic void removeEntity(Entity entity)
entity
- the entity to removepublic void trackMovement(Entity entity, Position from, Position to)
entity
- the entity to trackfrom
- the original locationto
- the new locationpublic Entity entityBy(int id)
id
- the ID to find the entity byCopyright © 2016. All rights reserved.