Class PixelmonStorageAsyncScheduler
java.lang.Object
com.pixelmonmod.pixelmon.api.pokedex.storage.save.impl.PixelmonStorageAsyncScheduler
- All Implemented Interfaces:
PokeDexStorageSaveScheduler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ScheduledExecutorServiceprotected final Deque<PokedexStorage> protected final AtomicBoolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidflush()Gets the executor that is used to schedule saving logicvoidonServerStopping(net.neoforged.neoforge.event.server.ServerStoppingEvent event) Called from thePixelmonclass when the server stopping event is fired.voidvoidsave(PokedexStorage storage) Saves the storage using theStorageProxy.getSaveAdapter()
-
Field Details
-
executor
-
saveList
-
saving
-
-
Constructor Details
-
PixelmonStorageAsyncScheduler
public PixelmonStorageAsyncScheduler()
-
-
Method Details
-
save
Description copied from interface:PokeDexStorageSaveSchedulerSaves the storage using theStorageProxy.getSaveAdapter()- Specified by:
savein interfacePokeDexStorageSaveScheduler- Parameters:
storage- The storage to save
-
getScheduler
Description copied from interface:PokeDexStorageSaveSchedulerGets the executor that is used to schedule saving logic- Specified by:
getSchedulerin interfacePokeDexStorageSaveScheduler- Returns:
- The executor
-
onServerStopping
public void onServerStopping(net.neoforged.neoforge.event.server.ServerStoppingEvent event) Description copied from interface:PokeDexStorageSaveSchedulerCalled from thePixelmonclass when the server stopping event is fired. This is mandatory as otherwise data may be lost on server shutdown- Specified by:
onServerStoppingin interfacePokeDexStorageSaveScheduler- Parameters:
event- Shutdown event
-
queueChangedStorages
public void queueChangedStorages() -
flush
public void flush()
-