/// <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; } }
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; } }
private static bool DoesProduceCaviar(IHasContainers item) { return(item.HasContainer <BaseItemContainer>() && Equals(item.GetContainer <BaseItemContainer>().Unwrap().BaseItem, SturgeonKey)); }