Interface ResearchStorageSaveScheduler
- All Known Implementing Classes:
PixelmonStorageAsyncScheduler
public interface ResearchStorageSaveScheduler
Interface responsible for scheduling storage saving using the appropriate
ResearchStorageSaveAdapter
.
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:
- August 6, 2024 (Pixelmon 9.2.9)
-
Method Summary
Modifier and TypeMethodDescriptionGets the executor that is used to schedule saving logicvoid
onServerStopping
(net.minecraftforge.event.server.ServerStoppingEvent event) Called from thePixelmon
class when the server stopping event is fired.default void
save
(ResearchStorage 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 thePixelmon
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
Saves the storage using theStorageProxy.getSaveAdapter()
- Parameters:
storage
- The storage to save
-