[trunk] Updated /item and /give to support the new ItemDb.get()

Heal sign supports data items too.

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1384 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
snowleo 2011-05-09 00:37:05 +00:00
parent ed47df93e9
commit e9927519c4
3 changed files with 4 additions and 14 deletions

View file

@ -22,8 +22,7 @@ public class Commanditem extends EssentialsCommand
{
throw new NotEnoughArgumentsException();
}
String[] itemArgs = args[0].split("[^a-zA-Z0-9]");
ItemStack stack = ItemDb.get(itemArgs[0]);
ItemStack stack = ItemDb.get(args[0]);
String itemname = stack.getType().toString().toLowerCase().replace("_", "");
if (ess.getSettings().permissionBasedItemSpawn()
@ -36,10 +35,6 @@ public class Commanditem extends EssentialsCommand
user.sendMessage(ChatColor.RED + "You are not allowed to spawn the item " + itemname);
return;
}
if (itemArgs.length > 1)
{
stack.setDurability(Short.parseShort(itemArgs[1]));
}
if (args.length > 1 && Integer.parseInt(args[1]) > 0)
{