1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-02 14:29:07 +01:00

Fix when smaller boost values takes precendence over largest

Fixes #984
This commit is contained in:
montlikadani 2020-11-13 09:08:45 +01:00
parent f55c02570e
commit 2ff77210b8
2 changed files with 7 additions and 7 deletions

View File

@ -153,7 +153,7 @@ public class PermissionManager {
double temp = Double.parseDouble(permission.getKey().replace(perm, ""));
if (cumulative)
amount += temp;
else if (allowMinus || temp > amount)
else if (amount == 0D || allowMinus || temp > amount)
amount = temp;
} catch (NumberFormatException ignored) {
ignored.printStackTrace();

View File

@ -859,7 +859,7 @@ public class PlayerManager {
ItemStack iih = Jobs.getNms().getItemInMainHand(player);
JobItems jitem = getJobsItemByNbt(iih);
if (jitem != null && jitem.getJobs().contains(prog))
data.add(jitem.getBoost(this.getJobsPlayer(player).getJobProgression(prog)));
data.add(jitem.getBoost(getJobsPlayer(player).getJobProgression(prog)));
// Lets check offhand
if (Version.isCurrentEqualOrHigher(Version.v1_9_R1) && Jobs.getGCManager().boostedItemsInOffHand) {
@ -867,19 +867,19 @@ public class PlayerManager {
if (iih != null) {
jitem = getJobsItemByNbt(iih);
if (jitem != null && jitem.getJobs().contains(prog))
data.add(jitem.getBoost(this.getJobsPlayer(player).getJobProgression(prog)));
data.add(jitem.getBoost(getJobsPlayer(player).getJobProgression(prog)));
}
}
for (ItemStack OneArmor : player.getInventory().getArmorContents()) {
if (OneArmor == null || OneArmor.getType() == org.bukkit.Material.AIR)
for (ItemStack oneArmor : player.getInventory().getArmorContents()) {
if (oneArmor == null || oneArmor.getType() == org.bukkit.Material.AIR)
continue;
JobItems armorboost = getJobsItemByNbt(OneArmor);
JobItems armorboost = getJobsItemByNbt(oneArmor);
if (armorboost == null || !armorboost.getJobs().contains(prog))
continue;
data.add(armorboost.getBoost(this.getJobsPlayer(player).getJobProgression(prog)));
data.add(armorboost.getBoost(getJobsPlayer(player).getJobProgression(prog)));
}
return data;