T
- The type of entity being stored.public abstract class EntityStore<T extends GlowEntity> extends Object
Modifier and Type | Field and Description |
---|---|
protected @NonNls String |
entityType |
protected Class<? extends T> |
type |
Constructor and Description |
---|
EntityStore(Class<? extends T> type,
org.bukkit.entity.EntityType entityType) |
EntityStore(Class<? extends T> type,
String entityType) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canEqual(Object other) |
T |
createEntity(org.bukkit.Location location)
Create a new entity of this store's type at the given location, with all attributes set to
their defaults.
|
abstract T |
createEntity(org.bukkit.Location location,
CompoundTag compound)
Create a new entity of this store's type at the given location.
|
boolean |
equals(Object o) |
String |
getEntityType() |
Class<? extends T> |
getType() |
int |
hashCode() |
void |
load(T entity,
CompoundTag tag)
Load data into an existing entity of the appropriate type from the given compound tag.
|
void |
save(T entity,
CompoundTag tag)
Save information about this entity to the given tag.
|
String |
toString() |
protected final Class<? extends T extends GlowEntity> type
@NonNls protected final @NonNls String entityType
public abstract T createEntity(org.bukkit.Location location, CompoundTag compound)
location
- The location.compound
- The entity's tag, if extra data is needed.public T createEntity(org.bukkit.Location location)
location
- The location.public void load(T entity, CompoundTag tag)
entity
- The target entity.tag
- The entity's tag.public void save(T entity, CompoundTag tag)
entity
- The entity to save.tag
- The target tag.public String getEntityType()
protected boolean canEqual(Object other)
Copyright © 2021. All rights reserved.