From c499443ff90547a141780bf0296dc60ebeaa38c4 Mon Sep 17 00:00:00 2001 From: graywolf336 Date: Tue, 24 Dec 2013 23:29:51 -0600 Subject: [PATCH] If we've already broadcasted it to the entire server, don't log it as double messages will appear in the console. --- src/main/java/com/graywolf336/jail/PrisonerManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/graywolf336/jail/PrisonerManager.java b/src/main/java/com/graywolf336/jail/PrisonerManager.java index 8ad8ad3..b47a854 100644 --- a/src/main/java/com/graywolf336/jail/PrisonerManager.java +++ b/src/main/java/com/graywolf336/jail/PrisonerManager.java @@ -58,13 +58,15 @@ public class PrisonerManager { else// msg = pl.getJailIO().getLanguageString(LangString.BROADCASTMESSAGEFOREVER, new String[] { prisoner.getName(), String.valueOf(prisoner.getRemainingTimeInMinutes()) }); + boolean broadcasted = false; //Broadcast the message, if it is enabled if(pl.getConfig().getBoolean(Settings.BROADCASTJAILING.getPath(), false)) { pl.getServer().broadcastMessage(msg); + broadcasted = true; } //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); } }