Add toggle for event broadcasts - General.EventBroadcasts

This commit is contained in:
nossr50
2019-05-16 11:34:26 -07:00
parent ed3ec3aa40
commit c8a32b8b38
4 changed files with 19 additions and 4 deletions

View File

@ -1,6 +1,7 @@
package com.gmail.nossr50.commands;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
@ -44,8 +45,12 @@ public class XprateCommand implements TabExecutor {
10, 10*20, 20);
}
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.Event.Stop"));
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.Event.Stop.Subtitle"));
if(Config.getInstance().broadcastEventMessages())
{
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.Event.Stop"));
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.Event.Stop.Subtitle"));
}
mcMMO.p.toggleXpEventEnabled();
}
@ -91,8 +96,13 @@ public class XprateCommand implements TabExecutor {
LocaleLoader.getString("Commands.Event.XP", newXpRate),
10, 10*20, 20);
}
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.Event.Start"));
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.Event.XP", newXpRate));
if(Config.getInstance().broadcastEventMessages())
{
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.Event.Start"));
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.Event.XP", newXpRate));
}
}
else {
sender.sendMessage(LocaleLoader.getString("Commands.xprate.modified", newXpRate));

View File

@ -567,4 +567,6 @@ public class Config extends AutoUpdateConfigLoader {
public boolean getPVEEnabled(PrimarySkillType skill) { return config.getBoolean("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Enabled_For_PVE", true); }
//public float getMasterVolume() { return (float) config.getDouble("Sounds.MasterVolume", 1.0); }
public boolean broadcastEventMessages() { return config.getBoolean("General.EventBroadcasts", true);}
}

View File

@ -16,6 +16,7 @@ General:
Locale: en_US
AprilFoolsEvent: true
MOTD_Enabled: true
EventBroadcasts: 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