Skip to content

Commit fa15d45

Browse files
committed
修复bug
1 parent b8cd8c1 commit fa15d45

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/main/java/com/circulation/random_complement/mixin/ae2/new_patten_gui/MixinContainerPatternEncoder.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ protected int getInputs(SlotFakeCraftingMatrix[] array) {
114114

115115
@Redirect(method = "putStackInSlot", at = @At(value = "INVOKE", target = "Lappeng/container/implementations/ContainerPatternEncoder;getAndUpdateOutput()Lnet/minecraft/item/ItemStack;", remap = false))
116116
public ItemStack putStackInSlot(ContainerPatternEncoder instance, @Local(name = "slotID") int slotID) {
117-
if (isCraftingMode() && (!isRCPatternEncoder() && r$craftingSlotGroup[0][8].slotNumber == slotID)) {
117+
if (isCraftingMode() && (!isRCPatternEncoder() || isCraftingSlot(slotID))) {
118118
return getAndUpdateOutput();
119119
}
120120
return null;
@@ -133,4 +133,12 @@ public ItemStack putStackInSlot(ContainerPatternEncoder instance, @Local(name =
133133
public final boolean isRCPatternEncoder() {
134134
return r$craftingSlotGroup != null;
135135
}
136+
137+
@Intrinsic
138+
public final boolean isCraftingSlot(int slotID) {
139+
for (var slot : r$craftingSlotGroup[0]) {
140+
if (slot.slotNumber == slotID) return true;
141+
}
142+
return false;
143+
}
136144
}

0 commit comments

Comments
 (0)