Skip to content
This repository was archived by the owner on Jun 17, 2025. It is now read-only.

Commit 1819ae2

Browse files
committed
more disable user input for locked slots.
1 parent fbf0b59 commit 1819ae2

18 files changed

Lines changed: 96 additions & 70 deletions

File tree

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import org.anti_ad.mc.ipnext.buildsrc.loom_version
2323
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2424
import java.io.ByteArrayOutputStream
2525

26-
val versionObj = Version("1", "10", "3",
26+
val versionObj = Version("1", "10", "4",
2727
preRelease = (System.getenv("IPNEXT_RELEASE") == null))
2828

2929

changelog.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<!-- latest begin -->
22

3-
### 1.10.3
3+
### 1.10.4
44

5-
- Support for 1.20 Fabric. The pre1/2 version does work but has some GUI glitches.
6-
- Fixed default sort rule for 1.19.4 and 1.20 to really use the Creative search tab index.
7-
- Fixed a problem where the bookmark buttons didn't work last 1 or 2 trades.
5+
- "Disable all input user for locked slots" now disables and swap buttons (1-9)
6+
- Forge 1.20.1 support
87

98
### WARNING
109

@@ -21,10 +20,17 @@ Any problems that are not reproducible on Fabric will be addressed with very low
2120
- **1.19.2**
2221
- **1.19.4**
2322
- **1.20**
23+
- **1.20.1**
2424

2525
<!-- latest end -->
2626
<!-- rest begin -->
2727

28+
### 1.10.3
29+
30+
- Support for 1.20 Fabric. The pre1/2 version does work but has some GUI glitches.
31+
- Fixed default sort rule for 1.19.4 and 1.20 to really use the Creative search tab index.
32+
- Fixed a problem where the bookmark buttons didn't work last 1 or 2 trades.
33+
2834
### 1.10.2
2935

3036
- Sorry for the torrent of updates but somehow the last released end up build from 1.10.1 sources

platforms/fabric-1.16/src/main/java/org/anti_ad/mc/ipnext/mixin/MixinContainerScreen.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,12 @@ public void onForegroundRender(MatrixStack matrixStack, int i, int j, float f, C
6666
public void onMouseClick(Slot slot, int slotId, int button, SlotActionType actionType, CallbackInfo ci) {
6767
Log.INSTANCE.trace("onMouseClick for " + slotId);
6868
LockSlotsHandler.INSTANCE.setLastMouseClickSlot(slot);
69-
if (slot != null
70-
&& LockedSlotsSettings.INSTANCE.getLOCK_SLOTS_DISABLE_USER_INTERACTION().getValue()
71-
&& LockSlotsHandler.INSTANCE.isMappedSlotLocked(slot)) {
72-
Log.INSTANCE.trace("cancel for " + slotId);
73-
ci.cancel();
69+
if (slot != null && LockedSlotsSettings.INSTANCE.getLOCK_SLOTS_DISABLE_USER_INTERACTION().getValue()) {
70+
if (LockSlotsHandler.INSTANCE.isMappedSlotLocked(slot) ||
71+
(actionType == SlotActionType.SWAP && LockSlotsHandler.INSTANCE.isSlotLocked(button))) {
72+
Log.INSTANCE.trace("cancel for " + slotId);
73+
ci.cancel();
74+
}
7475
}
7576
}
7677

platforms/fabric-1.18.2/src/main/java/org/anti_ad/mc/ipnext/mixin/MixinContainerScreen.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,12 @@ public void onForegroundRender(MatrixStack matrixStack, int i, int j, float f, C
6767
public void onMouseClick(Slot slot, int slotId, int button, SlotActionType actionType, CallbackInfo ci) {
6868
Log.INSTANCE.trace("onMouseClick for " + slotId);
6969
LockSlotsHandler.INSTANCE.setLastMouseClickSlot(slot);
70-
if (slot != null
71-
&& LockedSlotsSettings.INSTANCE.getLOCK_SLOTS_DISABLE_USER_INTERACTION().getValue()
72-
&& LockSlotsHandler.INSTANCE.isMappedSlotLocked(slot)) {
73-
Log.INSTANCE.trace("cancel for " + slotId);
74-
ci.cancel();
70+
if (slot != null && LockedSlotsSettings.INSTANCE.getLOCK_SLOTS_DISABLE_USER_INTERACTION().getValue()) {
71+
if (LockSlotsHandler.INSTANCE.isMappedSlotLocked(slot) ||
72+
(actionType == SlotActionType.SWAP && LockSlotsHandler.INSTANCE.isSlotLocked(button))) {
73+
Log.INSTANCE.trace("cancel for " + slotId);
74+
ci.cancel();
75+
}
7576
}
7677
}
7778

platforms/fabric-1.19.4/src/main/java/org/anti_ad/mc/ipnext/mixin/MixinContainerScreen.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,12 @@ public void onForegroundRender(MatrixStack matrixStack, int i, int j, float f, C
6767
public void onMouseClick(Slot slot, int slotId, int button, SlotActionType actionType, CallbackInfo ci) {
6868
Log.INSTANCE.trace("onMouseClick for " + slotId);
6969
LockSlotsHandler.INSTANCE.setLastMouseClickSlot(slot);
70-
if (slot != null
71-
&& LockedSlotsSettings.INSTANCE.getLOCK_SLOTS_DISABLE_USER_INTERACTION().getValue()
72-
&& LockSlotsHandler.INSTANCE.isMappedSlotLocked(slot)) {
73-
Log.INSTANCE.trace("cancel for " + slotId);
74-
ci.cancel();
70+
if (slot != null && LockedSlotsSettings.INSTANCE.getLOCK_SLOTS_DISABLE_USER_INTERACTION().getValue()) {
71+
if (LockSlotsHandler.INSTANCE.isMappedSlotLocked(slot) ||
72+
(actionType == SlotActionType.SWAP && LockSlotsHandler.INSTANCE.isSlotLocked(button))) {
73+
Log.INSTANCE.trace("cancel for " + slotId);
74+
ci.cancel();
75+
}
7576
}
7677
}
7778

platforms/fabric-1.19/src/main/java/org/anti_ad/mc/ipnext/mixin/MixinContainerScreen.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,12 @@ public void onForegroundRender(MatrixStack matrixStack, int i, int j, float f, C
6767
public void onMouseClick(Slot slot, int slotId, int button, SlotActionType actionType, CallbackInfo ci) {
6868
Log.INSTANCE.trace("onMouseClick for " + slotId);
6969
LockSlotsHandler.INSTANCE.setLastMouseClickSlot(slot);
70-
if (slot != null
71-
&& LockedSlotsSettings.INSTANCE.getLOCK_SLOTS_DISABLE_USER_INTERACTION().getValue()
72-
&& LockSlotsHandler.INSTANCE.isMappedSlotLocked(slot)) {
73-
Log.INSTANCE.trace("cancel for " + slotId);
74-
ci.cancel();
70+
if (slot != null && LockedSlotsSettings.INSTANCE.getLOCK_SLOTS_DISABLE_USER_INTERACTION().getValue()) {
71+
if (LockSlotsHandler.INSTANCE.isMappedSlotLocked(slot) ||
72+
(actionType == SlotActionType.SWAP && LockSlotsHandler.INSTANCE.isSlotLocked(button))) {
73+
Log.INSTANCE.trace("cancel for " + slotId);
74+
ci.cancel();
75+
}
7576
}
7677
}
7778

platforms/fabric-1.20/src/main/java/org/anti_ad/mc/ipnext/mixin/MixinContainerScreen.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

platforms/forge-1.16/src/main/java/org/anti_ad/mc/ipnext/mixin/MixinAbstractContainerScreen.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,12 @@ public class MixinAbstractContainerScreen<T extends Container> {
4242
protected void slotClicked(Slot slot, int slotId, int p_97780_, ClickType p_97781_, CallbackInfo ci) {
4343
Log.INSTANCE.trace("onMouseClick for " + slotId);
4444
LockSlotsHandler.INSTANCE.setLastMouseClickSlot(slot);
45-
if (slot != null
46-
&& LockedSlotsSettings.INSTANCE.getLOCK_SLOTS_DISABLE_USER_INTERACTION().getValue()
47-
&& LockSlotsHandler.INSTANCE.isMappedSlotLocked(slot)) {
48-
Log.INSTANCE.trace("cancel for " + slotId);
49-
ci.cancel();
45+
if (slot != null && LockedSlotsSettings.INSTANCE.getLOCK_SLOTS_DISABLE_USER_INTERACTION().getValue()) {
46+
if (LockSlotsHandler.INSTANCE.isMappedSlotLocked(slot) ||
47+
(p_97781_ == ClickType.SWAP && LockSlotsHandler.INSTANCE.isSlotLocked(p_97780_))) {
48+
Log.INSTANCE.trace("cancel for " + slotId);
49+
ci.cancel();
50+
}
5051
}
5152
}
5253

platforms/forge-1.18.2/src/main/java/org/anti_ad/mc/ipnext/mixin/MixinAbstractContainerScreen.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,12 @@ protected void slotClicked(Slot slot, int slotId, int p_97780_, ClickType p_9778
5757
//Log.INSTANCE.trace("from here:", new Throwable());
5858
}
5959
LockSlotsHandler.INSTANCE.setLastMouseClickSlot(slot);
60-
if (slot != null
61-
&& LockedSlotsSettings.INSTANCE.getLOCK_SLOTS_DISABLE_USER_INTERACTION().getValue()
62-
&& LockSlotsHandler.INSTANCE.isMappedSlotLocked(slot)) {
63-
Log.INSTANCE.trace("cancel for " + slotId);
64-
ci.cancel();
60+
if (slot != null && LockedSlotsSettings.INSTANCE.getLOCK_SLOTS_DISABLE_USER_INTERACTION().getValue()) {
61+
if (LockSlotsHandler.INSTANCE.isMappedSlotLocked(slot) ||
62+
(p_97781_ == ClickType.SWAP && LockSlotsHandler.INSTANCE.isSlotLocked(p_97780_))) {
63+
Log.INSTANCE.trace("cancel for " + slotId);
64+
ci.cancel();
65+
}
6566
}
6667
}
6768

platforms/forge-1.19.4/src/main/java/org/anti_ad/mc/ipnext/mixin/MixinAbstractContainerScreen.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,12 @@ public class MixinAbstractContainerScreen<T extends AbstractContainerMenu> {
4242
protected void slotClicked(Slot slot, int slotId, int p_97780_, ClickType p_97781_, CallbackInfo ci) {
4343
Log.INSTANCE.trace("onMouseClick for " + slotId);
4444
LockSlotsHandler.INSTANCE.setLastMouseClickSlot(slot);
45-
if (slot != null
46-
&& LockedSlotsSettings.INSTANCE.getLOCK_SLOTS_DISABLE_USER_INTERACTION().getValue()
47-
&& LockSlotsHandler.INSTANCE.isMappedSlotLocked(slot)) {
48-
Log.INSTANCE.trace("cancel for " + slotId);
49-
ci.cancel();
45+
if (slot != null && LockedSlotsSettings.INSTANCE.getLOCK_SLOTS_DISABLE_USER_INTERACTION().getValue()) {
46+
if (LockSlotsHandler.INSTANCE.isMappedSlotLocked(slot) ||
47+
(p_97781_ == ClickType.SWAP && LockSlotsHandler.INSTANCE.isSlotLocked(p_97780_))) {
48+
Log.INSTANCE.trace("cancel for " + slotId);
49+
ci.cancel();
50+
}
5051
}
5152
}
5253

0 commit comments

Comments
 (0)