Fix /premium. Fixes #1850

Add ArmorStand to list of wipeable entities
Add /whohas clear. Resolves #1836
This commit is contained in:
JeromSar
2016-10-02 23:05:03 +02:00
parent c10b08df27
commit 9fa4c0662c
3 changed files with 13 additions and 9 deletions

View File

@ -12,7 +12,7 @@ import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
@CommandParameters(description = "See who has a block and optionally smite.", usage = "/<command> <item> [smite]", aliases = "wh")
@CommandParameters(description = "See who has a block and optionally clears the item.", usage = "/<command> <item> clear", aliases = "wh")
public class Command_whohas extends FreedomCommand
{
@ -24,7 +24,7 @@ public class Command_whohas extends FreedomCommand
return false;
}
final boolean doSmite = args.length >= 2 && "smite".equalsIgnoreCase(args[1]);
final boolean doClear = args.length >= 2 && "clear".equalsIgnoreCase(args[1]);
final String materialName = args[0];
Material material = Material.matchMaterial(materialName);
@ -52,9 +52,9 @@ public class Command_whohas extends FreedomCommand
if (player.getInventory().contains(material))
{
players.add(player.getName());
if (doSmite && !plugin.al.isAdmin(player))
if (doClear && !plugin.al.isAdmin(player))
{
Command_smite.smite(player);
player.getInventory().remove(material);
}
}
}