From 96ca83704a1ec4d0509427a095fe7ff908bf0548 Mon Sep 17 00:00:00 2001 From: Hannes Greule Date: Sat, 25 Dec 2021 17:18:39 +0100 Subject: [PATCH] fix: Backport fixing delay closing of clipboards on quit (#1493) --- .../src/main/java/com/sk89q/worldedit/entity/Player.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java index 5d4206c71..09b82b028 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java @@ -437,12 +437,14 @@ public interface Player extends Entity, Actor { } else { continue; } - doc.close(); // Ensure closed before deletion - doc.getFile().delete(); + WorldEdit.getInstance().getExecutorService().submit(() -> { + doc.close(); // Ensure closed before deletion + doc.getFile().delete(); + }); } } } else if (Settings.IMP.CLIPBOARD.DELETE_ON_LOGOUT || Settings.IMP.CLIPBOARD.USE_DISK) { - session.setClipboard(null); + WorldEdit.getInstance().getExecutorService().submit(() -> session.setClipboard(null)); } if (Settings.IMP.HISTORY.DELETE_ON_LOGOUT) { session.clearHistory();