mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2025-02-16 01:42:20 +01:00
Add POST_INIT state to LoadSaveFilesCallback
This commit is contained in:
parent
57cd295c7f
commit
307de56e67
@ -19,12 +19,17 @@
|
||||
|
||||
package de.florianmichael.viafabricplus.event;
|
||||
|
||||
import de.florianmichael.viafabricplus.save.AbstractSave;
|
||||
import de.florianmichael.viafabricplus.save.SaveManager;
|
||||
import net.fabricmc.fabric.api.event.Event;
|
||||
import net.fabricmc.fabric.api.event.EventFactory;
|
||||
|
||||
/**
|
||||
* This event is fired when ViaFabricPlus has loaded its save files, and before it starts reading the values from the save files.
|
||||
* This event is fired when loading save files:
|
||||
* <ul>
|
||||
* <li>{@link State#PRE} before loading save files</li>
|
||||
* <li>{@link State#POST} after loading save files</li>
|
||||
* <li>{@link State#POST_INIT} after loading save files and calling {@link AbstractSave#postInit()} functions</li>
|
||||
*/
|
||||
public interface LoadSaveFilesCallback {
|
||||
|
||||
@ -37,7 +42,7 @@ public interface LoadSaveFilesCallback {
|
||||
void onLoadSaveFiles(final SaveManager saveManager, final State state);
|
||||
|
||||
enum State {
|
||||
PRE, POST
|
||||
PRE, POST, POST_INIT
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -65,6 +65,7 @@ public class SaveManager {
|
||||
for (AbstractSave save : saves) {
|
||||
save.postInit();
|
||||
}
|
||||
LoadSaveFilesCallback.EVENT.invoker().onLoadSaveFiles(this, LoadSaveFilesCallback.State.POST_INIT);
|
||||
}
|
||||
|
||||
public void add(final AbstractSave... saves) {
|
||||
|
Loading…
Reference in New Issue
Block a user