mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-28 05:25:20 +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
|
* @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;
|
||||||
|
Loading…
Reference in New Issue
Block a user