summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorementalo <ementalo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-04 23:33:32 +0000
committerementalo <ementalo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-04 23:33:32 +0000
commit5d80a0e1c724eeec23c43a14c7cee6919b1278af (patch)
treedbfa042d8bc476a91a793957951864c80c845319
parent04c1e42d10f1fde05c7d38e1577478dc95728ae2 (diff)
downloadEssentials-5d80a0e1c724eeec23c43a14c7cee6919b1278af.tar
Essentials-5d80a0e1c724eeec23c43a14c7cee6919b1278af.tar.gz
Essentials-5d80a0e1c724eeec23c43a14c7cee6919b1278af.tar.lz
Essentials-5d80a0e1c724eeec23c43a14c7cee6919b1278af.tar.xz
Essentials-5d80a0e1c724eeec23c43a14c7cee6919b1278af.zip
[trunk] /sell inventory, /sell blocks fixes
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1345 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandsell.java10
-rw-r--r--Essentials/src/plugin.yml2
2 files changed, 5 insertions, 7 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
index a9e98cddc..64c7a27e7 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
@@ -23,18 +23,16 @@ public class Commandsell extends EssentialsCommand
{
throw new NotEnoughArgumentsException();
}
- ItemStack is;
- ItemStack[] isArray;
+ ItemStack is = null;
if (args[0].equalsIgnoreCase("hand"))
{
is = user.getItemInHand();
-
}
if (args[0].equalsIgnoreCase("inventory"))
{
for (ItemStack stack : user.getInventory().getContents())
{
- if(stack.getType() == Material.AIR) continue;
+ if (stack == null || stack.getType() == Material.AIR) continue;
sellItem(user, stack, args);
}
return;
@@ -43,12 +41,12 @@ public class Commandsell extends EssentialsCommand
{
for (ItemStack stack : user.getInventory().getContents())
{
- if (stack.getTypeId() > 255 || stack.getType() == Material.AIR) continue;
+ if (stack == null || stack.getTypeId() > 255 || stack.getType() == Material.AIR) continue;
sellItem(user, stack, args);
}
return;
}
- else
+ if (is == null)
{
is = ItemDb.get(args[0]);
}
diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml
index dcbddc706..468540769 100644
--- a/Essentials/src/plugin.yml
+++ b/Essentials/src/plugin.yml
@@ -208,7 +208,7 @@ commands:
usage: /<command> [playername]
sell:
description: Sells the item currently in your hand.
- usage: /<command> [itemname|id|hand] [-][amount]
+ usage: /<command> [itemname|id|hand|inventory|blocks] [-][amount]
aliases: [esell]
sethome:
description: Set your home to your current location.