summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-04-16 15:39:58 +0000
committersnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-04-16 15:39:58 +0000
commit9aea32469a78a3c85ed8f3f43587ee148258fca6 (patch)
tree327229f3c9b240ee4d3c27ec85e15446715f9c37
parent1d947652d5a9473847b161218aa5160a824741e6 (diff)
downloadEssentials-9aea32469a78a3c85ed8f3f43587ee148258fca6.tar
Essentials-9aea32469a78a3c85ed8f3f43587ee148258fca6.tar.gz
Essentials-9aea32469a78a3c85ed8f3f43587ee148258fca6.tar.lz
Essentials-9aea32469a78a3c85ed8f3f43587ee148258fca6.tar.xz
Essentials-9aea32469a78a3c85ed8f3f43587ee148258fca6.zip
[trunk] /sell hand will sell the item in hand.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1228 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandsell.java9
-rw-r--r--Essentials/src/plugin.yml2
2 files changed, 8 insertions, 3 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
index a80b28387..842d97192 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
@@ -20,10 +20,15 @@ public class Commandsell extends EssentialsCommand
public void run(Server server, Essentials parent, User user, String commandLabel, String[] args) throws Exception
{
if (args.length < 1) {
- user.sendMessage("§cUsage: /sell [itemname|id] [-][amount]");
+ user.sendMessage("§cUsage: /sell [itemname|id|hand] [-][amount]");
return;
}
- ItemStack is = ItemDb.get(args[0]);
+ ItemStack is;
+ if (args[0].equalsIgnoreCase("hand")) {
+ is = user.getItemInHand();
+ } else {
+ is = ItemDb.get(args[0]);
+ }
if(is.getType() == Material.AIR) {
throw new Exception("You really tried to sell Air? Put an item in your hand.");
}
diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml
index 400afafce..9f75ec131 100644
--- a/Essentials/src/plugin.yml
+++ b/Essentials/src/plugin.yml
@@ -177,7 +177,7 @@ commands:
usage: /<command>
sell:
description: Sells the item currently in your hand.
- usage: /<command> [itemname|id] [-][amount]
+ usage: /<command> [itemname|id|hand] [-][amount]
sethome:
description: Set your home to your current location.
usage: /<command>