From 48aeb58bbb31fa2667256d6bd540efcb0ce32740 Mon Sep 17 00:00:00 2001 From: sk89q Date: Mon, 4 Oct 2010 17:04:28 -0700 Subject: [PATCH] Updated the .schematic save routine to also create directories as required. --- src/WorldEdit.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/WorldEdit.java b/src/WorldEdit.java index 62a870c65..03de7bbea 100644 --- a/src/WorldEdit.java +++ b/src/WorldEdit.java @@ -501,6 +501,12 @@ public class WorldEdit extends Plugin { if (!filePath.substring(0, dirPath.length()).equals(dirPath)) { player.sendMessage(Colors.Rose + "Invalid path for Schematic."); } else { + // Create parent directories + File parent = f.getParentFile(); + if (parent != null && !parent.exists()) { + parent.mkdirs(); + } + session.getClipboard().saveSchematic(filePath); logger.log(Level.INFO, player.getName() + " saved " + filePath); player.sendMessage(Colors.LightPurple + filename + " saved.");