From 734dfcdec55b26097de0819f11720fab2c14621b Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 16 May 2019 11:40:47 -0700 Subject: [PATCH] Add toggle to disable event information on player join --- Changelog.txt | 1 + src/main/java/com/gmail/nossr50/config/Config.java | 1 + src/main/java/com/gmail/nossr50/listeners/PlayerListener.java | 2 +- src/main/resources/config.yml | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index 5402b7286..4d0e79b79 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -2,6 +2,7 @@ Version 2.1.61 Fixed the locale string formatting of 'Mining.SubSkill.DoubleDrops.Stat' Updated the Japanese locale (thanks snake0053) Added toggle to turn off event message broadcasts (XP rate) to config.yml - 'General.EventBroadcasts' + Added toggle to not inform players of events when they join (XP rate, etc) to config.yml 'General.EventInfoOnPlayerJoin' NOTE: The toggle for event message broadcasts is separate from the titles being shown, that's another config option (titles are the BIG TEXT in the middle of the screen) diff --git a/src/main/java/com/gmail/nossr50/config/Config.java b/src/main/java/com/gmail/nossr50/config/Config.java index 70742ff54..096c76d91 100644 --- a/src/main/java/com/gmail/nossr50/config/Config.java +++ b/src/main/java/com/gmail/nossr50/config/Config.java @@ -569,4 +569,5 @@ public class Config extends AutoUpdateConfigLoader { //public float getMasterVolume() { return (float) config.getDouble("Sounds.MasterVolume", 1.0); } public boolean broadcastEventMessages() { return config.getBoolean("General.EventBroadcasts", true);} + public boolean playerJoinEventInfo() { return config.getBoolean("General.EventInfoOnPlayerJoin", true);} } diff --git a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index 7f8c447ad..9630db029 100644 --- a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -529,7 +529,7 @@ public class PlayerListener implements Listener { Motd.displayAll(player); } - if (plugin.isXPEventEnabled()) { + if (plugin.isXPEventEnabled() && Config.getInstance().playerJoinEventInfo()) { player.sendMessage(LocaleLoader.getString("XPRate.Event", ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier())); } } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 611bc6261..7080c7133 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -17,6 +17,7 @@ General: AprilFoolsEvent: true MOTD_Enabled: true EventBroadcasts: true + EventInfoOnPlayerJoin: 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