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>
Signed-off-by: Max <maxh2709@gmail.com>
This commit is contained in:
shedaniel
2021-12-26 20:15:51 +01:00
committed by Max
parent 997af6b81a
commit eea1b5182c
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> {
/**