mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2025-01-19 14:51:34 +01:00
check file format
This commit is contained in:
parent
5bdc2d6519
commit
049aff4d74
@ -332,6 +332,7 @@ public class SchemVis extends ImmutableVirtualWorld {
|
|||||||
cached.createNewFile();
|
cached.createNewFile();
|
||||||
try (FileInputStream in = new FileInputStream(file)) {
|
try (FileInputStream in = new FileInputStream(file)) {
|
||||||
ClipboardFormat format = ClipboardFormat.findByFile(file);
|
ClipboardFormat format = ClipboardFormat.findByFile(file);
|
||||||
|
if (format != null) {
|
||||||
ClipboardReader reader = format.getReader(in);
|
ClipboardReader reader = format.getReader(in);
|
||||||
Clipboard clipboard = reader.read(worldData);
|
Clipboard clipboard = reader.read(worldData);
|
||||||
clipboard.setOrigin(clipboard.getMinimumPoint());
|
clipboard.setOrigin(clipboard.getMinimumPoint());
|
||||||
@ -377,6 +378,7 @@ public class SchemVis extends ImmutableVirtualWorld {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
cached.delete();
|
cached.delete();
|
||||||
|
Loading…
Reference in New Issue
Block a user