mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-24 18:19:03 +01:00
Fixed a bug, partially, regarding unloaded worlds.
This commit is contained in:
parent
1241e18f9c
commit
1e203b58c3
@ -128,7 +128,7 @@ public void unloadAll() {
|
||||
*
|
||||
* @param world
|
||||
*/
|
||||
public void load(World world) {
|
||||
public RegionManager load(World world) {
|
||||
String name = world.getName();
|
||||
File file = getPath(name);
|
||||
|
||||
@ -143,11 +143,16 @@ public void load(World world) {
|
||||
|
||||
// Store the last modification date so we can track changes
|
||||
lastModified.put(name, file.lastModified());
|
||||
|
||||
return manager;
|
||||
} catch (FileNotFoundException e) {
|
||||
} catch (IOException e) {
|
||||
logger.warning("WorldGuard: Failed to load regions from file "
|
||||
+ 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());
|
||||
|
||||
if (manager == null) {
|
||||
load(world);
|
||||
manager = load(world);
|
||||
}
|
||||
|
||||
return manager;
|
||||
|
Loading…
Reference in New Issue
Block a user