public override float GetMiningSpeed(IItemStack itemstack, Block block, IPlayer forPlayer) { ItemStack partstack = ModularItemHelper.GetToolheadStack(itemstack); ToolPart part = null; if (partstack != null) { partstack.ResolveBlockOrItem(api.World); part = (ToolPart)partstack.Item; } if (part != null) { return(part.GetMiningSpeed(itemstack, block, forPlayer)); } return(base.GetMiningSpeed(itemstack, block, forPlayer)); }
public ItemStack GetToolheadStack(IItemStack stack) { return(ModularItemHelper.GetToolheadStack(stack)); }