GM now registers with Bukkits ServicesManager.

This commit is contained in:
ElgarL 2011-12-13 18:20:02 +00:00
parent 5b195299ba
commit 559400c606
4 changed files with 12 additions and 1 deletions

View file

@ -83,4 +83,5 @@ v 1.6:
v 1.7:
- GM now supports offline players without having to mantogglevalidate
- Offline player checks now support partial name matches.
- Added custom events so plugins can now be notified of changes within GroupManager.
- Added custom events so plugins can now be notified of changes within GroupManager.
- GM now registers with Bukkits ServicesManager.

View file

@ -38,8 +38,10 @@ import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.Event.Priority;
import org.bukkit.event.world.WorldListener;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.ServicePriority;
import org.bukkit.plugin.java.JavaPlugin;
@ -90,6 +92,9 @@ public class GroupManager extends JavaPlugin {
@Override
public void onDisable() {
setLoaded(false);
// Un-register this service.
this.getServer().getServicesManager().unregister(this);
disableScheduler(); // Shutdown before we save, so it doesn't interfere.
if (worldsHolder != null) {
@ -154,6 +159,9 @@ public class GroupManager extends JavaPlugin {
}
System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!");
// Register as a service
this.getServer().getServicesManager().register(AnjoPermissionsHandler.class, this.permissionHandler, this, ServicePriority.Normal);
}
public static boolean isLoaded() {

View file

@ -25,6 +25,7 @@ public class GMGroupEvent extends GroupManagerEvent {
this.group = group;
this.action = action;
this.groupName = group.getName();
}
public GMGroupEvent(String groupName, Action action) {

View file

@ -25,6 +25,7 @@ public class GMUserEvent extends GroupManagerEvent {
this.user = user;
this.action = action;
this.userName = user.getName();
}
public GMUserEvent(String userName, Action action) {