1717
1818package com .lambda .mixin ;
1919
20- import com .lambda .Lambda ;
2120import com .lambda .event .EventFlow ;
2221import com .lambda .event .events .ClientEvent ;
2322import com .lambda .event .events .InventoryEvent ;
2423import com .lambda .event .events .TickEvent ;
2524import com .lambda .gui .DearImGui ;
2625import com .lambda .module .modules .player .Interact ;
26+ import com .lambda .module .modules .player .InventoryMove ;
2727import com .lambda .module .modules .player .PacketMine ;
2828import com .llamalad7 .mixinextras .injector .wrapmethod .WrapMethod ;
2929import com .llamalad7 .mixinextras .injector .wrapoperation .Operation ;
3030import com .llamalad7 .mixinextras .injector .wrapoperation .WrapOperation ;
31- import com .lambda .module .modules .player .InventoryMove ;
3231import net .minecraft .client .MinecraftClient ;
3332import net .minecraft .client .gui .screen .Screen ;
3433import net .minecraft .client .gui .screen .ingame .ScreenHandlerProvider ;
3534import net .minecraft .client .network .ClientPlayerEntity ;
3635import net .minecraft .client .network .ClientPlayerInteractionManager ;
36+ import net .minecraft .client .option .KeyBinding ;
3737import net .minecraft .client .render .WorldRenderer ;
3838import net .minecraft .client .sound .SoundManager ;
3939import net .minecraft .util .Hand ;
4040import net .minecraft .util .hit .HitResult ;
41- import net .minecraft .client .option .KeyBinding ;
4241import net .minecraft .util .thread .ThreadExecutor ;
4342import org .jetbrains .annotations .Nullable ;
4443import org .spongepowered .asm .mixin .Mixin ;
@@ -53,10 +52,14 @@ public class MinecraftClientMixin {
5352 @ Shadow
5453 @ Nullable
5554 public Screen currentScreen ;
55+
5656 @ Shadow
5757 @ Nullable
5858 public HitResult crosshairTarget ;
5959
60+ @ Shadow
61+ public int itemUseCooldown ;
62+
6063 @ Inject (method = "close" , at = @ At ("HEAD" ))
6164 void closeImGui (CallbackInfo ci ) {
6265 DearImGui .INSTANCE .destroy ();
@@ -135,7 +138,7 @@ private void onScreenRemove(@Nullable Screen screen, CallbackInfo ci) {
135138
136139 @ Redirect (method = "setScreen" , at = @ At (value = "INVOKE" , target = "Lnet/minecraft/client/option/KeyBinding;unpressAll()V" ))
137140 private void redirectUnPressAll () {
138- if (InventoryMove .INSTANCE . isDisabled () || InventoryMove . hasInputOrNull ( currentScreen )) {
141+ if (! InventoryMove .getShouldMove ( )) {
139142 KeyBinding .unpressAll ();
140143 return ;
141144 }
@@ -166,6 +169,6 @@ boolean redirectMultiActon(ClientPlayerInteractionManager instance) {
166169 void injectFastPlace (CallbackInfo ci ) {
167170 if (!Interact .INSTANCE .isEnabled ()) return ;
168171
169- Lambda . getMc (). itemUseCooldown = Interact .getPlaceDelay ();
172+ itemUseCooldown = Interact .getPlaceDelay ();
170173 }
171174}
0 commit comments