1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-02-15 20:01:43 +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; continue;
try { try {
double temp = Double.parseDouble(permission.getKey().replace(perm, "")); double temp = Double.parseDouble(permission.getKey().replace(perm, ""));
if (cumulative) if (cumulative) {
if (amount == Double.NEGATIVE_INFINITY)
amount = 0D;
amount += temp; amount += temp;
else if (temp > amount) }else if (temp > amount)
amount = temp; amount = temp;
} catch (NumberFormatException ex) { } catch (NumberFormatException ex) {
Jobs.getPluginLogger().log(java.util.logging.Level.WARNING, ex.getLocalizedMessage()); Jobs.getPluginLogger().log(java.util.logging.Level.WARNING, ex.getLocalizedMessage());
@ -204,8 +206,6 @@ public class PermissionManager {
jPlayer.addToPermissionsCache(perm, permInfo); jPlayer.addToPermissionsCache(perm, permInfo);
} }
CMIDebug.d("this return");
return permInfo.getState(); return permInfo.getState();
} }