Fixed a bug, partially, regarding unloaded worlds.

This commit is contained in:
sk89q 2011-04-07 00:22:15 -07:00
parent 1241e18f9c
commit 1e203b58c3

View File

@ -128,7 +128,7 @@ public void unloadAll() {
* *
* @param world * @param world
*/ */
public void load(World world) { public RegionManager load(World world) {
String name = world.getName(); String name = world.getName();
File file = getPath(name); File file = getPath(name);
@ -143,11 +143,16 @@ public void load(World world) {
// Store the last modification date so we can track changes // Store the last modification date so we can track changes
lastModified.put(name, file.lastModified()); lastModified.put(name, file.lastModified());
return manager;
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
} catch (IOException e) { } catch (IOException e) {
logger.warning("WorldGuard: Failed to load regions from file " logger.warning("WorldGuard: Failed to load regions from file "
+ file.getAbsolutePath() + " : " + e.getMessage()); + file.getAbsolutePath() + " : " + e.getMessage());
} }
// @TODO: THIS CREATES PROBLEMS!!
return null;
} }
/** /**
@ -197,7 +202,7 @@ public RegionManager get(World world) {
RegionManager manager = managers.get(world.getName()); RegionManager manager = managers.get(world.getName());
if (manager == null) { if (manager == null) {
load(world); manager = load(world);
} }
return manager; return manager;