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

public abstract class EntityStore<T extends GlowEntity> extends Object
The base for entity store classes.
  • Field Details

    • type

      protected final Class<? extends T extends GlowEntity> type
    • entityType

      @NonNls protected final @NonNls String entityType
  • Constructor Details

    • EntityStore

      public EntityStore(Class<? extends T> type, org.bukkit.entity.EntityType entityType)
    • EntityStore

      public EntityStore(Class<? extends T> type, String entityType)
  • Method Details

    • createEntity

      public abstract T createEntity(org.bukkit.Location location, CompoundTag compound)
      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

      public 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.
      Parameters:
      location - The location.
      Returns:
      The new entity.
    • load

      public void load(T entity, CompoundTag tag)
      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

      public void save(T entity, CompoundTag tag)
      Save information about this entity to the given tag.
      Parameters:
      entity - The entity to save.
      tag - The target tag.
    • getType

      public Class<? extends T> getType()
    • getEntityType

      public String getEntityType()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object