Skip to content

Commit fac4b45

Browse files
committed
Enable match transfer keybind
1 parent 1b94378 commit fac4b45

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

common/src/main/java/dev/terminalmc/clientsort/mixin/client/AbstractContainerScreenMixin.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ private void beforeKeyPressed(
217217
return this::clientsort$sort;
218218
} else if (inputMatcher.apply(KeybindManager.STACK_FILL_KEY)) {
219219
return this::clientsort$fillStacks;
220+
} else if (inputMatcher.apply(KeybindManager.MATCH_TRANSFER_KEY)) {
221+
return this::clientsort$matchTransfer;
220222
} else if (inputMatcher.apply(KeybindManager.TRANSFER_KEY)) {
221223
return this::clientsort$transfer;
222224
} else {
@@ -274,6 +276,19 @@ private void beforeKeyPressed(
274276
return true;
275277
}
276278

279+
@Unique
280+
private boolean clientsort$matchTransfer() {
281+
SingleUseOperator<?> operator = SingleUseOperator.getOperator(
282+
(AbstractContainerScreen<?>) (Object) this,
283+
clientsort$screenHelper.get(),
284+
hoveredSlot,
285+
Operation.MATCH_TRANSFER
286+
);
287+
if (operator != null)
288+
operator.tryMatchTransfer();
289+
return true;
290+
}
291+
277292
@Unique
278293
private boolean clientsort$transfer() {
279294
SingleUseOperator<?> operator = SingleUseOperator.getOperator(

0 commit comments

Comments
 (0)