Skip to content

Commit 4a0a63e

Browse files
committed
wait 2s before removing closed POS GUI from the active GUIs cache
1 parent bf68327 commit 4a0a63e

File tree

1 file changed

+3
-1
lines changed
  • src/main/java/pro/cloudnode/smp/bankaccounts/events

1 file changed

+3
-1
lines changed

src/main/java/pro/cloudnode/smp/bankaccounts/events/GUI.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ public void posItemsChangeWhileOpened(final @NotNull InventoryMoveItemEvent even
180180
@EventHandler
181181
public void posGuiClosed(final @NotNull InventoryCloseEvent event) {
182182
if (!POS.activePosChestGuis.containsKey(event.getInventory())) return;
183-
POS.activePosChestGuis.remove(event.getInventory());
183+
BankAccounts.getInstance().getServer().getScheduler().runTaskLater(BankAccounts.getInstance(), () -> {
184+
POS.activePosChestGuis.remove(event.getInventory());
185+
}, 40L);
184186
}
185187

186188
public final static @NotNull HashMap<@NotNull String, @NotNull NamespacedKey[]> keys = new HashMap<>() {{

0 commit comments

Comments
 (0)