Browse Source

Make the profile loaded message optional

People will complain if we don’t
TfT_02 11 years ago
parent
commit
7d65b9422a

+ 1 - 0
src/main/java/com/gmail/nossr50/config/Config.java

@@ -232,6 +232,7 @@ public class Config extends AutoUpdateConfigLoader {
     /* General Settings */
     public String getLocale() { return config.getString("General.Locale", "en_us"); }
     public boolean getMOTDEnabled() { return config.getBoolean("General.MOTD_Enabled", true); }
+    public boolean getShowProfileLoadedMessage() { return config.getBoolean("General.Show_Profile_Loaded", true); }
     public boolean getDonateMessageEnabled() { return config.getBoolean("Commands.mcmmo.Donate_Message", true); }
     public int getSaveInterval() { return config.getInt("General.Save_Interval", 10); }
     public boolean getStatsTrackingEnabled() { return config.getBoolean("General.Stats_Tracking", true); }

+ 5 - 6
src/main/java/com/gmail/nossr50/runnables/player/PlayerProfileLoadingTask.java

@@ -46,13 +46,9 @@ public class PlayerProfileLoadingTask extends BukkitRunnable {
             return;
         }
 
-        // Send the message that we're doing the recovery
-        if (attempt == 0) {
-            player.sendMessage(LocaleLoader.getString("Profile.Loading.Start"));
-        }
-
         // Increment attempt counter and try
         attempt++;
+
         PlayerProfile profile = mcMMO.getDatabaseManager().loadPlayerProfile(player.getName(), player.getUniqueId(), true);
         // If successful, schedule the apply
         if (profile.isLoaded()) {
@@ -94,10 +90,13 @@ public class PlayerProfileLoadingTask extends BukkitRunnable {
 
             McMMOPlayer mcMMOPlayer = new McMMOPlayer(player, profile);
             UserManager.track(mcMMOPlayer);
-            player.sendMessage(LocaleLoader.getString("Profile.Loading.Success"));
             mcMMOPlayer.actualizeRespawnATS();
             ScoreboardManager.setupPlayer(player);
 
+            if (Config.getInstance().getShowProfileLoadedMessage()) {
+                player.sendMessage(LocaleLoader.getString("Profile.Loading.Success"));
+            }
+
             if (Config.getInstance().getShowStatsAfterLogin()) {
                 ScoreboardManager.enablePlayerStatsScoreboard(player);
                 new McScoreboardKeepTask(player).runTaskLater(mcMMO.p, 1 * Misc.TICK_CONVERSION_FACTOR);

+ 2 - 0
src/main/resources/config.yml

@@ -10,6 +10,8 @@
 General:
     Locale: en_US
     MOTD_Enabled: true
+    # Send a message to the player when his profile was successfully loaded
+    Show_Profile_Loaded: false
     # Amount of time (in minutes) to wait between saves of player information
     Save_Interval: 10
     # Allow mcMMO to report on basic anonymous usage

+ 1 - 2
src/main/resources/locale/locale_en_US.properties

@@ -960,7 +960,6 @@ Scoreboard.Misc.Cooldown=[[LIGHT_PURPLE]]Cooldown
 Scoreboard.Misc.Overall=[[GOLD]]Overall
 
 #DATABASE RECOVERY
-Profile.Loading.Start=[[GREEN]]Notice: mcMMO is now loading your profile. Stats and skills will not function until loaded...
-Profile.Loading.Success=[[GREEN]]Success! Your mcMMO data was loaded.
+Profile.Loading.Success=[[GREEN]]Your mcMMO profile has been loaded.
 Profile.Loading.Failure=[[RED]]mcMMO still cannot load your data. You may want to [[AQUA]]contact the server owner.\n[[YELLOW]]You can still play on the server, but you will have [[BOLD]]no mcMMO levels[[YELLOW]] and any XP you get [[BOLD]]will not be saved[[YELLOW]].
 Profile.Loading.AdminFailureNotice=[[DARK_RED]][A][[RED]] mcMMO was unable to load the player data for [[YELLOW]]{0}[[RED]]. [[LIGHT_PURPLE]]Please inspect your database setup.