mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 04:20:41 +00:00
[Permission] Add essentials.repair.all permission, which is required to unlock /repair all
Also make it to /repair defaults to hand.
This commit is contained in:
parent
6e20275cc7
commit
cdbdb5e8e9
2 changed files with 3 additions and 9 deletions
|
@ -20,12 +20,7 @@ public class Commandrepair extends EssentialsCommand
|
||||||
@Override
|
@Override
|
||||||
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
||||||
{
|
{
|
||||||
if (args.length < 1)
|
if (args.length < 1 || args[0].equalsIgnoreCase("hand") || !user.isAuthorized("essentials.repair.all"))
|
||||||
{
|
|
||||||
throw new NotEnoughArgumentsException();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (args[0].equalsIgnoreCase("hand"))
|
|
||||||
{
|
{
|
||||||
final ItemStack item = user.getItemInHand();
|
final ItemStack item = user.getItemInHand();
|
||||||
if (item == null || item.getType().isBlock() || item.getDurability() == 0)
|
if (item == null || item.getType().isBlock() || item.getDurability() == 0)
|
||||||
|
@ -72,7 +67,6 @@ public class Commandrepair extends EssentialsCommand
|
||||||
user.sendMessage(_("repair", Util.joinList(repaired)));
|
user.sendMessage(_("repair", Util.joinList(repaired)));
|
||||||
}
|
}
|
||||||
charge.charge(user);
|
charge.charge(user);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -303,8 +303,8 @@ commands:
|
||||||
usage: /<command> <drops|arrows|boats|minecarts|xp|paintings> [radius] [world]
|
usage: /<command> <drops|arrows|boats|minecarts|xp|paintings> [radius] [world]
|
||||||
aliases: [eremove]
|
aliases: [eremove]
|
||||||
repair:
|
repair:
|
||||||
description: Repairs the durability of all or one item.
|
description: Repairs the durability of one or all items.
|
||||||
usage: /<command> <hand|all>
|
usage: /<command> [hand|all]
|
||||||
aliases: [fix,efix,erepair]
|
aliases: [fix,efix,erepair]
|
||||||
rules:
|
rules:
|
||||||
description: Views the server rules.
|
description: Views the server rules.
|
||||||
|
|
Loading…
Reference in a new issue