diff options
author | ElgarL <ElgarL@palmergames.com> | 2011-10-01 13:44:06 +0100 |
---|---|---|
committer | ElgarL <ElgarL@palmergames.com> | 2011-10-01 13:44:06 +0100 |
commit | f712b56671cd3197e645d4cf59838d26b61f11c7 (patch) | |
tree | 5e0aa8efd42b1305c9a08b00cf2b68d44e3a29ee /EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder | |
parent | 0462026f332de2fd2d2bc442b222b91de5853c1a (diff) | |
download | Essentials-f712b56671cd3197e645d4cf59838d26b61f11c7.tar Essentials-f712b56671cd3197e645d4cf59838d26b61f11c7.tar.gz Essentials-f712b56671cd3197e645d4cf59838d26b61f11c7.tar.lz Essentials-f712b56671cd3197e645d4cf59838d26b61f11c7.tar.xz Essentials-f712b56671cd3197e645d4cf59838d26b61f11c7.zip |
Rewrote Config loading to use Bukkits Configuration features
Added an opOverride setting in config.
If present and set to false, op's will not get overriding permissions
in GroupManager.
(one op will not be able to alter another op's settings)
GM will now create all relevant world data files for non mirrored
worlds.
(for all worlds named in config.yml)
Diffstat (limited to 'EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder')
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java index a2c34be16..32c06249a 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java @@ -22,6 +22,7 @@ import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder; import org.anjocaido.groupmanager.permissions.AnjoPermissionsHandler; import org.anjocaido.groupmanager.utils.Tasks; import org.bukkit.entity.Player; +import org.bukkit.util.config.ConfigurationNode; /** * @@ -85,6 +86,8 @@ public class WorldsHolder { Map<String, Object> mirrorsMap = plugin.getConfig().getMirrorsMap(); if (mirrorsMap != null) { for (String source : mirrorsMap.keySet()) { + // Make sure all non mirrored worlds have a set of data files. + setupWorldFolder(source); if (mirrorsMap.get(source) instanceof ArrayList) { ArrayList mirrorList = (ArrayList) mirrorsMap.get(source); for (Object o : mirrorList) { @@ -246,17 +249,24 @@ public class WorldsHolder { } private void verifyFirstRun() { - worldsFolder = new File(plugin.getDataFolder(), "worlds"); - if (!worldsFolder.exists()) { - worldsFolder.mkdirs(); - } + Properties server = new Properties(); try { server.load(new FileInputStream(new File("server.properties"))); + serverDefaultWorldName = server.getProperty("level-name").toLowerCase(); + setupWorldFolder(serverDefaultWorldName); } catch (IOException ex) { GroupManager.logger.log(Level.SEVERE, null, ex); } - serverDefaultWorldName = server.getProperty("level-name").toLowerCase(); + + } + + private void setupWorldFolder(String worldName) { + worldsFolder = new File(plugin.getDataFolder(), "worlds"); + if (!worldsFolder.exists()) { + worldsFolder.mkdirs(); + } + File defaultWorldFolder = new File(worldsFolder, serverDefaultWorldName); if (!defaultWorldFolder.exists()) { defaultWorldFolder.mkdirs(); |