Skip to content

Commit a90c967

Browse files
committed
Misc cleanup
1 parent 07ce2e6 commit a90c967

4 files changed

Lines changed: 9 additions & 3 deletions

File tree

common/src/main/java/dev/terminalmc/clientsort/client/ClientSort.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class ClientSort {
4848
public static @Nullable MultiLineTextWidget overlayMessage = null;
4949
private static Runnable clearOverlayMessage = null;
5050

51-
public static boolean searchOrderUpdated;
51+
public static volatile boolean searchOrderUpdated;
5252

5353
public static volatile boolean emiReloading = false;
5454
public static volatile boolean updateBlockedByEmi = false;

common/src/main/java/dev/terminalmc/clientsort/client/order/CreativeSearchOrder.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,13 @@ private static void refreshStackPositionMap() {
9797

9898
Collection<ItemStack> displayStacks;
9999
try {
100-
CreativeModeTabs.tryRebuildTabContents(enabledFeatures, true, mc.level.registryAccess());
100+
CreativeModeTabs.tryRebuildTabContents(
101+
enabledFeatures,
102+
true,
103+
mc.level.registryAccess()
104+
);
101105

102-
// other mods might modify these items while our thread is evaluating them, so copy each item.
106+
// Other mods might modify these items while our thread is evaluating them, so copy
103107
displayStacks = CreativeModeTabs.searchTab().getDisplayItems()
104108
.stream().map(ItemStack::copy).toList();
105109
} finally {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ private void beforeLogin(ClientboundLoginPacket packet, CallbackInfo ci) {
4141
// Reset state on relog
4242
ClientSort.searchOrderUpdated = false;
4343
ClientSort.operatingClient = false;
44+
ClientSort.clientOpQueue.clear();
4445
}
4546

4647
@Inject(

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public abstract class LocalPlayerMixin {
3939
public void beforeContainerClose(CallbackInfo callbackInfo) {
4040
InteractionManager.clear();
4141
ClientSort.operatingClient = false;
42+
ClientSort.clientOpQueue.clear();
4243
}
4344

4445
@Inject(

0 commit comments

Comments
 (0)