1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-09-30 16:19:11 +02:00

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

@@ -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() {