summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager/src/org/anjocaido/groupmanager
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2011-10-01 16:22:04 +0100
committerElgarL <ElgarL@palmergames.com>2011-10-01 16:22:04 +0100
commit1f6daa7424d836a1f1b1c7a76ac10611b5bde349 (patch)
tree4ce722e57ba5b93937ccd094922715f178d4c173 /EssentialsGroupManager/src/org/anjocaido/groupmanager
parent30af6f36ceaa12d7bbcdd8294074b3ce764c6695 (diff)
downloadEssentials-1f6daa7424d836a1f1b1c7a76ac10611b5bde349.tar
Essentials-1f6daa7424d836a1f1b1c7a76ac10611b5bde349.tar.gz
Essentials-1f6daa7424d836a1f1b1c7a76ac10611b5bde349.tar.lz
Essentials-1f6daa7424d836a1f1b1c7a76ac10611b5bde349.tar.xz
Essentials-1f6daa7424d836a1f1b1c7a76ac10611b5bde349.zip
Fix for loading of worlds not in the config
Fix for folder creation of unique worlds
Diffstat (limited to 'EssentialsGroupManager/src/org/anjocaido/groupmanager')
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java20
1 files changed, 17 insertions, 3 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java
index 32c06249a..eb972c481 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java
@@ -53,6 +53,7 @@ public class WorldsHolder {
*/
public WorldsHolder(GroupManager plugin) {
this.plugin = plugin;
+ // Setup folders and check files exist for the primary world
verifyFirstRun();
initialLoad();
if (defaultWorld == null) {
@@ -61,17 +62,26 @@ public class WorldsHolder {
}
private void initialLoad() {
+ // load the initial world
initialWorldLoading();
+ // Configure and load any mirrors and additional worlds as defined in config.yml
mirrorSetUp();
+ // search the worlds folder for any manually created worlds (not listed in config.yml)
+ loadAllSearchedWorlds();
}
private void initialWorldLoading() {
//LOAD EVERY WORLD POSSIBLE
loadWorld(serverDefaultWorldName);
defaultWorld = worldsData.get(serverDefaultWorldName);
-
+ }
+
+ private void loadAllSearchedWorlds() {
for (File folder : worldsFolder.listFiles()) {
- if (folder.getName().equalsIgnoreCase(serverDefaultWorldName)) {
+ if (folder.isDirectory())
+ GroupManager.logger.info("World Found: " + folder.getName());
+
+ if (worldsData.containsKey(folder.getName().toLowerCase())) {
continue;
}
if (folder.isDirectory()) {
@@ -88,6 +98,10 @@ public class WorldsHolder {
for (String source : mirrorsMap.keySet()) {
// Make sure all non mirrored worlds have a set of data files.
setupWorldFolder(source);
+ // Load the world data
+ if (!worldsData.containsKey(source.toLowerCase()))
+ loadWorld(source);
+
if (mirrorsMap.get(source) instanceof ArrayList) {
ArrayList mirrorList = (ArrayList) mirrorsMap.get(source);
for (Object o : mirrorList) {
@@ -267,7 +281,7 @@ public class WorldsHolder {
worldsFolder.mkdirs();
}
- File defaultWorldFolder = new File(worldsFolder, serverDefaultWorldName);
+ File defaultWorldFolder = new File(worldsFolder, worldName);
if (!defaultWorldFolder.exists()) {
defaultWorldFolder.mkdirs();
}