2
0
Эх сурвалжийг харах

more work on notifications config

nossr50 6 жил өмнө
parent
commit
51291f7c49

+ 0 - 5
src/main/java/com/gmail/nossr50/config/AdvancedConfig.java

@@ -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.

+ 17 - 0
src/main/java/com/gmail/nossr50/config/hocon/notifications/ConfigNotificationGeneral.java

@@ -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;
+    }
+}

+ 11 - 0
src/main/java/com/gmail/nossr50/config/hocon/notifications/ConfigNotifications.java

@@ -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;
+    }
 }
 }

+ 1 - 1
src/main/java/com/gmail/nossr50/mcMMO.java

@@ -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));
         }
         }