File tree Expand file tree Collapse file tree
src/main/java/turniplabs/halplibe/event Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414
1515@ Environment (EnvType .CLIENT )
1616public final class ClientEvents {
17- public static SingleEvent <Runnable > BEFORE_CLIENT_START = new SingleEvent <>("BeforeClientStart" );
18- public static SingleEvent <Runnable > AFTER_CLIENT_START = new SingleEvent <>("AfterClientStart" );
17+ public static final SingleEvent <Runnable > BEFORE_CLIENT_START = new SingleEvent <>("BeforeClientStart" );
18+ public static final SingleEvent <Runnable > AFTER_CLIENT_START = new SingleEvent <>("AfterClientStart" );
1919
20- public static BaseEvent <Consumer <BlockModelDispatcher >> BLOCK_MODEL_RELOAD = new BaseEvent <>();
21- public static BaseEvent <Consumer <ItemModelDispatcher >> ITEM_MODEL_RELOAD = new BaseEvent <>();
22- public static BaseEvent <Consumer <EntityRendererDispatcher >> ENTITY_RENDERER_RELOAD = new BaseEvent <>();
23- public static BaseEvent <Consumer <TileEntityRenderDispatcher >> TILE_ENTITY_RENDERER_RELOAD = new BaseEvent <>();
24- public static BaseEvent <Consumer <BlockColorDispatcher >> BLOCK_COLOR_RELOAD = new BaseEvent <>();
20+ public static final BaseEvent <Consumer <BlockModelDispatcher >> BLOCK_MODEL_RELOAD = new BaseEvent <>();
21+ public static final BaseEvent <Consumer <ItemModelDispatcher >> ITEM_MODEL_RELOAD = new BaseEvent <>();
22+ public static final BaseEvent <Consumer <EntityRendererDispatcher >> ENTITY_RENDERER_RELOAD = new BaseEvent <>();
23+ public static final BaseEvent <Consumer <TileEntityRenderDispatcher >> TILE_ENTITY_RENDERER_RELOAD = new BaseEvent <>();
24+ public static final BaseEvent <Consumer <BlockColorDispatcher >> BLOCK_COLOR_RELOAD = new BaseEvent <>();
2525
2626 private ClientEvents () {}
2727}
Original file line number Diff line number Diff line change 33import turniplabs .halplibe .event .impl .SingleEvent ;
44
55public final class CommonEvents {
6- public static SingleEvent <Runnable > BEFORE_GAME_START = new SingleEvent <>("BeforeGameStart" );
7- public static SingleEvent <Runnable > AFTER_GAME_START = new SingleEvent <>("AfterGameStart" );
6+ public static final SingleEvent <Runnable > BEFORE_GAME_START = new SingleEvent <>("BeforeGameStart" );
7+ public static final SingleEvent <Runnable > AFTER_GAME_START = new SingleEvent <>("AfterGameStart" );
88
9- public static SingleEvent <Runnable > AFTER_BLOCK_INIT = new SingleEvent <>("AfterBlockInit" );
10- public static SingleEvent <Runnable > AFTER_ITEM_INIT = new SingleEvent <>("AfterItemInit" );
9+ public static final SingleEvent <Runnable > AFTER_BLOCK_INIT = new SingleEvent <>("AfterBlockInit" );
10+ public static final SingleEvent <Runnable > AFTER_ITEM_INIT = new SingleEvent <>("AfterItemInit" );
1111
12- public static SingleEvent <Runnable > RECIPES_NAMESPACE_INIT = new SingleEvent <>("RecipesNamespaceInit" );
13- public static SingleEvent <Runnable > RECIPES_READY = new SingleEvent <>("RecipesReady" );
12+ public static final SingleEvent <Runnable > RECIPES_NAMESPACE_INIT = new SingleEvent <>("RecipesNamespaceInit" );
13+ public static final SingleEvent <Runnable > RECIPES_READY = new SingleEvent <>("RecipesReady" );
1414
1515 private CommonEvents () {}
1616}
Original file line number Diff line number Diff line change 66
77@ Environment (EnvType .SERVER )
88public final class ServerEvents {
9- public static SingleEvent <Runnable > BEFORE_SERVER_START = new SingleEvent <>("BeforeServerStart" );
10- public static SingleEvent <Runnable > AFTER_SERVER_START = new SingleEvent <>("AfterServerStart" );
9+ public static final SingleEvent <Runnable > BEFORE_SERVER_START = new SingleEvent <>("BeforeServerStart" );
10+ public static final SingleEvent <Runnable > AFTER_SERVER_START = new SingleEvent <>("AfterServerStart" );
1111
1212 private ServerEvents () {}
1313}
Original file line number Diff line number Diff line change 1010
1111@ SuppressWarnings ("unused" )
1212public class CustomEvent <L , E > implements IndirectEmitter <E >, Event <L > {
13- protected final @ NonNull Function < List < L >, E > emitter ;
13+ protected final @ NonNull E emitter ;
1414 protected final @ NonNull List <L > listeners ;
1515
1616 public CustomEvent (@ NonNull final Function <List <L >, E > emitter ) {
17- this .emitter = emitter ;
1817 this .listeners = new ArrayList <>();
18+ this .emitter = emitter .apply (this .listeners );
1919 }
2020
2121 @ Override
2222 public @ NonNull E getEmitter () {
23- return emitter . apply ( listeners ) ;
23+ return emitter ;
2424 }
2525
2626 @ Override
You can’t perform that action at this time.
0 commit comments