From 267dc153f00a21ca67b7147795f57a203a6c8b89 Mon Sep 17 00:00:00 2001 From: Jordan Date: Mon, 9 May 2022 12:50:19 +0100 Subject: [PATCH] Don't initialise a DiskOptimisedClipboard before checking for an existing one in the LocalSession when using loadClipboardFromDisk (#1731) --- .../src/main/java/com/sk89q/worldedit/entity/Player.java | 4 ++-- 1 file changed, 2 insertions(+), 2 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 33ea8bae4..5e44f2053 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 @@ -463,7 +463,6 @@ public interface Player extends Entity, Actor { ); try { if (file.exists() && file.length() > 5) { - DiskOptimizedClipboard doc = new DiskOptimizedClipboard(file); LocalSession session = getSession(); try { if (session.getClipboard() != null) { @@ -471,9 +470,10 @@ public interface Player extends Entity, Actor { } } catch (EmptyClipboardException ignored) { } + DiskOptimizedClipboard doc = new DiskOptimizedClipboard(file); Clipboard clip = doc.toClipboard(); ClipboardHolder holder = new ClipboardHolder(clip); - getSession().setClipboard(holder); + session.setClipboard(holder); } } catch (FaweClipboardVersionMismatchException e) { print(Caption.of("fawe.error.clipboard.on.disk.version.mismatch"));