mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-11-19 01:40:00 +00:00
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:
parent
e09e75fb3c
commit
7b9606994a
1 changed files with 25 additions and 7 deletions
|
@ -34,8 +34,17 @@ public class Commandsell extends EssentialsCommand
|
||||||
{
|
{
|
||||||
for (ItemStack stack : user.getInventory().getContents())
|
for (ItemStack stack : user.getInventory().getContents())
|
||||||
{
|
{
|
||||||
if (stack == null || stack.getType() == Material.AIR) continue;
|
if (stack == null || stack.getType() == Material.AIR)
|
||||||
sellItem(user, stack, args, true);
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
sellItem(user, stack, args, true);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -43,8 +52,17 @@ public class Commandsell extends EssentialsCommand
|
||||||
{
|
{
|
||||||
for (ItemStack stack : user.getInventory().getContents())
|
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)
|
||||||
sellItem(user, stack, args, true);
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
sellItem(user, stack, args, true);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -136,8 +154,8 @@ public class Commandsell extends EssentialsCommand
|
||||||
InventoryWorkaround.removeItem(user.getInventory(), true, new ItemStack(is.getType(), amount, is.getDurability()));
|
InventoryWorkaround.removeItem(user.getInventory(), true, new ItemStack(is.getType(), amount, is.getDurability()));
|
||||||
user.updateInventory();
|
user.updateInventory();
|
||||||
user.giveMoney(worth * amount);
|
user.giveMoney(worth * amount);
|
||||||
user.sendMessage(Util.format("itemSold", 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)));
|
logger.log(Level.INFO, Util.format("itemSoldConsole", user.getDisplayName(), is.getType().toString().toLowerCase(), Util.formatCurrency(worth * amount), amount, Util.formatCurrency(worth)));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue