File tree Expand file tree Collapse file tree
java/net/immortaldevs/bindcmd/mixin Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package net .immortaldevs .bindcmd .mixin ;
22
3+ import com .mojang .blaze3d .platform .InputConstants ;
34import net .immortaldevs .bindcmd .Command ;
45import net .immortaldevs .bindcmd .config .Config ;
56import net .minecraft .client .KeyMapping ;
@@ -20,16 +21,16 @@ public abstract class KeyMappingMixin {
2021 @ Unique
2122 private static final long COOLDOWN = 200L ;
2223
23- @ Inject (method = "onKeyPressed " , at = @ At ("HEAD" ))
24- private static void onKeyPressed ( InputUtil .Key key , CallbackInfo ci ) {
24+ @ Inject (method = "click " , at = @ At ("HEAD" ))
25+ private static void click ( InputConstants .Key key , CallbackInfo ci ) {
2526 if (System .currentTimeMillis () - lastKeyPress < COOLDOWN ) return ;
2627
2728 final var client = Minecraft .getInstance ();
2829 final var networkHandler = client .getConnection ();
2930
3031 if (networkHandler == null ) return ;
3132
32- final var commands = Config .getCommands (key .());
33+ final var commands = Config .getCommands (key .getName ());
3334 handleCommands (commands , networkHandler );
3435 }
3536
Original file line number Diff line number Diff line change 44 "package" : " net.immortaldevs.bindcmd.mixin" ,
55 "compatibilityLevel" : " JAVA_21" ,
66 "client" : [
7- " KeyBindingMixin "
7+ " KeyMappingMixin "
88 ],
99 "server" : [
1010 " MinecraftServerMixin" ,
You can’t perform that action at this time.
0 commit comments