From b2f36facd861d72f61ae9193e5fcf8b532d9519e Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Tue, 16 Jul 2024 14:50:41 +0100 Subject: [PATCH] fix: identify schematic format by file if not specified --- .../java/com/sk89q/worldedit/command/SchematicCommands.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java index 920a24901..8a7751bd4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java @@ -356,7 +356,7 @@ public class SchematicCommands { File dir = Settings.settings().PATHS.PER_PLAYER_SCHEMATICS ? new File(saveDir, actor.getUniqueId().toString()) : saveDir; File file; if (filename.startsWith("#")) { - format = ClipboardFormats.findByAlias(formatName); + format = noExplicitFormat ? null : ClipboardFormats.findByAlias(formatName); String[] extensions; if (format != null) { extensions = format.getFileExtensions().toArray(new String[0]); @@ -396,7 +396,7 @@ public class SchematicCommands { .isInSubDirectory(saveDir, file)) + ")")); return; } - if (format == null) { + if (format == null || noExplicitFormat) { format = ClipboardFormats.findByFile(file); if (format == null) { actor.print(Caption.of("worldedit.schematic.unknown-format", TextComponent.of(formatName)));