diff options
author | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-14 10:57:55 +0000 |
---|---|---|
committer | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-14 10:57:55 +0000 |
commit | 7b9606994abb1b71dff17a697d2e4eb999485b5d (patch) | |
tree | 67c7a567731c0219368e657a1efd6f6186f3468e | |
parent | e09e75fb3c9e196b1e74b06b2495b18b08aff182 (diff) | |
download | Essentials-7b9606994abb1b71dff17a697d2e4eb999485b5d.tar Essentials-7b9606994abb1b71dff17a697d2e4eb999485b5d.tar.gz Essentials-7b9606994abb1b71dff17a697d2e4eb999485b5d.tar.lz Essentials-7b9606994abb1b71dff17a697d2e4eb999485b5d.tar.xz Essentials-7b9606994abb1b71dff17a697d2e4eb999485b5d.zip |
Ignore exceptions on bulk /sell
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1462 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandsell.java | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java index b0761515b..f23a415af 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java @@ -34,8 +34,17 @@ public class Commandsell extends EssentialsCommand { for (ItemStack stack : user.getInventory().getContents()) { - if (stack == null || stack.getType() == Material.AIR) continue; - sellItem(user, stack, args, true); + if (stack == null || stack.getType() == Material.AIR) + { + continue; + } + try + { + sellItem(user, stack, args, true); + } + catch (Exception e) + { + } } return; } @@ -43,8 +52,17 @@ public class Commandsell extends EssentialsCommand { for (ItemStack stack : user.getInventory().getContents()) { - if (stack == null || stack.getTypeId() > 255 || stack.getType() == Material.AIR) continue; - sellItem(user, stack, args, true); + if (stack == null || stack.getTypeId() > 255 || stack.getType() == Material.AIR) + { + continue; + } + try + { + sellItem(user, stack, args, true); + } + catch (Exception e) + { + } } return; } @@ -136,8 +154,8 @@ public class Commandsell extends EssentialsCommand InventoryWorkaround.removeItem(user.getInventory(), true, new ItemStack(is.getType(), amount, is.getDurability())); user.updateInventory(); user.giveMoney(worth * amount); - user.sendMessage(Util.format("itemSold", Util.formatCurrency(worth * amount), amount, Util.formatCurrency(worth))); - logger.log(Level.INFO, Util.format("itemSoldConsole",user.getDisplayName(),is.getType().toString().toLowerCase(), Util.formatCurrency(worth * amount), amount, Util.formatCurrency(worth))); - + user.sendMessage(Util.format("itemSold", Util.formatCurrency(worth * amount), amount, Util.formatCurrency(worth))); + logger.log(Level.INFO, Util.format("itemSoldConsole", user.getDisplayName(), is.getType().toString().toLowerCase(), Util.formatCurrency(worth * amount), amount, Util.formatCurrency(worth))); + } } |