diff options
author | snowleo <schneeleo@gmail.com> | 2011-08-27 16:21:29 +0200 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2011-08-27 16:21:29 +0200 |
commit | 394a786044055b8ebaba1c6046ce3de6e96ccb50 (patch) | |
tree | 89f59a32621452906e02c699d0c9d9b310956442 | |
parent | 14030deb164f82978a2778daa330a74af82309dc (diff) | |
download | Essentials-394a786044055b8ebaba1c6046ce3de6e96ccb50.tar Essentials-394a786044055b8ebaba1c6046ce3de6e96ccb50.tar.gz Essentials-394a786044055b8ebaba1c6046ce3de6e96ccb50.tar.lz Essentials-394a786044055b8ebaba1c6046ce3de6e96ccb50.tar.xz Essentials-394a786044055b8ebaba1c6046ce3de6e96ccb50.zip |
Another fix for /repair
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandrepair.java | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java b/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java index ea1d1fc9e..d41f5580f 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java @@ -103,37 +103,33 @@ public class Commandrepair extends EssentialsCommand { final String itemName = item.getType().toString().toLowerCase(); final Trade charge = new Trade("repair-" + itemName.replace('_', '-'), ess); - boolean canBeRepaired = true; try { charge.isAffordableFor(user); } catch (ChargeException ex) { - canBeRepaired = false; + user.sendMessage(ex.getMessage()); + continue; } - if (canBeRepaired) + try { - try - { - repairItem(item); - } - catch (Exception e) - { - continue; - } - try - { - charge.charge(user); - } - catch (ChargeException ex) - { - user.sendMessage(ex.getMessage()); - } - repaired.add(itemName.replace('_', ' ')); + repairItem(item); } - + catch (Exception e) + { + continue; + } + try + { + charge.charge(user); + } + catch (ChargeException ex) + { + user.sendMessage(ex.getMessage()); + } + repaired.add(itemName.replace('_', ' ')); } } } |