mirror of
https://github.com/MilkBowl/Vault.git
synced 2025-01-01 05:48:06 +01:00
fixup permission plugin listeners.
This commit is contained in:
parent
04b24a00c0
commit
db5249ba18
@ -67,11 +67,10 @@ public class Permission_GroupManager extends Permission {
|
|||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void onPluginEnable(PluginEnableEvent event) {
|
public void onPluginEnable(PluginEnableEvent event) {
|
||||||
if (permission.groupManager == null) {
|
if (permission.groupManager == null) {
|
||||||
Plugin perms = plugin.getServer().getPluginManager().getPlugin("GroupManager");
|
Plugin p = event.getPlugin();
|
||||||
if (perms != null) {
|
if (p.getDescription().getName().equals("GroupManager")) {
|
||||||
permission.groupManager = (GroupManager) perms;
|
permission.groupManager = (GroupManager) p;
|
||||||
log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), permission.name));
|
log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), permission.name));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,13 +61,10 @@ public class Permission_PermissionsBukkit extends Permission {
|
|||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void onPluginEnable(PluginEnableEvent event) {
|
public void onPluginEnable(PluginEnableEvent event) {
|
||||||
if (permission.perms == null) {
|
if (permission.perms == null) {
|
||||||
Plugin perms = plugin.getServer().getPluginManager().getPlugin("PermissionsBukkit");
|
Plugin perms = event.getPlugin();
|
||||||
|
if (perms.getDescription().getName().equals("PermissionsBukkit")) {
|
||||||
if (perms != null) {
|
permission.perms = (PermissionsPlugin) perms;
|
||||||
if (perms.isEnabled()) {
|
log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), permission.name));
|
||||||
permission.perms = (PermissionsPlugin) perms;
|
|
||||||
log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), permission.name));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -82,9 +82,8 @@ public class Permission_PermissionsEx extends Permission {
|
|||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void onPluginEnable(PluginEnableEvent event) {
|
public void onPluginEnable(PluginEnableEvent event) {
|
||||||
if (permission.permission == null) {
|
if (permission.permission == null) {
|
||||||
Plugin perms = plugin.getServer().getPluginManager().getPlugin("PermissionsEx");
|
Plugin perms = event.getPlugin();
|
||||||
|
if (perms.getDescription().getName().equals("PermissionsEx")) {
|
||||||
if (perms != null) {
|
|
||||||
try {
|
try {
|
||||||
if (Double.valueOf(perms.getDescription().getVersion()) < 1.16) {
|
if (Double.valueOf(perms.getDescription().getVersion()) < 1.16) {
|
||||||
log.info(String.format("[%s][Permission] %s below 1.16 is not compatible with Vault! Falling back to SuperPerms only mode. PLEASE UPDATE!", plugin.getDescription().getName(), name));
|
log.info(String.format("[%s][Permission] %s below 1.16 is not compatible with Vault! Falling back to SuperPerms only mode. PLEASE UPDATE!", plugin.getDescription().getName(), name));
|
||||||
|
@ -44,9 +44,8 @@ public class Permission_Privileges extends Permission {
|
|||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void onPluginEnable(PluginEnableEvent event) {
|
public void onPluginEnable(PluginEnableEvent event) {
|
||||||
if (permission.privs == null) {
|
if (permission.privs == null) {
|
||||||
Plugin perms = plugin.getServer().getPluginManager().getPlugin("Privileges");
|
Plugin perms = event.getPlugin();
|
||||||
|
if (perms.getDescription().getName().equals("Privileges")) {
|
||||||
if (perms != null) {
|
|
||||||
permission.privs = (Privileges) perms;
|
permission.privs = (Privileges) perms;
|
||||||
log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), permission.name));
|
log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), permission.name));
|
||||||
}
|
}
|
||||||
|
@ -60,9 +60,8 @@ public class Permission_SimplyPerms extends Permission{
|
|||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void onPluginEnable(PluginEnableEvent event) {
|
public void onPluginEnable(PluginEnableEvent event) {
|
||||||
if (permission.perms == null) {
|
if (permission.perms == null) {
|
||||||
Plugin perms = plugin.getServer().getPluginManager().getPlugin("SimplyPerms");
|
Plugin perms = event.getPlugin();
|
||||||
|
if (perms.getDescription().getName().equals("SimplyPerms")) {
|
||||||
if (perms != null) {
|
|
||||||
permission.perms = ((SimplyPlugin) perms).getAPI();
|
permission.perms = ((SimplyPlugin) perms).getAPI();
|
||||||
log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), permission.name));
|
log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), permission.name));
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ public class Permission_Starburst extends Permission {
|
|||||||
public void onPluginEnable(PluginEnableEvent event) {
|
public void onPluginEnable(PluginEnableEvent event) {
|
||||||
if (perms == null) {
|
if (perms == null) {
|
||||||
Plugin p = event.getPlugin();
|
Plugin p = event.getPlugin();
|
||||||
if (p.getDescription().getName().equals("Starburst") && p.isEnabled()) {
|
if (p.getDescription().getName().equals("Starburst")) {
|
||||||
perms = (StarburstPlugin) p;
|
perms = (StarburstPlugin) p;
|
||||||
log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), name));
|
log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), name));
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ public class Permission_TotalPermissions extends Permission {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void onPluginEnable(PluginEnableEvent event) {
|
public void onPluginEnable(PluginEnableEvent event) {
|
||||||
if (manager == null) {
|
if (manager == null || totalperms == null) {
|
||||||
Plugin permPlugin = event.getPlugin();
|
Plugin permPlugin = event.getPlugin();
|
||||||
if (permPlugin.getDescription().getName().equals(name)) {
|
if (permPlugin.getDescription().getName().equals(name)) {
|
||||||
totalperms = (TotalPermissions) permPlugin;
|
totalperms = (TotalPermissions) permPlugin;
|
||||||
|
@ -63,10 +63,10 @@ public class Permission_Xperms extends Permission {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void onPluginEnable(PluginEnableEvent event) {
|
public void onPluginEnable(PluginEnableEvent event) {
|
||||||
if(permission == null){
|
if (permission.perms == null) {
|
||||||
Plugin perms = plugin.getServer().getPluginManager().getPlugin("Xperms");
|
Plugin perms = event.getPlugin();
|
||||||
if(perms != null){
|
if(perms.getDescription().getName().equals("Xperms")){
|
||||||
try{
|
try{
|
||||||
if(Double.valueOf(perms.getDescription().getVersion()) < 1.1){
|
if(Double.valueOf(perms.getDescription().getVersion()) < 1.1){
|
||||||
log.info(String.format("[%s] [Permission] %s Current version is not compatible with vault! Please Update!", plugin.getDescription().getName(), name));
|
log.info(String.format("[%s] [Permission] %s Current version is not compatible with vault! Please Update!", plugin.getDescription().getName(), name));
|
||||||
|
@ -62,7 +62,7 @@ public class Permission_bPermissions2 extends Permission {
|
|||||||
public void onPluginEnable(PluginEnableEvent event) {
|
public void onPluginEnable(PluginEnableEvent event) {
|
||||||
if (!hooked) {
|
if (!hooked) {
|
||||||
Plugin p = event.getPlugin();
|
Plugin p = event.getPlugin();
|
||||||
if(p.getDescription().getName().equals("bPermissions") && p.isEnabled()) {
|
if(p.getDescription().getName().equals("bPermissions")) {
|
||||||
hooked = true;
|
hooked = true;
|
||||||
log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), name));
|
log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), name));
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ public class Permission_zPermissions extends Permission {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void onPluginEnable(PluginEnableEvent event) {
|
public void onPluginEnable(PluginEnableEvent event) {
|
||||||
if (service == null) {
|
if (service == null && event.getPlugin().getDescription().getName().equals("zPermissions")) {
|
||||||
service = plugin.getServer().getServicesManager().load(ZPermissionsService.class);
|
service = plugin.getServer().getServicesManager().load(ZPermissionsService.class);
|
||||||
if (service != null) {
|
if (service != null) {
|
||||||
log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), name));
|
log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), name));
|
||||||
|
Loading…
Reference in New Issue
Block a user