Class MapBasedEntityStorage<T extends net.minecraft.world.entity.Entity>

java.lang.Object
com.pixelmonmod.pixelmon.api.entity.npc.storage.MapBasedEntityStorage<T>
All Implemented Interfaces:
EntityStorage<T>, Iterable<StoredEntity<T>>
Direct Known Subclasses:
NBTEntityStorage

public abstract class MapBasedEntityStorage<T extends net.minecraft.world.entity.Entity> extends Object implements EntityStorage<T>
  • Field Details

    • trackedEntities

      protected final Map<UUID,StoredEntity<T extends net.minecraft.world.entity.Entity>> trackedEntities
  • Constructor Details

    • MapBasedEntityStorage

      public MapBasedEntityStorage()
  • Method Details

    • add

      public void add(T entity)
      Description copied from interface: EntityStorage
      Adds an entity to be tracked and stored
      Specified by:
      add in interface EntityStorage<T extends net.minecraft.world.entity.Entity>
      Parameters:
      entity - The entity to add
    • remove

      public void remove(T entity)
      Description copied from interface: EntityStorage
      Removes an entity from being tracked and stored
      Specified by:
      remove in interface EntityStorage<T extends net.minecraft.world.entity.Entity>
      Parameters:
      entity - The entity to remove
    • find

      public StoredEntity<T> find(UUID uuid)
      Description copied from interface: EntityStorage
      Finds the entity storage for the given UUID
      Specified by:
      find in interface EntityStorage<T extends net.minecraft.world.entity.Entity>
      Parameters:
      uuid - The UUID of the entity
      Returns:
      The entity storage
    • getAll

      public List<StoredEntity<T>> getAll()
      Description copied from interface: EntityStorage
      Gets all the entities that are being tracked
      Specified by:
      getAll in interface EntityStorage<T extends net.minecraft.world.entity.Entity>
      Returns:
      The entities
    • iterator

      @NotNull public @NotNull Iterator<StoredEntity<T>> iterator()
      Specified by:
      iterator in interface Iterable<T extends net.minecraft.world.entity.Entity>