Skip to content

Commit ac7e43e

Browse files
committed
Fix server ops falling through to client
1 parent f61bee9 commit ac7e43e

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

common/src/main/java/dev/terminalmc/clientsort/client/inventory/operator/SingleUseOperator.java

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
*/
6666
public abstract class SingleUseOperator {
6767

68-
private boolean hasOperated = false;
6968
protected final AbstractContainerScreen<?> screen;
7069
protected final ContainerScreenHelper<? extends AbstractContainerScreen<?>> screenHelper;
7170
protected final Operation op;
@@ -198,20 +197,6 @@ private Slot[] collectSlots(Slot refSlot, Scope scope) {
198197
return collectedSlots.toArray(new Slot[0]);
199198
}
200199

201-
/**
202-
* @return {@code true} if this instance has not previously performed an operation (and
203-
* therefore is able to perform one).
204-
*/
205-
private boolean canOperate() {
206-
if (hasOperated) {
207-
ClientSort.LOG.warn("{} can only be used once!", this.getClass().getSimpleName());
208-
return false;
209-
} else {
210-
hasOperated = true;
211-
return true;
212-
}
213-
}
214-
215200
/**
216201
* Sets a flag to indicate that a client interaction operation is in progress.
217202
*/
@@ -341,6 +326,7 @@ private static boolean operate(
341326
if (debug())
342327
ClientSort.LOG.info("Preparing server operator for {}", operation.name());
343328
wrapper.accept(new ServerOperator(screen, originSlot, operation));
329+
return true;
344330
}
345331

346332
// Fall back to client ops
@@ -368,9 +354,8 @@ private static boolean operate(
368354
} else {
369355
startClientOp();
370356
op.run();
357+
return true;
371358
}
372-
373-
return true;
374359
}
375360

376361
private static SingleUseOperator getClientOperator(

0 commit comments

Comments
 (0)