Class NPCTracker

java.lang.Object
com.pixelmonmod.pixelmon.api.entity.npc.NPCTracker

public class NPCTracker extends Object
This is used for storing important data about NPCs that exist in the world and were placed by an admin.
It is important to note that not **all** NPCs are stored here. Only the ones that were placed by an admin, or specifically added to the storage by a sidemod, plugin, or Pixelmon itself.
It is a proxy for the actual storage and can be changed using the setNPCStorage(EntityStorage) method.
  • Constructor Details

    • NPCTracker

      public NPCTracker()
  • Method Details

    • getNPCStorage

      public static EntityStorage<NPC> getNPCStorage()
      Gets the storage for the NPCs
      Returns:
      The storage method
    • setNPCStorage

      public static void setNPCStorage(EntityStorage<NPC> storage)
      Sets the storage for the NPCs
      Parameters:
      storage - The storage method
    • load

      public static void load()
      Loads the NPCs from the storage
    • save

      public static void save()
      Saves the NPCs to the storage
    • add

      public static void add(NPC npc)
      Adds an NPC to the storage
      Parameters:
      npc - The NPC to add
    • remove

      public static void remove(NPC npc)
      Removes an NPC from the storage
      Parameters:
      npc - The NPC to remove
    • find

      public static StoredEntity<NPC> find(UUID uuid)
      Finds the NPC storage for the given UUID
      Parameters:
      uuid - The UUID of the NPC
      Returns:
      The NPC storage
    • getAll

      public static List<StoredEntity<NPC>> getAll()
      Gets all the NPCs that are being tracked
      Returns:
      The NPCs