From 3088b1245cf5778a2eca71e9d6df31ed1176a657 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Mon, 13 Sep 2021 15:07:16 +0100 Subject: [PATCH] Simplify flushing of clipboards in ClipboardCommands --- .../worldedit/command/ClipboardCommands.java | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java index 329bbb2b8..2b8bf64cd 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java @@ -169,7 +169,7 @@ public class ClipboardCommands { } catch (Throwable e) { throw e; } finally { - saveDiskClipboard(clipboard); + clipboard.flush(); } session.setClipboard(new ClipboardHolder(clipboard)); @@ -306,7 +306,7 @@ public class ClipboardCommands { } catch (Throwable e) { throw e; } finally { - saveDiskClipboard(clipboard); + clipboard.flush(); } session.setClipboard(new ClipboardHolder(clipboard)); @@ -465,19 +465,6 @@ public class ClipboardCommands { actor.print(Caption.of("fawe.tips.tip.copypaste")); } } - - private void saveDiskClipboard(Clipboard clipboard) { - DiskOptimizedClipboard c; - if (clipboard instanceof DiskOptimizedClipboard) { - c = (DiskOptimizedClipboard) clipboard; - } else if (clipboard instanceof BlockArrayClipboard - && ((BlockArrayClipboard) clipboard).getParent() instanceof DiskOptimizedClipboard) { - c = (DiskOptimizedClipboard) ((BlockArrayClipboard) clipboard).getParent(); - } else { - return; - } - c.flush(); - } //FAWE end @Command(