File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed
src/main/java/com/example/mod Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 11plugins {
22 java
3+ id(" com.github.weave-mc.weave" ) version " 3ad11a0fd5"
34}
45
56group = " com.example"
@@ -22,4 +23,9 @@ tasks.jar {
2223 manifest.attributes(
2324 " Weave-Entry" to " com.example.mod.ExampleMod"
2425 )
26+ }
27+
28+ minecraft {
29+ version = " 1.8.9"
30+ mappings = " stable_22"
2531}
Original file line number Diff line number Diff line change 11rootProject.name = " ExampleMod"
22
3+ pluginManagement {
4+ repositories {
5+ gradlePluginPortal()
6+ maven(" https://jitpack.io" )
7+ }
8+ }
Original file line number Diff line number Diff line change 77import club .maxstats .weave .loader .api .event .SubscribeEvent ;
88import club .maxstats .weave .loader .util .ExtensionsKt ;
99import kotlin .Unit ;
10+ import net .minecraft .client .Minecraft ;
11+ import net .minecraft .util .ChatComponentText ;
1012import org .jetbrains .annotations .NotNull ;
13+ import org .lwjgl .input .Keyboard ;
1114import org .objectweb .asm .Opcodes ;
1215import org .objectweb .asm .Type ;
1316import org .objectweb .asm .tree .MethodInsnNode ;
@@ -30,7 +33,9 @@ public void preinit(@NotNull HookManager hookManager) {
3033 });
3134
3235 EventBus .INSTANCE .subscribe (InputEvent .class , e -> {
33- System .out .println ("Pressed: " + e .getKeyCode ());
36+ Minecraft .getMinecraft ().thePlayer .addChatMessage (
37+ new ChatComponentText ("Pressed: " + Keyboard .getKeyName (e .getKeyCode ()))
38+ );
3439 });
3540 }
3641 public static void onStart () {
You can’t perform that action at this time.
0 commit comments