Minecraft: Story Mode has now been discontinued. If you already own a copy, make sure you download it before June 25 before the servers go offline, or else you may not be able to in the future. See here for more details.

Module:Version front page

From Minecraft Wiki
Jump to: navigation, search
[create | history | purge]Documentation
This module has no documentation. If you know how to use this module, please create it.
local p = {}
p.version = function( f )
	local args = f:getParent().args
	local versions = mw.loadData( 'Module:Version front page/Numbers' )
	local version = 'pc'
	if args.c then
		args.classic = '1'
	end
	for v in pairs( args ) do
		if type( v ) == 'string' then
			v = v:lower()
			if versions[v] then
				version = v
				break
			end
		end
	end
	
	local edition
	if args.s or args.server then
		edition = versions[version .. '-server']
	end
	if not edition then
		edition = versions[version]
	end
	local versionNum = edition[1] or edition
	local prefix = edition.prefix or ''
	
	local style = ''
	if args[1] then
		style = f:expandTemplate{ title = 'Table Choice', args = { args[1] == versionNum and 'yes' or 'no', '' } }
	end
	
	if args.nolink or versionNum == '' then
		return style .. ( args[1] or versionNum )
	else
		return style .. f:expandTemplate{ title = 'Version link', args = {
			prefix .. ' ' .. ( args[1] or versionNum ),
			args[2] or args[1] or versionNum
		} }
	end
end
return p