mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-24 18:19:03 +01:00
Hopefully fix region managers not being created correctly.
This commit is contained in:
parent
810501a508
commit
ecef9c9792
@ -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;
|
||||
}
|
||||
|
||||
|
@ -51,6 +51,12 @@ public class YAMLDatabase extends AbstractProtectionDatabase {
|
||||
private Map<String, ProtectedRegion> 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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user