Skip to content

Commit

Permalink
add support for +1.13 schematic format (tutorial plots)
Browse files Browse the repository at this point in the history
  • Loading branch information
LordTuxn committed Mar 18, 2024
1 parent 2764c2a commit 208b744
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,17 @@ public double getVersion() {

@Override
protected File getSchematicFile(String fileName) {
File file = Paths.get(PlotUtils.getDefaultSchematicPath(), "tutorials", fileName + ".schematic").toFile();
if (file.exists()) return file;
File newSchem = Paths.get(PlotUtils.getDefaultSchematicPath(), "tutorials", fileName + ".schem").toFile();
if (newSchem.exists()) return newSchem;
File oldSchem = Paths.get(PlotUtils.getDefaultSchematicPath(), "tutorials", fileName + ".schematic").toFile();
if (oldSchem.exists()) return oldSchem;

try {
FileUtils.copyInputStreamToFile(Objects.requireNonNull(PlotSystem.getPlugin().getResource("tutorial/schematics/" + fileName + ".schematic.gz")), file);
FileUtils.copyInputStreamToFile(Objects.requireNonNull(PlotSystem.getPlugin().getResource("tutorial/schematics/" + fileName + ".schematic.gz")), oldSchem);
} catch (IOException ex) {
Bukkit.getLogger().log(Level.SEVERE, "An error occurred while copying the schematic file!", ex);
}
return file;
return oldSchem;
}

public File getOutlinesSchematic(int schematicId) {
Expand Down

0 comments on commit 208b744

Please sign in to comment.