more work on notifications config

This commit is contained in:
nossr50 2019-04-04 19:53:06 -07:00
parent 4068d61246
commit 51291f7c49
4 changed files with 29 additions and 6 deletions

View File

@ -495,11 +495,6 @@ public class AdvancedConfig extends ConfigValidated {
} }
/* GENERAL */ /* GENERAL */
public int getStartingLevel() { return getIntValue(SKILLS, GENERAL, STARTING_LEVEL); }
public boolean allowPlayerTips() {
return config.getBoolean("Feedback.PlayerTips", true);
}
/** /**
* This returns the maximum level at which superabilities will stop lengthening from scaling alongside skill level. * This returns the maximum level at which superabilities will stop lengthening from scaling alongside skill level.

View File

@ -0,0 +1,17 @@
package com.gmail.nossr50.config.hocon.notifications;
import ninja.leaping.configurate.objectmapping.Setting;
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
@ConfigSerializable
public class ConfigNotificationGeneral {
public static final boolean PLAYER_TIPS_DEFAULT = true;
@Setting(value = "Player-Tips", comment = "Allows mcMMO to send players automated helpful tips." +
"\n Default value: "+PLAYER_TIPS_DEFAULT)
public boolean playerTips = PLAYER_TIPS_DEFAULT;
public boolean isPlayerTips() {
return playerTips;
}
}

View File

@ -19,4 +19,15 @@ public class ConfigNotifications {
@Setting(value = "Action-Bar-Notifications", comment = "Settings related to action bar messages." + @Setting(value = "Action-Bar-Notifications", comment = "Settings related to action bar messages." +
"\nThe action bar is the area above your health and armor.") "\nThe action bar is the area above your health and armor.")
public ConfigActionBarNotifications actionBarNotifications = new ConfigActionBarNotifications(); public ConfigActionBarNotifications actionBarNotifications = new ConfigActionBarNotifications();
@Setting(value = "General", comment = "General settings for Notifications")
public ConfigNotificationGeneral configNotificationGeneral = new ConfigNotificationGeneral();
public ConfigActionBarNotifications getActionBarNotifications() {
return actionBarNotifications;
}
public ConfigNotificationGeneral getConfigNotificationGeneral() {
return configNotificationGeneral;
}
} }

View File

@ -594,7 +594,7 @@ public class mcMMO extends JavaPlugin {
new ClearRegisteredXPGainTask().runTaskTimer(this, 60, 60); new ClearRegisteredXPGainTask().runTaskTimer(this, 60, 60);
} }
if(AdvancedConfig.getInstance().allowPlayerTips()) if(configManager.getConfigNotifications().getConfigNotificationGeneral().isPlayerTips())
{ {
new NotifySquelchReminderTask().runTaskTimer(this, 60, ((20 * 60) * 60)); new NotifySquelchReminderTask().runTaskTimer(this, 60, ((20 * 60) * 60));
} }