Interface ResearchStorageSaveAdapter

All Known Implementing Classes:
NBTStorageSaveAdapter

public interface ResearchStorageSaveAdapter
Interface for the persistence adapter of ResearchStorages. The only provided implementation is the NBTStorageSaveAdapter which writes into the .research files. However, custom implementations can handle this in any way as long as load(UUID) never returns null.

Both the save and load methods must work for all ResearchStorages.

This class will be registered on the Forge event bus by the Pixelmon class after the PixelmonInitEvent
Since:
August 6, 2024 (Pixelmon 9.2.9)
  • Method Details

    • save

      void save(ResearchStorage storage)
      Saves the given ResearchStorage into persistent data. The UUID and storage type can be derived from the parameter.
      Parameters:
      storage - The ResearchStorage that must be saved.
    • load

      @Nonnull ResearchStorage load(UUID uuid)
      Loads the specified type of ResearchStorage saved under the specified UUID. The returned value must not be null. If a storage for the UUID and class does not already exist, it must be created and returned.
      Parameters:
      uuid - The UUID of the storage to load. This is typically a player UUID, but it's possible that custom ResearchStorage implementations work differently