public final class EntityStorage extends Object
Modifier and Type | Method and Description |
---|---|
static <T extends GlowEntity> |
bind(EntityStore<T> store)
Binds a store by adding entries for it to the tables.
|
static <T extends GlowEntity> |
create(Class<T> clazz,
org.bukkit.Location location)
Creates an entity of the given Glowstone class, by deserializing an empty tag.
|
static void |
load(GlowEntity entity,
CompoundTag compound)
Load an entity's data from the given compound tag.
|
static GlowEntity |
loadEntity(GlowWorld world,
CompoundTag compound)
Load a new entity in the given world from the given data tag.
|
static void |
save(GlowEntity entity,
CompoundTag compound)
Save an entity's data to the given compound tag.
|
public static <T extends GlowEntity> T create(Class<T> clazz, org.bukkit.Location location)
T
- the type of entityclazz
- the type of entitylocation
- the entity's initial locationpublic static <T extends GlowEntity> void bind(EntityStore<T> store)
T
- The type of entity.store
- The store object.public static GlowEntity loadEntity(GlowWorld world, CompoundTag compound)
world
- The target world.compound
- The tag to load from.IllegalArgumentException
- if there is an error in the data.public static void save(GlowEntity entity, CompoundTag compound)
entity
- The entity to save.compound
- The target tag.public static void load(GlowEntity entity, CompoundTag compound)
entity
- The target entity.compound
- The tag to load from.Copyright © 2021. All rights reserved.