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:
@@ -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);
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user