mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-18 00:25:32 +01:00
Fix worth display bug
This commit is contained in:
parent
8009c1539a
commit
0d2dea41e3
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user