mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-02-02 13:31:54 +01:00
GM now registers with Bukkits ServicesManager.
This commit is contained in:
parent
5b195299ba
commit
559400c606
@ -83,4 +83,5 @@ v 1.6:
|
|||||||
v 1.7:
|
v 1.7:
|
||||||
- GM now supports offline players without having to mantogglevalidate
|
- GM now supports offline players without having to mantogglevalidate
|
||||||
- Offline player checks now support partial name matches.
|
- 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.
|
@ -38,8 +38,10 @@ import org.bukkit.command.CommandSender;
|
|||||||
import org.bukkit.command.ConsoleCommandSender;
|
import org.bukkit.command.ConsoleCommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.Event;
|
import org.bukkit.event.Event;
|
||||||
|
import org.bukkit.event.Event.Priority;
|
||||||
import org.bukkit.event.world.WorldListener;
|
import org.bukkit.event.world.WorldListener;
|
||||||
import org.bukkit.plugin.PluginDescriptionFile;
|
import org.bukkit.plugin.PluginDescriptionFile;
|
||||||
|
import org.bukkit.plugin.ServicePriority;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
|
||||||
@ -90,6 +92,9 @@ public class GroupManager extends JavaPlugin {
|
|||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
setLoaded(false);
|
setLoaded(false);
|
||||||
|
|
||||||
|
// Un-register this service.
|
||||||
|
this.getServer().getServicesManager().unregister(this);
|
||||||
|
|
||||||
disableScheduler(); // Shutdown before we save, so it doesn't interfere.
|
disableScheduler(); // Shutdown before we save, so it doesn't interfere.
|
||||||
if (worldsHolder != null) {
|
if (worldsHolder != null) {
|
||||||
@ -154,6 +159,9 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!");
|
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() {
|
public static boolean isLoaded() {
|
||||||
|
@ -25,6 +25,7 @@ public class GMGroupEvent extends GroupManagerEvent {
|
|||||||
|
|
||||||
this.group = group;
|
this.group = group;
|
||||||
this.action = action;
|
this.action = action;
|
||||||
|
this.groupName = group.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public GMGroupEvent(String groupName, Action action) {
|
public GMGroupEvent(String groupName, Action action) {
|
||||||
|
@ -25,6 +25,7 @@ public class GMUserEvent extends GroupManagerEvent {
|
|||||||
|
|
||||||
this.user = user;
|
this.user = user;
|
||||||
this.action = action;
|
this.action = action;
|
||||||
|
this.userName = user.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public GMUserEvent(String userName, Action action) {
|
public GMUserEvent(String userName, Action action) {
|
||||||
|
Loading…
Reference in New Issue
Block a user