Module:Sandbox

local slot = require( Module:Inventory slot ).slot local addSlot = function( args, item, prefix, class, 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, 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 type = args.type local invDisplay = args.inventory local width if type == '' then width = 'auto' else width = '324px' end local height if type == '' then height = 'auto' elseif type == 'chest' or		  type == 'ender-chest' or		   type == 'shulker-box' or		   type == 'barrel' then height = '306px' elseif type == 'large-chest' then height = '416px' elseif type == 'hopper' then height = '238px' elseif type == '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{ ['box-sizing'] = 'content-box', border = '8px solid', ['border-radius'] = '0', ['-o-border-image'] = ' 4 fill repeat', ['border-image'] = ' 4 fill repeat', ['background-clip'] = 'padding-box', width = width, height = height }	function chest local inv = body:tag( 'span' ) local row = 3 if type == 'large-chest' then row = 6 end for numRow = 0, row - 1 do			local slotsRow = inv:tag( 'span' ):addClass( 'mcui-row' ) for num = 9 * numRow, 9 * numRow + 8 do slotsRow:wikitext( addSlot( args, 'C' .. num, 'C' ) ) end end return inv end

if type == 'chest' or	  type == 'ender-chest' or	   type == 'shulker-box' or	   type == 'barrel' then chest end return tostring( mw.html.create( 'div' ):node( body ) ) end