diff --git a/src/main/java/com/sk89q/worldguard/protection/GlobalRegionManager.java b/src/main/java/com/sk89q/worldguard/protection/GlobalRegionManager.java index 4b0b5e5d..f2690102 100644 --- a/src/main/java/com/sk89q/worldguard/protection/GlobalRegionManager.java +++ b/src/main/java/com/sk89q/worldguard/protection/GlobalRegionManager.java @@ -149,18 +149,18 @@ public RegionManager load(World world) { lastModified.put(name, file.lastModified()); return manager; - } catch (FileNotFoundException e) { - logger.warning("WorldGuard: Region file for world \"" + } catch (FileNotFoundException e) { // this should no longer happen hopefully + logger.info("WorldGuard: Region file for world \"" + name + "\" missing or inaccessible."); } catch (IOException e) { - logger.warning("WorldGuard: Failed to load regions from file " + logger.info("WorldGuard: Failed to load regions from file " + file.getAbsolutePath() + " : " + e.getMessage()); } catch (Exception e) { - logger.warning("WorldGuard: Error loading regions for world \"" + logger.info("WorldGuard: Error loading regions for world \"" + name + "\":" + e.getMessage()); } - // @TODO: THIS CREATES PROBLEMS!! + // @TODO: THIS CREATES PROBLEMS!!one!!1!!eleven!!1!!! return null; } diff --git a/src/main/java/com/sk89q/worldguard/protection/databases/YAMLDatabase.java b/src/main/java/com/sk89q/worldguard/protection/databases/YAMLDatabase.java index 42e0d474..eae3506e 100644 --- a/src/main/java/com/sk89q/worldguard/protection/databases/YAMLDatabase.java +++ b/src/main/java/com/sk89q/worldguard/protection/databases/YAMLDatabase.java @@ -51,6 +51,12 @@ public class YAMLDatabase extends AbstractProtectionDatabase { private Map regions; public YAMLDatabase(File file) { + if (!file.exists()) { // shouldn't be necessary, but check anyways + try { + file.createNewFile(); + } catch (IOException e) {} + // if this is thrown, we can't do anything (caught elsewhere anyway) + } config = new Configuration(file); }