diff options
Diffstat (limited to 'EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder')
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java index a5e76e464..50e6ef547 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java @@ -21,6 +21,7 @@ import org.anjocaido.groupmanager.dataholder.WorldDataHolder; import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder; import org.anjocaido.groupmanager.permissions.AnjoPermissionsHandler; import org.anjocaido.groupmanager.utils.Tasks; +import org.bukkit.World; import org.bukkit.entity.Player; /** @@ -70,21 +71,39 @@ public class WorldsHolder { } private void initialWorldLoading() { - //LOAD EVERY WORLD POSSIBLE + //Load the default world loadWorld(serverDefaultWorldName); defaultWorld = worldsData.get(serverDefaultWorldName); } private void loadAllSearchedWorlds() { + + /* + * Read all known worlds from Bukkit + * Create the data files if they don't already exist, + * and they are not mirrored. + */ + for (World world: plugin.getServer().getWorlds()) + if ((!worldsData.containsKey(world.getName().toLowerCase())) + && (!mirrors.containsKey(world.getName().toLowerCase()))) + setupWorldFolder(world.getName()); + /* + * Loop over all folders within the worlds folder + * and attempt to load the world data + */ for (File folder : worldsFolder.listFiles()) { - if (folder.isDirectory()) + if (folder.isDirectory()) { GroupManager.logger.info("World Found: " + folder.getName()); - if (worldsData.containsKey(folder.getName().toLowerCase())) { - continue; - } - if (folder.isDirectory()) { - loadWorld(folder.getName()); + /* + * don't load any worlds which are already loaded + * or mirrored worlds that don't need data. + */ + if (worldsData.containsKey(folder.getName().toLowerCase()) + || mirrors.containsKey(folder.getName().toLowerCase())) { + continue; + } + loadWorld(folder.getName()); } } } |