summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);
}