Minecraft Wiki
Advertisement
Deze pagina heeft nog geen documentatie. Als je weet hoe het werkt, maak het dan alsjeblieft.
local p = {}
p.table = function()
	local slot = require( [[Module:Inventory slot]] )
	local aliases = mw.loadData( [[Module:Inventory slot/Aliases/sandbox]] ) -- !!Wijzig wanneer overgebracht naar liveversie.
	
	local aliasNamen = {}
	local aI = 1
	for naam in pairs( aliases ) do
		-- Skip the banner aliases (except "Elke banier"), as there are so
		-- many of them it causes the table to be excessively long
		if naam == 'Elke banier' or not naam:find( 'banier$' ) and not naam:find( '^Overeenkomend ' ) and not naam:find( '^Overeenkomende ' ) then
			aliasNamen[aI] = naam
			aI = aI + 1
		end
	end
	table.sort( aliasNamen )
	
	local tableRows = {
		' {| class="wikitable collapsible collapsed"',
		'! Alias !! Uitvoer'
	}
	local rI = #tableRows + 1
	for _, naam in ipairs( aliasNamen ) do
		local alias = slot.getAlias( aliases[naam], {} )
		
		local cell = {}
		for i, frame in ipairs( alias ) do
			cell[i] = slot.slot{ { frame }, parsed = true }
		end
		
		local aliasText = mw.html.create()
		aliasText:tag( 'code' ):wikitext( naam )
		if naam:find( '^Elk ') then
			aliasText:tag( 'br' ):done()
				:tag( 'code' ):wikitext( ( naam:gsub( '^Elk', 'Overeenkomend' ) ) )
		end
		if naam:find( '^Elke ') then
			aliasText:tag( 'br' ):done()
				:tag( 'code' ):wikitext( ( naam:gsub( '^Elke', 'Overeenkomende' ) ) )
		end
		tableRows[rI] = '|' .. tostring( aliasText ) .. '||' .. table.concat( cell )
		rI = rI + 1
	end
	tableRows[rI] = '|}'
	
	return table.concat( tableRows, '\n|-\n' )
end
return p
Advertisement