code: public static ItemStack getItemStack(String str)
  	{
  		Matcher matcher = pattern.matcher(str);
  		if (!matcher.find())
  			return ItemStack.EMPTY;
  
  		String itemString = matcher.group("item");
  		if (itemString == null)
  			return ItemStack.EMPTY;
  
  		String modid = matcher.group("modid");
  		if (modid == null)
  			modid = "minecraft";
  
  		int damage = 0;
  		String strDamage = matcher.group("damage");
  		if (strDamage != null)
  			damage = strDamage.equals("*") ? OreDictionary.WILDCARD_VALUE : Silenced.get(() -> Integer.parseInt(matcher.group("damage")));
  		int size = matcher.group("size") == null ? 1 : Silenced.get(() -> Integer.parseInt(matcher.group("size")));
  		if (size == 0)
  			size = 1;
  
  		Item item = Item.getByNameOrId(modid + ":" + itemString);
  		if (item == null)
  			return ItemStack.EMPTY;
  
  		return new ItemStack(item, size, damage);
  	}
docs: Constructs an {@link ItemStack} from a string in the format modid:itemName@damagexstackSize.
  
  @param str the str
  @return the item