From 929e2ce4c91f46abe73eca048fd37c27c07c9fd0 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Tue, 15 Nov 2011 23:54:26 +0000 Subject: [PATCH] New permission: essentials.repair.armor If a player has this permission '/repair all' will also repair equipped armor. --- .../src/com/earth2me/essentials/commands/Commandbanip.java | 3 ++- .../src/com/earth2me/essentials/commands/Commandrepair.java | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java b/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java index 36ea479f9..eab34b122 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java @@ -31,7 +31,8 @@ public class Commandbanip extends EssentialsCommand else { final String ipAddress = u.getLastLoginAddress(); - if (ipAddress.length() == 0) { + if (ipAddress.length() == 0) + { throw new Exception(Util.i18n("playerNotFound")); } ess.getServer().banIP(u.getLastLoginAddress()); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java b/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java index d6bcad464..26882ded4 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java @@ -50,7 +50,9 @@ public class Commandrepair extends EssentialsCommand final List repaired = new ArrayList(); repairItems(user.getInventory().getContents(), user, repaired); - repairItems(user.getInventory().getArmorContents(), user, repaired); + if (user.isAuthorized("essentials.repair.armor")) { + repairItems(user.getInventory().getArmorContents(), user, repaired); + } if (repaired.isEmpty()) {