示例#1
0
        public void RecalculateAttributes(IItemStack stack)
        {
            ModularItemHelper.RecalculateAttributes(stack, api.World);

            ItemStack headstack = GetToolheadStack(stack);

            int tooltier = 0;

            if (headstack != null)
            {
                headstack.ResolveBlockOrItem(api.World);
                ToolPart part = (ToolPart)headstack.Item;

                if (part != null)
                {
                    tooltier = part.TinkerProps.ToolTier;
                }
            }

            if (tooltier != 0)
            {
                stack.Attributes.SetInt("tooltier", tooltier);
            }
            else
            {
                stack.Attributes.RemoveAttribute("tooltier");
            }
        }
示例#2
0
 public virtual void RecalculateAttributes(IItemStack stack)
 {
     ModularItemHelper.RecalculateAttributes(stack, api.World);
 }