If we've already broadcasted it to the entire server, don't log it as

double messages will appear in the console.
This commit is contained in:
graywolf336 2013-12-24 23:29:51 -06:00
parent 170fd1776f
commit c499443ff9

View File

@ -58,13 +58,15 @@ public class PrisonerManager {
else// else//
msg = pl.getJailIO().getLanguageString(LangString.BROADCASTMESSAGEFOREVER, new String[] { prisoner.getName(), String.valueOf(prisoner.getRemainingTimeInMinutes()) }); msg = pl.getJailIO().getLanguageString(LangString.BROADCASTMESSAGEFOREVER, new String[] { prisoner.getName(), String.valueOf(prisoner.getRemainingTimeInMinutes()) });
boolean broadcasted = false;
//Broadcast the message, if it is enabled //Broadcast the message, if it is enabled
if(pl.getConfig().getBoolean(Settings.BROADCASTJAILING.getPath(), false)) { if(pl.getConfig().getBoolean(Settings.BROADCASTJAILING.getPath(), false)) {
pl.getServer().broadcastMessage(msg); pl.getServer().broadcastMessage(msg);
broadcasted = true;
} }
//Log the message, if it is enabled //Log the message, if it is enabled
if(pl.getConfig().getBoolean(Settings.LOGJAILING.getPath(), true)) { if(pl.getConfig().getBoolean(Settings.LOGJAILING.getPath(), true) && !broadcasted) {
pl.getServer().getConsoleSender().sendMessage(msg); pl.getServer().getConsoleSender().sendMessage(msg);
} }
} }