mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-06 20:43:11 +00:00
[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:
parent
ed47df93e9
commit
e9927519c4
3 changed files with 4 additions and 14 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue