11package com .example .mod ;
22
3+ import club .maxstats .weave .loader .api .CommandBus ;
34import club .maxstats .weave .loader .api .ModInitializer ;
45import club .maxstats .weave .loader .api .HookManager ;
56import club .maxstats .weave .loader .api .event .*;
7+ import com .example .mod .command .TestCommand ;
68import com .example .mod .listener .RenderGameOverlayListener ;
9+ import kotlin .Unit ;
710import net .minecraft .client .Minecraft ;
811import net .minecraft .util .ChatComponentText ;
912import org .lwjgl .input .Keyboard ;
@@ -43,10 +46,7 @@ public void preInit(HookManager hookManager) {
4346 }
4447 });
4548
46- EventBus .INSTANCE .subscribe (ShutdownEvent .class , e -> {
47- System .out .println ("Shutdown Event" );
48- });
49-
49+ EventBus .INSTANCE .subscribe (ShutdownEvent .class , e -> System .out .println ("Shutdown Event" ));
5050 EventBus .INSTANCE .subscribe (ChatSentEvent .class , e -> {
5151 if (e .getMessage ().equals ("Test" )) {
5252 e .setCancelled (true );
@@ -55,15 +55,12 @@ public void preInit(HookManager hookManager) {
5555 });
5656
5757 EventBus .INSTANCE .subscribe (new RenderGameOverlayListener ());
58+ EventBus .INSTANCE .subscribe (StartGameEvent .Pre .class , e -> System .out .println ("Pre StartGame" ));
59+ EventBus .INSTANCE .subscribe (StartGameEvent .Post .class , e -> System .out .println ("Post StartGame" ));
5860
59- EventBus .INSTANCE .subscribe (StartGameEvent .Pre .class , e -> {
60- System .out .println ("Pre StartGame" );
61- });
62-
63- EventBus .INSTANCE .subscribe (StartGameEvent .Post .class , e -> {
64- System .out .println ("Post StartGame" );
65- });
61+ CommandBus .INSTANCE .register (new TestCommand ());
6662 }
63+
6764 public static void onStart () {
6865 System .out .println ("Hello World from Minecraft#startGame" );
6966 }
0 commit comments