浏览代码

MOTD Config

nossr50 6 年之前
父节点
当前提交
04fdd3270a

+ 13 - 1
Changelog.txt

@@ -10,14 +10,21 @@ Key:
 Version 2.2.0
 Version 2.2.0
     mcMMO's config system has been rewritten
     mcMMO's config system has been rewritten
     Many config files are now generated on demand instead of being copied from within the JAR
     Many config files are now generated on demand instead of being copied from within the JAR
-    All config nodes that used to be styled with CamelCase now use hyphens (-) as spaces for readability and consistency
+    All config nodes that used to be styled with CamelCase or otherwise now use hyphens (-) as spaces for readability and consistency
     All config nodes will now use Capital letters at the start of each nodes name and after each hyphen (-)
     All config nodes will now use Capital letters at the start of each nodes name and after each hyphen (-)
     All config nodes now include a comment with the default value of the node to use as reference
     All config nodes now include a comment with the default value of the node to use as reference
     Expanded settings relating to purging users who have not leveled or users who had not logged in for many months
     Expanded settings relating to purging users who have not leveled or users who had not logged in for many months
     NOTE: Not every config key that was renamed will be listed here
     NOTE: Not every config key that was renamed will be listed here
+
+    Bug Fixes
     Fixed a bug where players who started at level 1 would not be purged from the DB for being "powerless"
     Fixed a bug where players who started at level 1 would not be purged from the DB for being "powerless"
     Fixed a potential bug where players could be awarded XP for cancelled tame events
     Fixed a potential bug where players could be awarded XP for cancelled tame events
 
 
+    Config Changes
+
+    MOTD (Message of the day) config options will now be found in "motd.conf"
+    MOTD's "MOTD_Enabled" renamed -> "Show-MOTD-On-Player-Join"
+
     Exploit related config options will now be found in "exploit-prevention"
     Exploit related config options will now be found in "exploit-prevention"
     Exploit Prevention's "EndermanEndermiteFarms" renamed -> "Endermen-Endermite-Fix"
     Exploit Prevention's "EndermanEndermiteFarms" renamed -> "Endermen-Endermite-Fix"
     Added toggle for pistons marking natural blocks as unnatural after being moved to prevent afk stone farms
     Added toggle for pistons marking natural blocks as unnatural after being moved to prevent afk stone farms
@@ -72,6 +79,11 @@ Version 2.2.0
     Giga Drill Breaker will now break "diggable" blocks even if they have no configured treasures
     Giga Drill Breaker will now break "diggable" blocks even if they have no configured treasures
     removed child.yml, child skills now have hard coded parents
     removed child.yml, child skills now have hard coded parents
     removed the hardcore and vampirism commands, these are dangerous settings and should not be toggle-able (turn them on in your configs if you want to use them)
     removed the hardcore and vampirism commands, these are dangerous settings and should not be toggle-able (turn them on in your configs if you want to use them)
+
+    Removed the following config settings from various configs for literally doing nothing
+    Update_Check, Prefer_Beta
+
+    API Changes
     Added API method to grab the level cap of a skill by its PrimarySkillType ENUM definition
     Added API method to grab the level cap of a skill by its PrimarySkillType ENUM definition
     Added API method to check if a skill was being level capped
     Added API method to check if a skill was being level capped
 
 

+ 7 - 0
src/main/java/com/gmail/nossr50/config/ConfigManager.java

@@ -6,6 +6,7 @@ import com.gmail.nossr50.config.experience.ExperienceConfig;
 import com.gmail.nossr50.config.hocon.SerializedConfigLoader;
 import com.gmail.nossr50.config.hocon.SerializedConfigLoader;
 import com.gmail.nossr50.config.hocon.antiexploit.ConfigExploitPrevention;
 import com.gmail.nossr50.config.hocon.antiexploit.ConfigExploitPrevention;
 import com.gmail.nossr50.config.hocon.database.ConfigDatabase;
 import com.gmail.nossr50.config.hocon.database.ConfigDatabase;
+import com.gmail.nossr50.config.hocon.motd.ConfigMOTD;
 import com.gmail.nossr50.config.hocon.playerleveling.ConfigLeveling;
 import com.gmail.nossr50.config.hocon.playerleveling.ConfigLeveling;
 import com.gmail.nossr50.config.hocon.scoreboard.ConfigScoreboard;
 import com.gmail.nossr50.config.hocon.scoreboard.ConfigScoreboard;
 import com.gmail.nossr50.config.hocon.worldblacklist.ConfigWorldBlacklist;
 import com.gmail.nossr50.config.hocon.worldblacklist.ConfigWorldBlacklist;
@@ -69,6 +70,7 @@ public final class ConfigManager {
     private SerializedConfigLoader<ConfigLeveling> configLeveling;
     private SerializedConfigLoader<ConfigLeveling> configLeveling;
     private SerializedConfigLoader<ConfigWorldBlacklist> configWorldBlacklist;
     private SerializedConfigLoader<ConfigWorldBlacklist> configWorldBlacklist;
     private SerializedConfigLoader<ConfigExploitPrevention> configExploitPrevention;
     private SerializedConfigLoader<ConfigExploitPrevention> configExploitPrevention;
+    private SerializedConfigLoader<ConfigMOTD> configMOTD;
     private MainConfig mainConfig;
     private MainConfig mainConfig;
     private FishingTreasureConfig fishingTreasureConfig;
     private FishingTreasureConfig fishingTreasureConfig;
     private ExcavationTreasureConfig excavationTreasureConfig;
     private ExcavationTreasureConfig excavationTreasureConfig;
@@ -105,6 +107,7 @@ public final class ConfigManager {
         configLeveling = new SerializedConfigLoader<>(ConfigLeveling.class, "player_leveling.conf", null);
         configLeveling = new SerializedConfigLoader<>(ConfigLeveling.class, "player_leveling.conf", null);
         configWorldBlacklist = new SerializedConfigLoader<>(ConfigWorldBlacklist.class, "world_blacklist.conf", null);
         configWorldBlacklist = new SerializedConfigLoader<>(ConfigWorldBlacklist.class, "world_blacklist.conf", null);
         configExploitPrevention = new SerializedConfigLoader<>(ConfigExploitPrevention.class, "exploit_prevention.conf", null);
         configExploitPrevention = new SerializedConfigLoader<>(ConfigExploitPrevention.class, "exploit_prevention.conf", null);
+        configMOTD = new SerializedConfigLoader<>(ConfigMOTD.class, "message_of_the_day.conf", null);
 
 
         mainConfig = new MainConfig();
         mainConfig = new MainConfig();
 
 
@@ -334,4 +337,8 @@ public final class ConfigManager {
     public ConfigExploitPrevention getConfigExploitPrevention() {
     public ConfigExploitPrevention getConfigExploitPrevention() {
         return configExploitPrevention.getConfig();
         return configExploitPrevention.getConfig();
     }
     }
+
+    public ConfigMOTD getConfigMOTD() {
+        return configMOTD.getConfig();
+    }
 }
 }

+ 20 - 0
src/main/java/com/gmail/nossr50/config/hocon/motd/ConfigMOTD.java

@@ -0,0 +1,20 @@
+package com.gmail.nossr50.config.hocon.motd;
+
+import ninja.leaping.configurate.objectmapping.Setting;
+import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
+
+@ConfigSerializable
+public class ConfigMOTD {
+    private static final boolean ENABLE_MOTD_DEFAULT = true;
+
+    @Setting(value = "Show-MOTD-On-Player-Join", comment = "Show players who connect to the server the MOTD from mcMMO" +
+            "\nHistorically this message is literally just telling players that the server runs mcMMO." +
+            "\nSometimes the MOTD includes warnings about build stability if using a volatile dev build." +
+            "\nIf you wish to edit the MOTD, that is done in the locale files inside the JAR." +
+            "\nDefault value: "+ENABLE_MOTD_DEFAULT)
+    private boolean enableMOTD = ENABLE_MOTD_DEFAULT;
+
+    public boolean isEnableMOTD() {
+        return enableMOTD;
+    }
+}