Module:Sandbox

local slot = require( Module:Inventory slot ).slot local addSlot = function( args, item, prefix, class, style, default ) local none, nostacksize prefix = prefix or '' if #prefix == 0 then none = 'none' nostacksize = ((item ==  or nil) and ) or (args and args[item] and args[item]:gsub( '[,%d]',  ) or ) end return slot{ nostacksize or args[item], mod = args.Mod, link = none or args[prefix .. 'link'], title = none or args[prefix .. 'title'], class = class, style = style, default = default, parsed = args.parsed } end

local p = {}

function p.inventory( f ) local args = f	if f == mw.getCurrentFrame then args = f:getParent.args else f = mw.getCurrentFrame end local invType = args.type local invDisplay = args.inventory local width = invType == '' and 'auto' or '324px' local height = '' if invType == '' then height = 'auto' elseif invType == 'chest' or		  invType == 'ender-chest' or		   invType == 'shulker-box' or		   invType == 'barrel' then height = '306px' elseif invType == 'large-chest' then height = '416px' elseif invType == 'hopper' then height = '238px' elseif invType == 'generic' then height = tostring( 1 * 36 + 20 ) .. 'px' else height = '304px' end if invDisplay == 'no' and height ~= 'auto' then height = tostring( string.gsub( height, 'px', '' ) - 158 ) .. 'px' end local body = mw.html.create( 'span' ):addClass( 'mcui pixel-image' ) body :css{ height = height, width = width, ['border-image'] = ' 4 fill repeat', ['-o-border-image'] = ' 4 fill repeat', ['border-radius'] = '0', border = '8px solid', ['background-clip'] = 'padding-box', ['box-sizing'] = 'content-box' }	if invType == 'chest' or	  invType == 'ender-chest' or	   invType == 'shulker-box' or	   invType == 'barrel' then local inv = body:tag( 'span' ) local row = invType == 'large-chest' and 6 or 3

for numRow = 0, row - 1 do			local slotsRow = inv:tag( 'span' ):css{ display = 'block' } for num = 9 * numRow, 9 * numRow + 8 do slotsRow:wikitext( addSlot( args, 'C' .. num, 'C' ) ) end end end function craftingTable local inv = body:tag( 'span' ) local inputTable = inv:tag( 'span' ) inputTable :css{ position = 'absolute', top = '24px', left = '50px' }		for num = 1, 3 do			local row = inputTable:tag( 'span' ):css{ display = 'block' } for _, letter in ipairs{ 'A', 'B', 'C' } do row:wikitext( addSlot( args, letter .. num ) ) end end local arrow = inv:tag( 'span' ) arrow :css{ position = 'absolute', top = '60px', left = '172px', background = '', width = '44px', height = '32px', }			:tag( 'br' ) local outputTable = inv:tag( 'span' ) outputTable :css{ position = 'absolute', top = '52px', left = '230px' }			:wikitext( addSlot( args, 'Output', 'O', 'invslot-large' ) ) return inv end return tostring( mw.html.create( 'div' ):node( body ) ) end

return p