Don't loop, broadcast.

This commit is contained in:
GJ 2013-02-12 23:06:31 -05:00
parent 0cd8d2b333
commit 25061e7f71

View File

@ -27,10 +27,7 @@ public class XprateCommand implements CommandExecutor {
} }
if (mcMMO.p.isXPEventEnabled()) { if (mcMMO.p.isXPEventEnabled()) {
for (Player player : mcMMO.p.getServer().getOnlinePlayers()) { mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.xprate.over"));
player.sendMessage(LocaleLoader.getString("Commands.xprate.over"));
}
mcMMO.p.toggleXpEventEnabled(); mcMMO.p.toggleXpEventEnabled();
} }
@ -56,10 +53,8 @@ public class XprateCommand implements CommandExecutor {
Config.getInstance().setExperienceGainsGlobalMultiplier(newXpRate); Config.getInstance().setExperienceGainsGlobalMultiplier(newXpRate);
if (mcMMO.p.isXPEventEnabled()) { if (mcMMO.p.isXPEventEnabled()) {
for (Player player : mcMMO.p.getServer().getOnlinePlayers()) { mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.xprate.started.0"));
player.sendMessage(LocaleLoader.getString("Commands.xprate.started.0")); mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.xprate.started.1", newXpRate));
player.sendMessage(LocaleLoader.getString("Commands.xprate.started.1", newXpRate));
}
} }
else { else {
sender.sendMessage(LocaleLoader.getString("Commands.xprate.modified", newXpRate)); sender.sendMessage(LocaleLoader.getString("Commands.xprate.modified", newXpRate));