Allowed ignoring offline players.

This commit is contained in:
ryanhamshire 2015-10-12 16:15:59 -07:00
parent a3a916f7d0
commit 58eedef773
2 changed files with 21 additions and 23 deletions

View File

@ -2141,17 +2141,12 @@ public class GriefPrevention extends JavaPlugin
if(args.length < 1) return false;
//validate target player
Player targetPlayer = this.getServer().getPlayer(args[0]);
OfflinePlayer targetPlayer = this.resolvePlayerByName(args[0]);
if(targetPlayer == null)
{
GriefPrevention.sendMessage(player, TextMode.Err, Messages.PlayerNotFound2);
return true;
}
else if(targetPlayer.hasPermission("griefprevention.notignorable"))
{
GriefPrevention.sendMessage(player, TextMode.Err, Messages.PlayerNotIgnorable);
return true;
}
this.setIgnoreStatus(player, targetPlayer, IgnoreMode.StandardIgnore);

View File

@ -178,25 +178,28 @@ class PlayerEventHandler implements Listener
makeSocialLogEntry(player.getName(), message);
//based on ignore lists, remove some of the audience
Set<Player> recipientsToRemove = new HashSet<Player>();
PlayerData playerData = this.dataStore.getPlayerData(player.getUniqueId());
for(Player recipient : recipients)
if(!player.hasPermission("griefprevention.notignorable"))
{
if(playerData.ignoredPlayers.containsKey(recipient.getUniqueId()))
{
recipientsToRemove.add(recipient);
}
else
{
PlayerData targetPlayerData = this.dataStore.getPlayerData(recipient.getUniqueId());
if(targetPlayerData.ignoredPlayers.containsKey(player.getUniqueId()))
{
recipientsToRemove.add(recipient);
}
}
Set<Player> recipientsToRemove = new HashSet<Player>();
PlayerData playerData = this.dataStore.getPlayerData(player.getUniqueId());
for(Player recipient : recipients)
{
if(playerData.ignoredPlayers.containsKey(recipient.getUniqueId()))
{
recipientsToRemove.add(recipient);
}
else
{
PlayerData targetPlayerData = this.dataStore.getPlayerData(recipient.getUniqueId());
if(targetPlayerData.ignoredPlayers.containsKey(player.getUniqueId()))
{
recipientsToRemove.add(recipient);
}
}
}
recipients.removeAll(recipientsToRemove);
}
recipients.removeAll(recipientsToRemove);
}
}