Using qop should now only op those who are not op.

This will further reduce the amount of spam and doesn't spam everyone with "you are now op".
This commit is contained in:
Ryan 2014-08-14 22:32:45 +01:00
parent a1c11f4e0f
commit 9a2dc52e87

View File

@ -34,16 +34,21 @@ public class Command_qop extends TFM_Command
{
if (player.getName().toLowerCase().contains(targetName) || player.getDisplayName().toLowerCase().contains(targetName))
{
matchedPlayerNames.add(player.getName());
player.setOp(true);
player.sendMessage(TotalFreedomMod.YOU_ARE_OP);
if (!player.isOp())
{
matchedPlayerNames.add(player.getName());
player.setOp(true);
player.sendMessage(TotalFreedomMod.YOU_ARE_OP);
}
}
}
if (!matchedPlayerNames.isEmpty())
{
if (!silent)
{
TFM_Util.adminAction(sender.getName(), "Opping " + StringUtils.join(matchedPlayerNames, ", "), false);
}
}