From 17e8be0bd29d68dca0602c0f55835e5c85283f51 Mon Sep 17 00:00:00 2001 From: IronApollo Date: Sun, 14 Oct 2018 07:14:12 -0400 Subject: [PATCH] Fixes some schematic files not being found with proper input --- .../worldedit/extent/clipboard/io/ClipboardFormat.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java index e73429309..de1e3ad37 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormat.java @@ -354,11 +354,21 @@ public enum ClipboardFormat { dir = new File(dir + "." + getExtension()); } } + if(!dir.exists()) { + for(ClipboardFormat format : values) { + if(new File(working, (Settings.IMP.PATHS.PER_PLAYER_SCHEMATICS ? (player.getUniqueId().toString() + File.separator) : "") + input + "." + format.getExtension()).exists()) { + return format.loadAllFromInput(player, input, message); + } + } + } if (!dir.exists()) { if (message) BBC.SCHEMATIC_NOT_FOUND.send(player, input); return null; } if (!dir.isDirectory()) { + if(!findByFile(dir).getExtension().equals(getExtension())) { + return findByFile(dir).loadAllFromInput(player, input, message); + } ByteSource source = Files.asByteSource(dir); URI uri = dir.toURI(); return new MultiClipboardHolder(uri, new LazyClipboardHolder(dir.toURI(), source, this, null));