summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2013-07-14 12:09:49 +0100
committerKHobbits <rob@khobbits.co.uk>2013-07-14 12:09:49 +0100
commit0d2dea41e3da531fcf14c0fef7df1605bf9066eb (patch)
treef17a383853373050fc710856eb585065cbc1ca68
parent8009c1539a3def75281ac33c2590f7741965b191 (diff)
downloadEssentials-0d2dea41e3da531fcf14c0fef7df1605bf9066eb.tar
Essentials-0d2dea41e3da531fcf14c0fef7df1605bf9066eb.tar.gz
Essentials-0d2dea41e3da531fcf14c0fef7df1605bf9066eb.tar.lz
Essentials-0d2dea41e3da531fcf14c0fef7df1605bf9066eb.tar.xz
Essentials-0d2dea41e3da531fcf14c0fef7df1605bf9066eb.zip
Fix worth display bug
-rw-r--r--Essentials/src/com/earth2me/essentials/ItemDb.java13
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandsell.java3
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandworth.java3
3 files changed, 11 insertions, 8 deletions
diff --git a/Essentials/src/com/earth2me/essentials/ItemDb.java b/Essentials/src/com/earth2me/essentials/ItemDb.java
index 83a3b0686..6a7af9b7d 100644
--- a/Essentials/src/com/earth2me/essentials/ItemDb.java
+++ b/Essentials/src/com/earth2me/essentials/ItemDb.java
@@ -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;
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
index 773e94b68..386aac603 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
@@ -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);
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandworth.java b/Essentials/src/com/earth2me/essentials/commands/Commandworth.java
index 45ff23c9b..bc832a44b 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandworth.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandworth.java
@@ -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);
}