public interface EntityTracker
Modifier and Type | Method and Description |
---|---|
void |
addEntity(int id,
EntityType type)
Tracks an entity.
|
int |
biomesSent() |
void |
clearEntities()
Clears stored entity types and data.
|
int |
clientEntityId()
Returns the client entity id or -1 if unset.
|
int |
currentMinY()
Returns the minimum y of the current player world.
|
@Nullable java.lang.String |
currentWorld()
Returns the name of the world the player is currently in.
|
int |
currentWorldSectionHeight()
Returns the current world section height (block height / 16).
|
@Nullable DimensionData |
dimensionData(java.lang.String dimension) |
@Nullable TrackedEntity |
entity(int entityId)
Returns the tracked entity for the given entity id if present.
|
@Nullable StoredEntityData |
entityData(int id)
Returns the stored entity data if an entity with the id is tracked, else null.
|
@Nullable StoredEntityData |
entityDataIfPresent(int id)
Returns stored entity data if it has previously been initialized by
entityData(int) , else null. |
@Nullable EntityType |
entityType(int id)
Entity type of the entity if tracked.
|
boolean |
hasEntity(int id)
Returns whether the entity is currently tracked.
|
EntityType |
playerType() |
void |
removeEntity(int id)
Untracks an entity.
|
void |
setBiomesSent(int biomesSent) |
void |
setClientEntityId(int clientEntityId)
Sets the client entity id.
|
void |
setCurrentMinY(int currentMinY)
Sets the minimum y of the current player world.
|
void |
setCurrentWorld(java.lang.String currentWorld)
Sets the name of the world the player is currently in.
|
void |
setCurrentWorldSectionHeight(int currentWorldSectionHeight)
Sets the current world section height.
|
void |
setDimensions(java.util.Map<java.lang.String,DimensionData> dimensions) |
boolean |
trackClientEntity()
Adds the client player entity to the tracker.
|
UserConnection |
user()
User connection the tracker belongs to.
|
UserConnection user()
void addEntity(int id, EntityType type)
id
- entity idtype
- entity typeboolean hasEntity(int id)
id
- entity id@Nullable TrackedEntity entity(int entityId)
entityId
- entity id@Nullable EntityType entityType(int id)
id
- entity idvoid removeEntity(int id)
id
- entity idvoid clearEntities()
@Nullable StoredEntityData entityData(int id)
id
- entity idjava.lang.IllegalArgumentException
- if entitiy data storage has not been enabled via the implementation@Nullable StoredEntityData entityDataIfPresent(int id)
entityData(int)
, else null.id
- entity identityData(int)
java.lang.IllegalArgumentException
- if entitiy data storage has not been enabled via the implementationint clientEntityId()
void setClientEntityId(int clientEntityId)
clientEntityId
- client entity idint currentWorldSectionHeight()
void setCurrentWorldSectionHeight(int currentWorldSectionHeight)
currentWorldSectionHeight
- world section heightint currentMinY()
void setCurrentMinY(int currentMinY)
currentMinY
- minimum y of the current world@Nullable java.lang.String currentWorld()
void setCurrentWorld(java.lang.String currentWorld)
currentWorld
- name of the current worldint biomesSent()
void setBiomesSent(int biomesSent)
EntityType playerType()
@Nullable DimensionData dimensionData(java.lang.String dimension)
void setDimensions(java.util.Map<java.lang.String,DimensionData> dimensions)
boolean trackClientEntity()