From dac7cdbe4b7bc77b9c4c0d9e677cdb83ae17ebb2 Mon Sep 17 00:00:00 2001 From: Jordan Date: Sat, 27 Jul 2024 10:34:10 +0200 Subject: [PATCH] chore: deprecate FaweApi#load for clipboards as it does not allow closing (#2852) --- .../src/main/java/com/fastasyncworldedit/core/FaweAPI.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/FaweAPI.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/FaweAPI.java index acc0d8bf3..0bf621bc6 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/FaweAPI.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/FaweAPI.java @@ -116,7 +116,10 @@ public class FaweAPI { * @param file the file to load * @return a clipboard containing the schematic * @see ClipboardFormat + * @deprecated Opens streams that are not then closed. Use {@link ClipboardFormats#findByFile(File)} and its relevant + * methods to allow closing created streams/closing the reader (which will close the stream(s)) */ + @Deprecated(forRemoval = true, since = "TODO") public static Clipboard load(File file) throws IOException { return ClipboardFormats.findByFile(file).load(file); }