diff options
author | KHobbits <rob@khobbits.co.uk> | 2011-08-20 21:58:55 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2011-08-20 21:58:55 +0100 |
commit | 5a1ea7701987ba5adc7dabf6820b3932f711c057 (patch) | |
tree | bd95fc2e40d0c0fbef2151425805005e8001f35c | |
parent | 83fc7de01a5a54182061681ee2f59a957e0da112 (diff) | |
parent | d14f278ecf7e6a4f3c851a8b28a052d15d47771b (diff) | |
download | Essentials-5a1ea7701987ba5adc7dabf6820b3932f711c057.tar Essentials-5a1ea7701987ba5adc7dabf6820b3932f711c057.tar.gz Essentials-5a1ea7701987ba5adc7dabf6820b3932f711c057.tar.lz Essentials-5a1ea7701987ba5adc7dabf6820b3932f711c057.tar.xz Essentials-5a1ea7701987ba5adc7dabf6820b3932f711c057.zip |
Merge branch 'master' of github.com:khobbits/Essentials
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandrepair.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java b/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java index a388f92d2..e98deeab7 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java @@ -45,22 +45,23 @@ public class Commandrepair extends EssentialsCommand } String itemName = item.getType().toString().toLowerCase().replace('_', ' '); + charge(user); user.sendMessage(Util.format("repair", itemName)); } else if (args[0].equalsIgnoreCase("all")) { StringBuilder itemList = new StringBuilder(); itemList.append(repairItems(user.getInventory().getContents())); - + String armor = repairItems(user.getInventory().getArmorContents()); - - if(armor.length() > 0) + + if (armor.length() > 0) { - if(itemList.length() > 0) + if (itemList.length() > 0) { itemList.append(", "); } - + itemList.append(armor); } @@ -70,6 +71,7 @@ public class Commandrepair extends EssentialsCommand } else { + charge(user); user.sendMessage(Util.format("repair", itemList.toString())); } @@ -88,15 +90,15 @@ public class Commandrepair extends EssentialsCommand { throw new Exception(Util.i18n("repairInvalidType")); } - + if (item.getDurability() == 0) { throw new Exception(Util.i18n("repairAlreadyFixed")); } - + item.setDurability((short)0); } - + private String repairItems(ItemStack[] items) { StringBuilder itemList = new StringBuilder(); |