Skip to content

Commit d4a91d9

Browse files
Fix window state update incrementing window tick
1 parent b7a7e64 commit d4a91d9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

invui/src/main/java/xyz/xenondevs/invui/window/AbstractWindow.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ non-sealed abstract class AbstractWindow<M extends CustomContainerMenu> implemen
9898
.collect(Collectors.toCollection(ArrayList::new));
9999

100100
serverWindowState.observeWeak(this, thisRef -> {
101-
thisRef.handleTick(); // important: flush item updates and send packets
101+
thisRef.updateAndFlush(); // important: flush item updates and send packets
102102
thisRef.menu.sendPing(serverWindowState.get());
103103
});
104104

@@ -196,14 +196,17 @@ public void notifyUpdate(int slot) {
196196
}
197197

198198
public void handleTick() {
199+
updateAndFlush();
200+
windowTick++;
201+
}
202+
203+
private void updateAndFlush() {
199204
updateSlots();
200205

201206
if (titleSupplier instanceof AnimatedTitle)
202207
updateTitle();
203208

204209
menu.sendChangesToRemote();
205-
206-
windowTick++;
207210
}
208211

209212
@Override

0 commit comments

Comments
 (0)