Package net.glowstone.io.entity
Class EntityStore<T extends GlowEntity>
java.lang.Object
net.glowstone.io.entity.EntityStore<T>
- Type Parameters:
T
- The type of entity being stored.
- Direct Known Subclasses:
AnimalStore
,ArrowStore
,BoatStore
,EnderCrystalStore
,EnderDragonStore
,FireballStore
,FireworkStore
,HangingStore
,LivingEntityStore
,MinecartStore
,MonsterStore
,SplashPotionStore
,WaterMobStore
The base for entity store classes.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionEntityStore
(Class<? extends T> type, String entityType) EntityStore
(Class<? extends T> type, org.bukkit.entity.EntityType entityType) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
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
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.toString()
-
Field Details
-
type
-
entityType
-
-
Constructor Details
-
EntityStore
-
EntityStore
-
-
Method Details
-
createEntity
Create a new entity of this store's type at the given location. The load method will be called separately.- Parameters:
location
- The location.compound
- The entity's tag, if extra data is needed.- Returns:
- The new entity.
-
createEntity
Create a new entity of this store's type at the given location, with all attributes set to their defaults.- Parameters:
location
- The location.- Returns:
- The new entity.
-
load
Load data into an existing entity of the appropriate type from the given compound tag.- Parameters:
entity
- The target entity.tag
- The entity's tag.
-
save
Save information about this entity to the given tag.- Parameters:
entity
- The entity to save.tag
- The target tag.
-
getType
-
getEntityType
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-