コード例 #1
0
 /// <summary>
 /// Fills the provided <see cref="item"/> with a base material.
 /// </summary>
 /// <remarks>
 /// By default, the base item is the Material key of the recipe, but the functions is also given
 /// the original <see cref="material"/> item with container access, such that the information can
 /// be copied/derived from instance data on the original item.
 /// </remarks>
 /// <param name="item">Item to fill with base item data</param>
 /// <param name="material">Original item to derive information from (unused by default)</param>
 public virtual void FillBaseItem(IHasContainers item, IHasContainers material)
 {
     if (item.HasContainer <BaseItemContainer>())
     {
         item.GetContainer <BaseItemContainer>().Unwrap().BaseItem = Material;
     }
 }
コード例 #2
0
 public override void FillBaseItem(IHasContainers item, IHasContainers material)
 {
     if (!DoesProduceCaviar(item) && item.HasContainer <BaseItemContainer>() && material.HasContainer <BaseItemContainer>())
     {
         item.GetContainer <BaseItemContainer>().Unwrap().BaseItem =
             material.GetContainer <BaseItemContainer>().Unwrap().BaseItem;
     }
 }
コード例 #3
0
 private static bool DoesProduceCaviar(IHasContainers item)
 {
     return(item.HasContainer <BaseItemContainer>() &&
            Equals(item.GetContainer <BaseItemContainer>().Unwrap().BaseItem, SturgeonKey));
 }