Merge branch 'features/v5/internal-updates' of https://github.com/IntellectualSites/PlotSquared into features/v5/internal-updates

This commit is contained in:
NotMyFault 2020-03-28 02:26:25 +01:00
commit 37336fffe2

View File

@ -282,7 +282,7 @@ public abstract class SchematicHandler {
Settings.Paths.SCHEMATICS + File.separator + name);
if (!file.exists()) {
file = MainUtil.getFile(PlotSquared.get().IMP.getDirectory(),
Settings.Paths.SCHEMATICS + File.separator + name + "atic");
Settings.Paths.SCHEMATICS + File.separator + name);
}
return getSchematic(file);
}
@ -319,19 +319,18 @@ public abstract class SchematicHandler {
if (!file.exists()) {
return null;
}
try {
ClipboardFormat format = ClipboardFormats.findByFile(file);
if (format != null) {
ClipboardReader reader = format.getReader(new FileInputStream(file));
try (ClipboardReader reader = format.getReader(new FileInputStream(file))) {
Clipboard clip = reader.read();
return new Schematic(clip);
} catch (IOException e) {
e.printStackTrace();
}
} else {
throw new UnsupportedFormatException(
"This schematic format is not recognised or supported.");
}
} catch (IOException e) {
e.printStackTrace();
}
return null;
}