mirror of
https://github.com/essentials/Essentials.git
synced 2025-09-03 03:32:42 +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 static net.ess3.I18n._;
|
||||||
import net.ess3.api.IUser;
|
import net.ess3.api.IUser;
|
||||||
|
import net.ess3.utils.Util;
|
||||||
|
|
||||||
|
|
||||||
public class Commandignore extends EssentialsCommand
|
public class Commandignore extends EssentialsCommand
|
||||||
@@ -13,8 +14,18 @@ public class Commandignore extends EssentialsCommand
|
|||||||
{
|
{
|
||||||
throw new NotEnoughArgumentsException();
|
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))
|
if (user.isIgnoringPlayer(player))
|
||||||
{
|
{
|
||||||
user.setIgnoredPlayer(player, false);
|
user.setIgnoredPlayer(player, false);
|
||||||
|
@@ -161,7 +161,7 @@ commands:
|
|||||||
aliases: [ehome,homes,ehomes]
|
aliases: [ehome,homes,ehomes]
|
||||||
ignore:
|
ignore:
|
||||||
description: Ignore other players.
|
description: Ignore other players.
|
||||||
usage: /<command> <player>
|
usage: /<command> <player|list>
|
||||||
aliases: [eignore]
|
aliases: [eignore]
|
||||||
info:
|
info:
|
||||||
description: Shows information set by the server owner
|
description: Shows information set by the server owner
|
||||||
|
Reference in New Issue
Block a user