diff options
author | KHobbits <rob@khobbits.co.uk> | 2011-09-24 21:41:28 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2011-09-24 21:41:28 +0100 |
commit | c681befdf2053ca32e7613c91bb1699a48a905ab (patch) | |
tree | ccb5a0b63844cd2cdf6f5b7cfe4c7a8610434b77 /EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java | |
parent | 87dc671a0d4837313b388e7fcce72e7718fb06d2 (diff) | |
parent | 2db256678ec1412a0e76bae88bd07a44f21a8139 (diff) | |
download | Essentials-c681befdf2053ca32e7613c91bb1699a48a905ab.tar Essentials-c681befdf2053ca32e7613c91bb1699a48a905ab.tar.gz Essentials-c681befdf2053ca32e7613c91bb1699a48a905ab.tar.lz Essentials-c681befdf2053ca32e7613c91bb1699a48a905ab.tar.xz Essentials-c681befdf2053ca32e7613c91bb1699a48a905ab.zip |
Merge remote branch 'remotes/ess/groupmanager' into essmaster
Diffstat (limited to 'EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java')
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index 2b0a493d4..13d99ddc1 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -7,6 +7,7 @@ package org.anjocaido.groupmanager; import org.anjocaido.groupmanager.permissions.AnjoPermissionsHandler; import org.anjocaido.groupmanager.permissions.BukkitPermissions; import org.anjocaido.groupmanager.utils.GroupManagerPermissions; +import org.anjocaido.groupmanager.Tasks.BukkitPermsUpdateTask; import org.anjocaido.groupmanager.data.Variables; import org.anjocaido.groupmanager.data.User; import org.anjocaido.groupmanager.data.Group; @@ -62,7 +63,7 @@ public class GroupManager extends JavaPlugin { @Override public void onDisable() { - isLoaded = false; + setLoaded(false); if (worldsHolder != null) { worldsHolder.saveChanges(); @@ -96,11 +97,30 @@ public class GroupManager extends JavaPlugin { BukkitPermissions = new BukkitPermissions(this); enableScheduler(); - isLoaded = true; + + /* + * Schedule a Bukiit Permissions update for 1 tick later. + * All plugins will be loaded by then + */ + + if (getServer().getScheduler().scheduleSyncDelayedTask(this, new BukkitPermsUpdateTask(),1) == -1) + GroupManager.logger.severe("Could not schedule superperms Update."); + else + setLoaded(true); + + //setLoaded(true); System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!"); } - public InputStream getResourceAsStream(String fileName) { + public static boolean isLoaded() { + return isLoaded; + } + + public static void setLoaded(boolean isLoaded) { + GroupManager.isLoaded = isLoaded; + } + + public InputStream getResourceAsStream(String fileName) { return this.getClassLoader().getResourceAsStream(fileName); } |