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 Summary
Modifier and TypeMethodDescriptionGets the executor that is used to schedule saving logicvoidonServerStopping(net.minecraftforge.event.server.ServerStoppingEvent event) Called from thePixelmonclass when the server stopping event is fired.default voidsave(PokemonStorage storage) Saves the storage using theStorageProxy.getSaveAdapter()
-
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 thePixelmonclass when the server stopping event is fired. This is mandatory as otherwise data may be lost on server shutdown- Parameters:
event- Shutdown event
-
save
Saves the storage using theStorageProxy.getSaveAdapter()- Parameters:
storage- The storage to save
-