mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-19 15:17:56 +01:00
Merge pull request #133 from Gnat008/612-add-PermissionsSystemType-method
Add isPermissionsSystem method to PermissionsSystemType enum - fixes …
This commit is contained in:
commit
9349993faf
@ -224,11 +224,12 @@ public class PermissionsManager implements PermissionsService {
|
||||
String pluginName = plugin.getName();
|
||||
|
||||
// Check if any known permissions system is enabling
|
||||
if (pluginName.equals("PermissionsEx") || pluginName.equals("PermissionsBukkit") ||
|
||||
pluginName.equals("bPermissions") || pluginName.equals("GroupManager") ||
|
||||
pluginName.equals("zPermissions") || pluginName.equals("Vault")) {
|
||||
ConsoleLogger.info(pluginName + " plugin enabled, dynamically updating permissions hooks!");
|
||||
setup();
|
||||
for (PermissionsSystemType permissionsSystemType : PermissionsSystemType.values()) {
|
||||
if (permissionsSystemType.isPermissionSystem(pluginName)) {
|
||||
ConsoleLogger.info(pluginName + " plugin enabled, dynamically updating permissions hooks!");
|
||||
setup();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -243,11 +244,12 @@ public class PermissionsManager implements PermissionsService {
|
||||
String pluginName = plugin.getName();
|
||||
|
||||
// Is the WorldGuard plugin disabled
|
||||
if (pluginName.equals("PermissionsEx") || pluginName.equals("PermissionsBukkit") ||
|
||||
pluginName.equals("bPermissions") || pluginName.equals("GroupManager") ||
|
||||
pluginName.equals("zPermissions") || pluginName.equals("Vault")) {
|
||||
ConsoleLogger.info(pluginName + " plugin disabled, updating hooks!");
|
||||
setup();
|
||||
for (PermissionsSystemType permissionsSystemType : PermissionsSystemType.values()) {
|
||||
if (permissionsSystemType.isPermissionSystem(pluginName)) {
|
||||
ConsoleLogger.info(pluginName + " plugin disabled, updating hooks!");
|
||||
setup();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -83,4 +83,14 @@ public enum PermissionsSystemType {
|
||||
public String toString() {
|
||||
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