Class PixelmonStorageAsyncScheduler
java.lang.Object
com.pixelmonmod.pixelmon.api.storage.research.save.impl.PixelmonStorageAsyncScheduler
- All Implemented Interfaces:
ResearchStorageSaveScheduler
-
Field Summary
Modifier and TypeFieldDescriptionprotected final ScheduledExecutorService
protected final Deque<ResearchStorage>
protected final AtomicBoolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
flush()
Gets 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.void
void
save
(ResearchStorage storage) Saves the storage using theStorageProxy.getSaveAdapter()
-
Field Details
-
executor
-
saveList
-
saving
-
-
Constructor Details
-
PixelmonStorageAsyncScheduler
public PixelmonStorageAsyncScheduler()
-
-
Method Details
-
save
Description copied from interface:ResearchStorageSaveScheduler
Saves the storage using theStorageProxy.getSaveAdapter()
- Specified by:
save
in interfaceResearchStorageSaveScheduler
- Parameters:
storage
- The storage to save
-
getScheduler
Description copied from interface:ResearchStorageSaveScheduler
Gets the executor that is used to schedule saving logic- Specified by:
getScheduler
in interfaceResearchStorageSaveScheduler
- Returns:
- The executor
-
onServerStopping
public void onServerStopping(net.minecraftforge.event.server.ServerStoppingEvent event) Description copied from interface:ResearchStorageSaveScheduler
Called from thePixelmon
class when the server stopping event is fired. This is mandatory as otherwise data may be lost on server shutdown- Specified by:
onServerStopping
in interfaceResearchStorageSaveScheduler
- Parameters:
event
- Shutdown event
-
queueChangedStorages
public void queueChangedStorages() -
flush
public void flush()
-