mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-17 07:45:10 +01:00
Add isPermissionsSystem method to PermissionsSystemType enum - fixes #612
This commit is contained in:
parent
a854d4e0e0
commit
428b27943b
@ -224,11 +224,12 @@ public class PermissionsManager implements PermissionsService {
|
|||||||
String pluginName = plugin.getName();
|
String pluginName = plugin.getName();
|
||||||
|
|
||||||
// Check if any known permissions system is enabling
|
// Check if any known permissions system is enabling
|
||||||
if (pluginName.equals("PermissionsEx") || pluginName.equals("PermissionsBukkit") ||
|
for (PermissionsSystemType permissionsSystemType : PermissionsSystemType.values()) {
|
||||||
pluginName.equals("bPermissions") || pluginName.equals("GroupManager") ||
|
if (permissionsSystemType.isPermissionSystem(pluginName)) {
|
||||||
pluginName.equals("zPermissions") || pluginName.equals("Vault")) {
|
ConsoleLogger.info(pluginName + " plugin enabled, dynamically updating permissions hooks!");
|
||||||
ConsoleLogger.info(pluginName + " plugin enabled, dynamically updating permissions hooks!");
|
setup();
|
||||||
setup();
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -243,11 +244,12 @@ public class PermissionsManager implements PermissionsService {
|
|||||||
String pluginName = plugin.getName();
|
String pluginName = plugin.getName();
|
||||||
|
|
||||||
// Is the WorldGuard plugin disabled
|
// Is the WorldGuard plugin disabled
|
||||||
if (pluginName.equals("PermissionsEx") || pluginName.equals("PermissionsBukkit") ||
|
for (PermissionsSystemType permissionsSystemType : PermissionsSystemType.values()) {
|
||||||
pluginName.equals("bPermissions") || pluginName.equals("GroupManager") ||
|
if (permissionsSystemType.isPermissionSystem(pluginName)) {
|
||||||
pluginName.equals("zPermissions") || pluginName.equals("Vault")) {
|
ConsoleLogger.info(pluginName + " plugin disabled, updating hooks!");
|
||||||
ConsoleLogger.info(pluginName + " plugin disabled, updating hooks!");
|
setup();
|
||||||
setup();
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,4 +83,14 @@ public enum PermissionsSystemType {
|
|||||||
public String toString() {
|
public String toString() {
|
||||||
return getName();
|
return getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given plugin is a permissions system.
|
||||||
|
*
|
||||||
|
* @param name The name of the plugin to check.
|
||||||
|
* @return If the plugin is a valid permissions system.
|
||||||
|
*/
|
||||||
|
public boolean isPermissionSystem(String name) {
|
||||||
|
return name.equals(pluginName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user