Interface StorageSaveScheduler

All Known Implementing Classes:
PixelmonStorageAsyncScheduler, PixelmonStorageStandardScheduler

public interface StorageSaveScheduler
Interface responsible for scheduling storage saving using the appropriate StorageSaveAdapter. A default method is provided for doing a save for a single abstract storage using the storage manager's save adapter.

This class will be registered on the Forge event bus by the Pixelmon class after the PixelmonInitEvent

Since:
September 5, 2018 (Pixelmon 7.0.0)
  • Method Details

    • getScheduler

      Executor getScheduler()
      Gets the executor that is used to schedule saving logic
      Returns:
      The executor
    • onServerStopping

      void onServerStopping(net.minecraftforge.event.server.ServerStoppingEvent event)
      Called from the Pixelmon class when the server stopping event is fired. This is mandatory as otherwise data may be lost on server shutdown
      Parameters:
      event - Shutdown event
    • save

      default void save(PokemonStorage storage)
      Saves the storage using the StorageProxy.getSaveAdapter()
      Parameters:
      storage - The storage to save