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,13 +210,17 @@ public class TryToComplete
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.
if (!player.getUniqueId().equals(this.user.getUniqueId()))
{
User.getInstance(player).sendMessage("challenges.name-has-completed",
"[name]", this.user.getName(), "[challenge]", this.challenge.getFriendlyName());
}
}
}
}
else
{
// Item Repeat Rewards
@ -275,12 +279,16 @@ public class TryToComplete
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.
if (!player.getUniqueId().equals(this.user.getUniqueId()))
{
User.getInstance(player).sendMessage("challenges.name-has-completed-level",
"[name]", this.user.getName(), "[level]", level.getFriendlyName());
}
}
}
this.manager.setLevelComplete(this.user, level);
}