Add LifecycleEvent.SETUP for manipulating things after normal init (#148)

* Add LifecycleEvent.SETUP for manipulating things after normal initialization

* Improve javadocs

* Fix broken english

* Update common/src/main/java/dev/architectury/event/events/common/LifecycleEvent.java

Co-authored-by: BasiqueEvangelist <basiqueevangelist@yandex.ru>
This commit is contained in:
shedaniel
2021-12-27 03:15:51 +08:00
committed by GitHub
parent 499a95f7e6
commit 09835da2de
6 changed files with 52 additions and 1 deletions

View File

@@ -48,6 +48,10 @@ public interface ClientLifecycleEvent {
* Invoked once client setup has begun.
* <p> This happens during {@code FMLClientSetupEvent} on Forge,
* or when Architectury API's client entrypoint initialises on Fabric.
* <p>
* Registries should have been initialised by this point, but there
* are no such guarantees, as you can modify the registry beyond this point
* on non-Forge environments.
*/
Event<ClientState> CLIENT_SETUP = EventFactory.createLoop();

View File

@@ -88,6 +88,16 @@ public interface LifecycleEvent {
* @see ServerLevelState#act(Level)
*/
Event<ServerLevelState> SERVER_LEVEL_SAVE = EventFactory.createLoop();
/**
* Invoked once common setup has begun.
* <p> This happens during {@code FMLCommonSetupEvent} on Forge,
* or when Architectury API's client/server entrypoint initialises on Fabric.
* <p>
* Registries should have been initialised by this point, but there
* are no such guarantees, as you can modify the registry beyond this point
* on non-Forge environments.
*/
Event<Runnable> SETUP = EventFactory.createLoop();
interface InstanceState<T> {
/**