Allowed ignoring offline players.
This commit is contained in:
parent
a3a916f7d0
commit
58eedef773
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user