mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-09-30 00:27:26 +02:00
[trunk] /sell inventory, /sell blocks fixes
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1345 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
parent
cf020d235e
commit
0825a1de86
@ -23,18 +23,16 @@ public class Commandsell extends EssentialsCommand
|
|||||||
{
|
{
|
||||||
throw new NotEnoughArgumentsException();
|
throw new NotEnoughArgumentsException();
|
||||||
}
|
}
|
||||||
ItemStack is;
|
ItemStack is = null;
|
||||||
ItemStack[] isArray;
|
|
||||||
if (args[0].equalsIgnoreCase("hand"))
|
if (args[0].equalsIgnoreCase("hand"))
|
||||||
{
|
{
|
||||||
is = user.getItemInHand();
|
is = user.getItemInHand();
|
||||||
|
|
||||||
}
|
}
|
||||||
if (args[0].equalsIgnoreCase("inventory"))
|
if (args[0].equalsIgnoreCase("inventory"))
|
||||||
{
|
{
|
||||||
for (ItemStack stack : user.getInventory().getContents())
|
for (ItemStack stack : user.getInventory().getContents())
|
||||||
{
|
{
|
||||||
if(stack.getType() == Material.AIR) continue;
|
if (stack == null || stack.getType() == Material.AIR) continue;
|
||||||
sellItem(user, stack, args);
|
sellItem(user, stack, args);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -43,12 +41,12 @@ public class Commandsell extends EssentialsCommand
|
|||||||
{
|
{
|
||||||
for (ItemStack stack : user.getInventory().getContents())
|
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);
|
sellItem(user, stack, args);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
if (is == null)
|
||||||
{
|
{
|
||||||
is = ItemDb.get(args[0]);
|
is = ItemDb.get(args[0]);
|
||||||
}
|
}
|
||||||
|
@ -208,7 +208,7 @@ commands:
|
|||||||
usage: /<command> [playername]
|
usage: /<command> [playername]
|
||||||
sell:
|
sell:
|
||||||
description: Sells the item currently in your hand.
|
description: Sells the item currently in your hand.
|
||||||
usage: /<command> [itemname|id|hand] [-][amount]
|
usage: /<command> [itemname|id|hand|inventory|blocks] [-][amount]
|
||||||
aliases: [esell]
|
aliases: [esell]
|
||||||
sethome:
|
sethome:
|
||||||
description: Set your home to your current location.
|
description: Set your home to your current location.
|
||||||
|
Loading…
Reference in New Issue
Block a user