1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-09-02 19:22:37 +02:00

Add command option /ignore list

This commit is contained in:
snowleo
2012-10-16 01:09:10 +02:00
parent c70caf8001
commit c412a22502
2 changed files with 14 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ package net.ess3.commands;
import static net.ess3.I18n._;
import net.ess3.api.IUser;
import net.ess3.utils.Util;
public class Commandignore extends EssentialsCommand
@@ -13,8 +14,18 @@ public class Commandignore extends EssentialsCommand
{
throw new NotEnoughArgumentsException();
}
IUser player = ess.getUserMap().matchUserExcludingHidden(args[0], user.getPlayer());
IUser player;
try {
player = ess.getUserMap().matchUserExcludingHidden(args[0], user.getPlayer());
} catch(Exception e) {
if (args[0].equalsIgnoreCase("list")) {
user.sendMessage(Util.joinList(user.getData().getIgnore()));
throw new NoChargeException();
} else {
throw e;
}
}
if (user.isIgnoringPlayer(player))
{
user.setIgnoredPlayer(player, false);

View File

@@ -161,7 +161,7 @@ commands:
aliases: [ehome,homes,ehomes]
ignore:
description: Ignore other players.
usage: /<command> <player>
usage: /<command> <player|list>
aliases: [eignore]
info:
description: Shows information set by the server owner