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

Fixing Dynamic payments bonus not being calculated properly

This commit is contained in:
Zrips 2022-03-10 17:14:11 +02:00
parent 7e2ac97578
commit 84be2eba79
3 changed files with 12 additions and 10 deletions

View File

@ -620,7 +620,10 @@ public class GeneralConfigManager {
} }
DynamicPaymentMaxPenalty = c.get("Economy.DynamicPayment.MaxPenalty", 50.0); DynamicPaymentMaxPenalty = c.get("Economy.DynamicPayment.MaxPenalty", 50.0);
DynamicPaymentMaxPenalty /= -100D;
DynamicPaymentMaxBonus = c.get("Economy.DynamicPayment.MaxBonus", 300.0); DynamicPaymentMaxBonus = c.get("Economy.DynamicPayment.MaxBonus", 300.0);
DynamicPaymentMaxBonus /= 100D;
c.addComment("Economy.MaxPayment.curve.use", "Enabling this feature will mean players will still earn once they reach cap but " + c.addComment("Economy.MaxPayment.curve.use", "Enabling this feature will mean players will still earn once they reach cap but " +
"will loose a percentage the higher over cap they go. Controlled by a factor. math is ```100/((1/factor*percentOver^2)+1)```"); "will loose a percentage the higher over cap they go. Controlled by a factor. math is ```100/((1/factor*percentOver^2)+1)```");
useMaxPaymentCurve = c.get("Economy.MaxPayment.curve.use", false); useMaxPaymentCurve = c.get("Economy.MaxPayment.curve.use", false);
@ -893,8 +896,8 @@ public class GeneralConfigManager {
c.addComment("BossBar.Timer", "How long in sec to show BossBar for player", c.addComment("BossBar.Timer", "How long in sec to show BossBar for player",
"If you have disabled ShowOnEachAction, then keep this number higher than payment interval for better experience"); "If you have disabled ShowOnEachAction, then keep this number higher than payment interval for better experience");
BossBarTimer = c.get("BossBar.Timer", economyBatchDelay + 1); BossBarTimer = c.get("BossBar.Timer", economyBatchDelay + 1);
c.addComment("BossBar.Async", "If enabled, bossbar creation and management will be asynchronous.", "This avoids TPS drops when the ShowOnEachAction option is activated."); c.addComment("BossBar.Async", "If enabled, bossbar creation and management will be asynchronous.", "This avoids TPS drops when the ShowOnEachAction option is activated.");
bossBarAsync = c.get("BossBar.Async", false); bossBarAsync = c.get("BossBar.Async", false);
} }
c.addComment("ShowActionBars", "You can enable/disable message shown for players in action bar"); c.addComment("ShowActionBars", "You can enable/disable message shown for players in action bar");
@ -1167,7 +1170,7 @@ public class GeneralConfigManager {
return InformDuplicates; return InformDuplicates;
} }
public boolean isBossBarAsync() { public boolean isBossBarAsync() {
return bossBarAsync; return bossBarAsync;
} }
} }

View File

@ -43,6 +43,7 @@ import com.gamingmesh.jobs.actions.PotionItemActionInfo;
import net.Zrips.CMILib.Colors.CMIChatColor; import net.Zrips.CMILib.Colors.CMIChatColor;
import net.Zrips.CMILib.Equations.Parser; import net.Zrips.CMILib.Equations.Parser;
import net.Zrips.CMILib.Items.CMIMaterial; import net.Zrips.CMILib.Items.CMIMaterial;
import net.Zrips.CMILib.Logs.CMIDebug;
public class Job { public class Job {
@ -228,11 +229,10 @@ public class Job {
if (now > Jobs.getGCManager().DynamicPaymentMaxBonus) if (now > Jobs.getGCManager().DynamicPaymentMaxBonus)
now = Jobs.getGCManager().DynamicPaymentMaxBonus; now = Jobs.getGCManager().DynamicPaymentMaxBonus;
double maxPenalty = Jobs.getGCManager().DynamicPaymentMaxPenalty * -1; if (now < Jobs.getGCManager().DynamicPaymentMaxPenalty)
if (now < maxPenalty) now = Jobs.getGCManager().DynamicPaymentMaxPenalty;
now = maxPenalty;
this.bonus = (now / 100D); this.bonus = now;
} }
public double getBonus() { public double getBonus() {

View File

@ -200,7 +200,6 @@ public class Quest {
Map<String, QuestObjective> old = objectives.get(objective.getAction()); Map<String, QuestObjective> old = objectives.get(objective.getAction());
if (old == null) { if (old == null) {
old = new HashMap<>(); old = new HashMap<>();
old.put(objective.getTargetName(), objective);
objectives.put(objective.getAction(), old); objectives.put(objective.getAction(), old);
} }
old.put(objective.getTargetName(), objective); old.put(objective.getTargetName(), objective);