boosts: Add option to disable boost threshold notifications (#11668)

Co-authored-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tim van Rossum
2020-05-22 21:58:22 +02:00
committed by GitHub
parent d434e48d77
commit ab22082e38
2 changed files with 14 additions and 3 deletions

View File

@@ -103,12 +103,23 @@ public interface BoostsConfig extends Config
@ConfigItem( @ConfigItem(
keyName = "boostThreshold", keyName = "boostThreshold",
name = "Boost Amount Threshold", name = "Boost amount threshold",
description = "The amount of levels boosted to send a notification at. A value of 0 will disable notification.", description = "The amount of levels boosted to display then in different color. A value of 0 will disable the feature.",
position = 6 position = 6
) )
default int boostThreshold() default int boostThreshold()
{ {
return 0; return 0;
} }
@ConfigItem(
keyName = "notifyOnBoost",
name = "Notify on boost threshold",
description = "Configures whether or not a notification will be sent for boosted stats.",
position = 7
)
default boolean notifyOnBoost()
{
return true;
}
} }

View File

@@ -209,7 +209,7 @@ public class BoostsPlugin extends Plugin
int boostThreshold = config.boostThreshold(); int boostThreshold = config.boostThreshold();
if (boostThreshold != 0) if (boostThreshold != 0 && config.notifyOnBoost())
{ {
int real = client.getRealSkillLevel(skill); int real = client.getRealSkillLevel(skill);
int lastBoost = last - real; int lastBoost = last - real;