mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-12 09:35:26 +02:00
[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
This commit is contained in:
@@ -20,10 +20,15 @@ public class Commandsell extends EssentialsCommand
|
|||||||
public void run(Server server, Essentials parent, User user, String commandLabel, String[] args) throws Exception
|
public void run(Server server, Essentials parent, User user, String commandLabel, String[] args) throws Exception
|
||||||
{
|
{
|
||||||
if (args.length < 1) {
|
if (args.length < 1) {
|
||||||
user.sendMessage("§cUsage: /sell [itemname|id] [-][amount]");
|
user.sendMessage("§cUsage: /sell [itemname|id|hand] [-][amount]");
|
||||||
return;
|
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) {
|
if(is.getType() == Material.AIR) {
|
||||||
throw new Exception("You really tried to sell Air? Put an item in your hand.");
|
throw new Exception("You really tried to sell Air? Put an item in your hand.");
|
||||||
}
|
}
|
||||||
|
@@ -177,7 +177,7 @@ commands:
|
|||||||
usage: /<command>
|
usage: /<command>
|
||||||
sell:
|
sell:
|
||||||
description: Sells the item currently in your hand.
|
description: Sells the item currently in your hand.
|
||||||
usage: /<command> [itemname|id] [-][amount]
|
usage: /<command> [itemname|id|hand] [-][amount]
|
||||||
sethome:
|
sethome:
|
||||||
description: Set your home to your current location.
|
description: Set your home to your current location.
|
||||||
usage: /<command>
|
usage: /<command>
|
||||||
|
Reference in New Issue
Block a user