Module:Materials

local p = {} data = mw.loadData("Module:Materials/Data") function p.outputMaterialNH (frame) local function isEmpty(s) return s == nil or s == '' end local print = ' ' if not isEmpty(data.materialNH[frame.args['1']]) and not isEmpty(data.materialNH[frame.args['1']][1]) then print = print .. ' '	else print = print .. '[[File:Leaf NH Icon cropped.png'		if not isEmpty(frame.args['size']) then			print = print .. '|' .. frame.args['size']		else			print = print .. '|15px'		end		print = print .. '|link=|alt=]] ' end if not isEmpty(frame.args['2']) then print = print .. frame.args['2'] .. '× '	else print = print .. ''	end if not isEmpty(data.materialNH[frame.args['1']]) and not isEmpty(data.materialNH[frame.args['1']][3]) then print = print .. '' .. data.materialNH[frame.args['1'[3] .. '|' .. data.materialNH[frame.args['1']][4] .. ']]'   else if not isEmpty(data.materialNH[frame.args['1']]) and not isEmpty(data.materialNH[frame.args['1']][5]) then print = print .. data.materialNH[frame.args['1']][5] else print = print ..  .. frame.args['1'] ..  end end print = print .. ' '	if not isEmpty(frame.args['nb']) then print = print .. ''	else print = print .. ' '	end return print end

function p.outputMaterialPC (frame) local function isEmpty(s) return s == nil or s == '' end local print = ' ' if not isEmpty(data.materialPC[frame.args['1']]) and not isEmpty(data.materialPC[frame.args['1']][1]) then print = print .. ' '	end if not isEmpty(frame.args['2']) then print = print .. frame.args['2'] .. '× '	else print = print .. ''	end if not isEmpty(data.materialPC[frame.args['1']]) and not isEmpty(data.materialPC[frame.args['1']][3]) then print = print .. '' .. data.materialPC[frame.args['1'[3] .. '|' .. data.materialPC[frame.args['1']][4] .. ']]'   else if not isEmpty(data.materialPC[frame.args['1']]) and not isEmpty(data.materialPC[frame.args['1']][5]) then print = print .. data.materialPC[frame.args['1']][5] else print = print ..  .. frame.args['1'] ..  end end print = print .. ' '	if not isEmpty(frame.args['nb']) then print = print .. ''	else print = print .. ' '	end return print end return p