Skip to content

Commit

Permalink
Update WEUtils.java
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerS1066 committed Sep 15, 2024
1 parent 311dcd6 commit 52f0f52
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@

public class WEUtils {
// Default format is the first one of the list, previous formats follow
public static final List<ClipboardFormat> SCHEMATIC_FORMATS = List.of(BuiltInClipboardFormat.SPONGE_V2_SCHEMATIC);
// List.of(BuiltInClipboardFormat.SPONGE_V3_SCHEMATIC, BuiltInClipboardFormat.SPONGE_V2_SCHEMATIC, BuiltInClipboardFormat.MCEDIT_SCHEMATIC);
public static final List<ClipboardFormat> SCHEMATIC_FORMATS = List.of(BuiltInClipboardFormat.SPONGE_V3_SCHEMATIC, BuiltInClipboardFormat.SPONGE_V2_SCHEMATIC, BuiltInClipboardFormat.MCEDIT_SCHEMATIC);

/**
* Load a schematic from disk
Expand Down Expand Up @@ -93,10 +92,10 @@ public static Clipboard loadSchematic(File directory, String name) throws FileNo
private static Clipboard loadSchematic(File directory, String name, @NotNull ClipboardFormat format) throws IOException {
name += "." + format.getPrimaryFileExtension();
File file = new File(directory, name);
if (!format.isFormat(file))
return null;
Clipboard clipboard;
try (FileInputStream inputStream = new FileInputStream(file)) {
if (!format.isFormat(inputStream))
return null;
ClipboardReader reader = format.getReader(inputStream);
clipboard = reader.read();
} catch (FileNotFoundException e) {
Expand Down

0 comments on commit 52f0f52

Please sign in to comment.