fix PEX hook.

This commit is contained in:
Sleaker 2012-01-13 16:13:11 -08:00
parent 98808d7538
commit 5722a31346

View File

@ -55,15 +55,15 @@ public class Permission_PermissionsEx extends Permission {
if (permission == null) { if (permission == null) {
Plugin perms = plugin.getServer().getPluginManager().getPlugin("PermissionsEx"); Plugin perms = plugin.getServer().getPluginManager().getPlugin("PermissionsEx");
if (perms != null) { if (perms != null) {
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));
return;
}
} catch (NumberFormatException e) {
// Do nothing
}
if (perms.isEnabled()) { 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));
return;
}
} catch (NumberFormatException e) {
// Do nothing
}
permission = (PermissionsEx) perms; permission = (PermissionsEx) perms;
log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), name)); log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), name));
} }
@ -108,6 +108,14 @@ public class Permission_PermissionsEx extends Permission {
if (perms != null) { if (perms != null) {
if (perms.isEnabled()) { 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));
return;
}
} catch (NumberFormatException e) {
// Do nothing
}
permission.permission = (PermissionsEx) perms; permission.permission = (PermissionsEx) 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));
} }