Disable broadcast message for user. #62

This commit is contained in:
BONNe 2019-01-28 20:25:28 +02:00
parent 86b51df412
commit 7384afa262

View File

@ -210,10 +210,14 @@ public class TryToComplete
if (this.addon.getChallengesSettings().isBroadcastMessages()) if (this.addon.getChallengesSettings().isBroadcastMessages())
{ {
for (Player p : this.addon.getServer().getOnlinePlayers()) for (Player player : this.addon.getServer().getOnlinePlayers())
{ {
User.getInstance(p).sendMessage("challenges.name-has-completed", // Only other players should see message.
"[name]", this.user.getName(), "[challenge]", this.challenge.getFriendlyName()); if (!player.getUniqueId().equals(this.user.getUniqueId()))
{
User.getInstance(player).sendMessage("challenges.name-has-completed",
"[name]", this.user.getName(), "[challenge]", this.challenge.getFriendlyName());
}
} }
} }
} }
@ -275,10 +279,14 @@ public class TryToComplete
if (this.addon.getChallengesSettings().isBroadcastMessages()) if (this.addon.getChallengesSettings().isBroadcastMessages())
{ {
for (Player p : this.addon.getServer().getOnlinePlayers()) for (Player player : this.addon.getServer().getOnlinePlayers())
{ {
User.getInstance(p).sendMessage("challenges.name-has-completed-level", // Only other players should see message.
"[name]", this.user.getName(), "[level]", level.getFriendlyName()); if (!player.getUniqueId().equals(this.user.getUniqueId()))
{
User.getInstance(player).sendMessage("challenges.name-has-completed-level",
"[name]", this.user.getName(), "[level]", level.getFriendlyName());
}
} }
} }