Update Permission_PermissionsEx.java

This commit is contained in:
montlikadani 2019-11-03 19:05:47 +01:00 committed by GitHub
parent 3cb2922ef8
commit c37d433d6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -49,13 +49,14 @@ public class Permission_PermissionsEx extends Permission {
if (perms.isEnabled()) {
try {
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(
"[Permission] %s below 1.16 is not compatible with Vault! Falling back to SuperPerms only mode. PLEASE UPDATE!", name));
}
} catch (NumberFormatException e) {
// Do nothing
}
permission = (PermissionsEx) perms;
log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), name));
log.info(String.format("[Permission] %s hooked.", name));
}
}
}
@ -84,14 +85,15 @@ public class Permission_PermissionsEx extends Permission {
if (perms.getDescription().getName().equals("PermissionsEx")) {
try {
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(
"[Permission] %s below 1.16 is not compatible with Vault! Falling back to SuperPerms only mode. PLEASE UPDATE!", name));
return;
}
} catch (NumberFormatException e) {
// Do nothing
}
permission.permission = (PermissionsEx) perms;
log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), permission.name));
log.info(String.format("[Permission] %s hooked.", permission.name));
}
}
}
@ -101,7 +103,7 @@ public class Permission_PermissionsEx extends Permission {
if (permission.permission != null) {
if (event.getPlugin().getDescription().getName().equals("PermissionsEx")) {
permission.permission = null;
log.info(String.format("[%s][Permission] %s un-hooked.", plugin.getDescription().getName(), permission.name));
log.info(String.format("[Permission] %s un-hooked.", permission.name));
}
}
}