1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-16 05:01:34 +01:00

Accumulative permission fix

This commit is contained in:
Zrips 2023-02-16 16:32:04 +02:00
parent bd430b3cd7
commit 237cabf82f

View File

@ -172,9 +172,11 @@ public class PermissionManager {
continue;
try {
double temp = Double.parseDouble(permission.getKey().replace(perm, ""));
if (cumulative)
if (cumulative) {
if (amount == Double.NEGATIVE_INFINITY)
amount = 0D;
amount += temp;
else if (temp > amount)
}else if (temp > amount)
amount = temp;
} catch (NumberFormatException ex) {
Jobs.getPluginLogger().log(java.util.logging.Level.WARNING, ex.getLocalizedMessage());
@ -184,7 +186,7 @@ public class PermissionManager {
permInfo.setValue(amount == Double.NEGATIVE_INFINITY ? 0D : amount);
jPlayer.addToPermissionsCache(perm, permInfo);
}
return permInfo.getValue();
}
@ -204,8 +206,6 @@ public class PermissionManager {
jPlayer.addToPermissionsCache(perm, permInfo);
}
CMIDebug.d("this return");
return permInfo.getState();
}