@@ -49,15 +49,17 @@ protected MixinContainerScreen(Text text) {
4949 }
5050
5151 @ Inject (at = @ At (value = "INVOKE" , target = "Lnet/minecraft/client/gui/screen/ingame/HandledScreen;" +
52- "drawBackground(Lnet/minecraft/client/gui/DrawContext;FII)V" , shift = At .Shift .AFTER ), method = "render" )
52+ "drawBackground(Lnet/minecraft/client/gui/DrawContext;FII)V" ,
53+ shift = At .Shift .AFTER ), method = "render" )
5354 public void onBackgroundRender (DrawContext drawContext , int i , int j , float f , CallbackInfo ci ) {
5455 ContainerScreenEventHandler .INSTANCE .onBackgroundRender (new NativeContext (drawContext ), i , j );
5556 }
5657
5758
5859
5960 @ Inject (at = @ At (value = "INVOKE" , target = "Lnet/minecraft/client/gui/screen/ingame/HandledScreen;" +
60- "drawForeground(Lnet/minecraft/client/gui/DrawContext;II)V" , shift = At .Shift .AFTER ), method = "render" )
61+ "drawForeground(Lnet/minecraft/client/gui/DrawContext;II)V" ,
62+ shift = At .Shift .AFTER ), method = "render" )
6163 public void onForegroundRender (DrawContext drawContext , int i , int j , float f , CallbackInfo ci ) {
6264 var context = new NativeContext (drawContext );
6365 context .setOverlay (true );
@@ -72,11 +74,12 @@ public void onForegroundRender(DrawContext drawContext, int i, int j, float f, C
7274 public void onMouseClick (Slot slot , int slotId , int button , SlotActionType actionType , CallbackInfo ci ) {
7375 Log .INSTANCE .trace ("onMouseClick for " + slotId );
7476 LockSlotsHandler .INSTANCE .setLastMouseClickSlot (slot );
75- if (slot != null
76- && LockedSlotsSettings .INSTANCE .getLOCK_SLOTS_DISABLE_USER_INTERACTION ().getValue ()
77- && LockSlotsHandler .INSTANCE .isMappedSlotLocked (slot )) {
78- Log .INSTANCE .trace ("cancel for " + slotId );
79- ci .cancel ();
77+ if (slot != null && LockedSlotsSettings .INSTANCE .getLOCK_SLOTS_DISABLE_USER_INTERACTION ().getValue ()) {
78+ if (LockSlotsHandler .INSTANCE .isMappedSlotLocked (slot ) ||
79+ (actionType == SlotActionType .SWAP && LockSlotsHandler .INSTANCE .isSlotLocked (button ))) {
80+ Log .INSTANCE .trace ("cancel for " + slotId );
81+ ci .cancel ();
82+ }
8083 }
8184 }
8285
0 commit comments