Fix worth display bug

This commit is contained in:
KHobbits 2013-07-14 12:09:49 +01:00
parent 8009c1539a
commit 0d2dea41e3
3 changed files with 11 additions and 8 deletions

View File

@ -147,7 +147,11 @@ public class ItemDb implements IConf, net.ess3.api.IItemDb
{
List<ItemStack> is = new ArrayList<ItemStack>();
if (args[0].equalsIgnoreCase("hand"))
if (args.length < 1)
{
is.add(user.getItemInHand());
}
else if (args[0].equalsIgnoreCase("hand"))
{
is.add(user.getItemInHand());
}
@ -173,14 +177,11 @@ public class ItemDb implements IConf, net.ess3.api.IItemDb
is.add(stack);
}
}
else if (args.length > 0)
else
{
is.add(get(args[0]));
}
else {
is.add(user.getItemInHand());
}
return is;
}

View File

@ -40,10 +40,11 @@ public class Commandsell extends EssentialsCommand
if (stack.getAmount() > 0)
{
totalWorth = totalWorth.add(sellItem(user, stack, args, isBulk));
stack = stack.clone();
count++;
for (ItemStack zeroStack : is)
{
if (!zeroStack.equals(stack) && zeroStack.isSimilar(stack))
if (zeroStack.isSimilar(stack))
{
zeroStack.setAmount(0);
}

View File

@ -36,10 +36,11 @@ public class Commandworth extends EssentialsCommand
if (stack.getAmount() > 0)
{
totalWorth = totalWorth.add(itemWorth(user.getBase(), user, stack, args));
stack = stack.clone();
count++;
for (ItemStack zeroStack : is)
{
if (!zeroStack.equals(stack) && zeroStack.isSimilar(stack))
if (zeroStack.isSimilar(stack))
{
zeroStack.setAmount(0);
}