Skip to content

Commit 1049aa3

Browse files
committed
fix: schematic format detection
1 parent cf26bd7 commit 1049aa3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/BuiltInClipboardFormat.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
import org.anarres.parallelgzip.ParallelGZIPOutputStream;
4141
import org.enginehub.linbus.stream.LinBinaryIO;
4242
import org.enginehub.linbus.stream.LinReadOptions;
43-
import org.enginehub.linbus.tree.LinCompoundTag;
4443
import org.enginehub.linbus.tree.LinRootEntry;
4544

4645
import java.io.BufferedInputStream;
@@ -261,7 +260,11 @@ public boolean isFormat(InputStream inputStream) {
261260

262261
@Override
263262
public boolean isFormat(File file) {
264-
return MCEDIT_SCHEMATIC.isFormat(file);
263+
String name = file.getName().toLowerCase(Locale.ROOT);
264+
if (!name.endsWith(".schematic") && !name.endsWith(".mcedit") && !name.endsWith(".mce")) {
265+
return false;
266+
}
267+
return super.isFormat(file);
265268
}
266269

267270
@Override
@@ -272,7 +275,7 @@ public Set<String> getExplicitFileExtensions() {
272275

273276
/**
274277
* @deprecated Slow, resource intensive, but sometimes safer than using the recommended
275-
* {@link BuiltInClipboardFormat#FAST}.
278+
* {@link BuiltInClipboardFormat#FAST_V2}.
276279
* Avoid using with any large schematics/clipboards for reading/writing.
277280
*/
278281
@Deprecated

0 commit comments

Comments
 (0)