summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-08-27 16:21:29 +0200
committersnowleo <schneeleo@gmail.com>2011-08-27 16:21:29 +0200
commit394a786044055b8ebaba1c6046ce3de6e96ccb50 (patch)
tree89f59a32621452906e02c699d0c9d9b310956442
parent14030deb164f82978a2778daa330a74af82309dc (diff)
downloadEssentials-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.java38
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('_', ' '));
}
}
}