Ignore exceptions on bulk /sell

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1462 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
snowleo 2011-05-14 10:57:55 +00:00
parent e09e75fb3c
commit 7b9606994a

View file

@ -34,18 +34,36 @@ public class Commandsell extends EssentialsCommand
{
for (ItemStack stack : user.getInventory().getContents())
{
if (stack == null || stack.getType() == Material.AIR) continue;
if (stack == null || stack.getType() == Material.AIR)
{
continue;
}
try
{
sellItem(user, stack, args, true);
}
catch (Exception e)
{
}
}
return;
}
if (args[0].equalsIgnoreCase("blocks"))
{
for (ItemStack stack : user.getInventory().getContents())
{
if (stack == null || stack.getTypeId() > 255 || stack.getType() == Material.AIR) continue;
if (stack == null || stack.getTypeId() > 255 || stack.getType() == Material.AIR)
{
continue;
}
try
{
sellItem(user, stack, args, true);
}
catch (Exception e)
{
}
}
return;
}
if (is == null)
@ -137,7 +155,7 @@ public class Commandsell extends EssentialsCommand
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)));
logger.log(Level.INFO, Util.format("itemSoldConsole", user.getDisplayName(), is.getType().toString().toLowerCase(), Util.formatCurrency(worth * amount), amount, Util.formatCurrency(worth)));
}
}