Delayed GroupManager events so Superperms will be fully updated before

plugins receive the events.
This commit is contained in:
ElgarL 2011-12-20 17:21:55 +00:00
parent a2202439bb
commit debcf4714a
2 changed files with 14 additions and 3 deletions

View file

@ -91,4 +91,5 @@ v 1.8:
- Changed ServicesManager registration to lowest from normal.
- Fixed 'manucheckp' returning a null for the searched node when it's a group/subgroup.
- manpromote and mandemote now correctly send the notification to the console if the command was issued there.
- Expanded GlobalGroups.yml and Groups.yml to include Towny permissions.
- Expanded GlobalGroups.yml and Groups.yml to include Towny permissions.
- Delayed GroupManager events so Superperms will be fully updated before plugins receive the events.

View file

@ -1840,11 +1840,21 @@ public class GroupManager extends JavaPlugin {
/**
* Triggers all GroupManager events for other plugins to see.
* Schedules events for 1 tick later to allow GM to finish populating super perms.
*
* @param event
*/
public static void callEvent(GroupManagerEvent event) {
Bukkit.getServer().getPluginManager().callEvent(event);
public static void callEvent(final GroupManagerEvent event) {
if (Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Bukkit.getPluginManager().getPlugin("GroupManager"), new Runnable() {
@Override
public void run() {
Bukkit.getServer().getPluginManager().callEvent(event);
}
}) == -1)
GroupManager.logger.warning("Could not schedule GM Event.");
}
/**