File tree Expand file tree Collapse file tree 3 files changed +12
-28
lines changed
src/main/java/com/example/mod Expand file tree Collapse file tree 3 files changed +12
-28
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ repositories {
1313}
1414
1515dependencies {
16- compileOnly(" com.github.Weave-MC:Weave-Loader:454f9a8cca " )
16+ compileOnly(" com.github.weave-mc:weave-loader:96b318be13 " )
1717}
1818
1919tasks.compileJava {
Original file line number Diff line number Diff line change 11package com .example .mod ;
22
3- import club .maxstats .weave .loader .api .CommandBus ;
43import club .maxstats .weave .loader .api .ModInitializer ;
54import club .maxstats .weave .loader .api .HookManager ;
5+ import club .maxstats .weave .loader .api .command .CommandBus ;
66import club .maxstats .weave .loader .api .event .*;
77import com .example .mod .command .TestCommand ;
88import com .example .mod .hook .MinecraftHook ;
@@ -17,20 +17,17 @@ public void preInit(HookManager hookManager) {
1717 System .out .println ("Initializing ExampleMod!" );
1818
1919 hookManager .register (new MinecraftHook ());
20- CommandBus .INSTANCE . register (new TestCommand ());
20+ CommandBus .register (new TestCommand ());
2121
22- EventBus .INSTANCE . subscribe (KeyboardEvent .class , e -> {
22+ EventBus .subscribe (KeyboardEvent .class , e -> {
2323 if (Minecraft .getMinecraft ().currentScreen == null && e .getKeyState ()) {
2424 Minecraft .getMinecraft ().thePlayer .addChatMessage (
2525 new ChatComponentText ("Key Pressed: " + Keyboard .getKeyName (e .getKeyCode ()))
2626 );
2727 }
2828 });
29+ EventBus .subscribe (RenderHandEvent .class , e -> e .setCancelled (true ));
2930
30- EventBus .INSTANCE .subscribe (RenderHandEvent .class , e -> {
31- e .setCancelled (true );
32- });
33-
34- EventBus .INSTANCE .subscribe (new RenderGameOverlayListener ());
31+ EventBus .subscribe (new RenderGameOverlayListener ());
3532 }
3633}
Original file line number Diff line number Diff line change 11package com .example .mod .command ;
22
3- import club .maxstats .weave .loader .api .Command ;
3+ import club .maxstats .weave .loader .api .command . Command ;
44import net .minecraft .client .Minecraft ;
55import net .minecraft .util .ChatComponentText ;
6- import org .jetbrains .annotations .NotNull ;
7-
8- import java .util .Arrays ;
9- import java .util .List ;
106
117public class TestCommand extends Command {
12- @ NotNull
13- @ Override
14- public String getName () {
15- return "test" ;
16- }
17-
18- @ NotNull
19- @ Override
20- public List <String > getAliases () {
21- return Arrays .asList ("sometest" , "somealias" , "t" );
8+ public TestCommand () {
9+ super ("test" );
2210 }
2311
24- @ NotNull
2512 @ Override
26- public String getUsage () {
27- return "<arg1> <arg2> [arg3]" ;
13+ public String [] getAliases () {
14+ return new String []{ "sometest" , "somealias" , "t" } ;
2815 }
2916
3017 @ Override
31- public void handle (@ NotNull List < String > args ) {
18+ public void handle (String [] args ) {
3219 Minecraft .getMinecraft ().thePlayer .addChatMessage (new ChatComponentText ("This is a command!" ));
3320 }
3421}
You can’t perform that action at this time.
0 commit comments