summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2013-05-04 16:06:06 +0100
committerKHobbits <rob@khobbits.co.uk>2013-05-04 16:06:06 +0100
commitcdbdb5e8e93467150dc28b751d0bf379a63c0cf5 (patch)
tree64bc7d7bda99a8866b46e7cfa3d81a7e49e3633c
parent6e20275cc7f82fddb6f942ff893a5b0dc76a233c (diff)
downloadEssentials-cdbdb5e8e93467150dc28b751d0bf379a63c0cf5.tar
Essentials-cdbdb5e8e93467150dc28b751d0bf379a63c0cf5.tar.gz
Essentials-cdbdb5e8e93467150dc28b751d0bf379a63c0cf5.tar.lz
Essentials-cdbdb5e8e93467150dc28b751d0bf379a63c0cf5.tar.xz
Essentials-cdbdb5e8e93467150dc28b751d0bf379a63c0cf5.zip
[Permission] Add essentials.repair.all permission, which is required to unlock /repair all
Also make it to /repair defaults to hand.
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandrepair.java8
-rw-r--r--Essentials/src/plugin.yml4
2 files changed, 3 insertions, 9 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java b/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java
index 708e53586..54452a600 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java
@@ -20,12 +20,7 @@ public class Commandrepair extends EssentialsCommand
@Override
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
- if (args.length < 1)
- {
- throw new NotEnoughArgumentsException();
- }
-
- if (args[0].equalsIgnoreCase("hand"))
+ if (args.length < 1 || args[0].equalsIgnoreCase("hand") || !user.isAuthorized("essentials.repair.all"))
{
final ItemStack item = user.getItemInHand();
if (item == null || item.getType().isBlock() || item.getDurability() == 0)
@@ -72,7 +67,6 @@ public class Commandrepair extends EssentialsCommand
user.sendMessage(_("repair", Util.joinList(repaired)));
}
charge.charge(user);
-
}
else
{
diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml
index 0a164234d..c315098c2 100644
--- a/Essentials/src/plugin.yml
+++ b/Essentials/src/plugin.yml
@@ -303,8 +303,8 @@ commands:
usage: /<command> <drops|arrows|boats|minecarts|xp|paintings> [radius] [world]
aliases: [eremove]
repair:
- description: Repairs the durability of all or one item.
- usage: /<command> <hand|all>
+ description: Repairs the durability of one or all items.
+ usage: /<command> [hand|all]
aliases: [fix,efix,erepair]
rules:
description: Views the server rules.