1111import meteordevelopment .meteorclient .events .entity .player .*;
1212import meteordevelopment .meteorclient .mixininterface .IClientPlayerInteractionManager ;
1313import meteordevelopment .meteorclient .systems .modules .Modules ;
14- import meteordevelopment .meteorclient .systems .modules .misc .InventoryTweaks ;
1514import meteordevelopment .meteorclient .systems .modules .player .BreakDelay ;
1615import meteordevelopment .meteorclient .systems .modules .player .SpeedMine ;
1716import meteordevelopment .meteorclient .utils .world .BlockUtils ;
2322import net .minecraft .entity .player .PlayerEntity ;
2423import net .minecraft .item .ItemStack ;
2524import net .minecraft .network .packet .c2s .play .PlayerActionC2SPacket ;
26- import net .minecraft .screen .PlayerScreenHandler ;
27- import net .minecraft .screen .ScreenHandler ;
2825import net .minecraft .screen .slot .SlotActionType ;
2926import net .minecraft .util .ActionResult ;
3027import net .minecraft .util .Hand ;
@@ -49,9 +46,6 @@ public abstract class ClientPlayerInteractionManagerMixin implements IClientPlay
4946
5047 @ Shadow protected abstract void syncSelectedSlot ();
5148
52- @ Shadow
53- public abstract void clickSlot (int syncId , int slotId , int button , SlotActionType actionType , PlayerEntity player );
54-
5549 @ Shadow
5650 @ Final
5751 private ClientPlayNetworkHandler networkHandler ;
@@ -70,33 +64,6 @@ else if (slotId == -999) {
7064 }
7165 }
7266
73- @ Inject (method = "clickSlot" , at = @ At ("HEAD" ), cancellable = true )
74- public void onClickArmorSlot (int syncId , int slotId , int button , SlotActionType actionType , PlayerEntity player , CallbackInfo ci ) {
75- if (!Modules .get ().get (InventoryTweaks .class ).armorStorage ()) return ;
76-
77- ScreenHandler screenHandler = player .currentScreenHandler ;
78-
79- if (screenHandler instanceof PlayerScreenHandler ) {
80- if (slotId >= 5 && slotId <= 8 ) {
81- int armorSlot = (8 - slotId ) + 36 ;
82- if (actionType == SlotActionType .PICKUP && !screenHandler .getCursorStack ().isEmpty ()) {
83- clickSlot (syncId , 17 , armorSlot , SlotActionType .SWAP , player ); //armor slot <-> inv slot
84- clickSlot (syncId , 17 , button , SlotActionType .PICKUP , player ); //inv slot <-> cursor slot
85- clickSlot (syncId , 17 , armorSlot , SlotActionType .SWAP , player ); //armor slot <-> inv slot
86- ci .cancel ();
87- } else if (actionType == SlotActionType .SWAP ) {
88- if (button >= 10 ) {
89- clickSlot (syncId , 45 , armorSlot , SlotActionType .SWAP , player );
90- ci .cancel ();
91- } else {
92- clickSlot (syncId , 36 + button , armorSlot , SlotActionType .SWAP , player ); //invert swap
93- ci .cancel ();
94- }
95- }
96- }
97- }
98- }
99-
10067 @ Inject (method = "attackBlock" , at = @ At ("HEAD" ), cancellable = true )
10168 private void onAttackBlock (BlockPos blockPos , Direction direction , CallbackInfoReturnable <Boolean > info ) {
10269 if (MeteorClient .EVENT_BUS .post (StartBreakingBlockEvent .get (blockPos , direction )).isCancelled ()) info .cancel ();
0 commit comments