Module:Infobox/Modpack

local p = {}

local g = require("Module:Common") local box = require("Module:Infobox")

-- wrapper for modpack, can be called correctly from MW code function p.main(frame) local frame, args = g.getFrameAndArgs(frame) local l = "" -- special handling for FTB as creator local cl = string.lower(args.creator or "") if cl == "ftb" or cl == "ftbteam" or cl == "ftb team" or cl == "the ftb team" then args.creator = "The FTB Team" end -- special handling for launcher names local ll = string.lower(args.launcher or "") if ll == "at" or ll == "atl" or ll == "atlauncher" or ll == "at launcher" then args.launcher = "ATLauncher" elseif ll == "ftb" or ll == "ftblauncher" or ll == "ftb launcher" or ll == "feedthebeast" or ll == "feed the beast" or ll == "feed the beast launcher" then args.launcher = "Feed The Beast Launcher" end if g.isGiven(args.creator) then local devstr = "" for dev in string.gmatch(args.creator, "[^,;]+") do devstr = devstr .. "Created by::" .. dev .. ", " end l = l .. box.row("Creator", string.sub(devstr, 1, -3)) else l = l .. box.row("Creator", "Unknown") end if g.isGiven(args.launcher) then l = l .. box.row("Launcher", "Is on launcher::" .. args.launcher .. "") else l = l .. box.row("Launcher", "Unknown") end if g.isGiven(args.version) then l = l .. box.row("Latest Version", "Version::" .. args.version .. "") else l = l .. box.row("Latest Version", "Unknown") end if g.isGiven(args.mcversion) then l = l .. box.row("Minecraft Version", "Minecraft version::" .. args.mcversion .. "") else l = l .. box.row("Minecraft Version", "Unknown") end l = l .. box.condRow("Private Pack Code", args.code) l = l .. box.condRow("Website", args.url) l = l .. box.condRow("Changelog", args.changelog) l = l .. box.condRow("Replaces", args.prevpack) l = l .. box.condRow("Replaced by", args.nextpack) l = l .. box.condRow("Mod count", args.modcount) if g.isGiven(args.rows) then l = l .. args.rows end args.rows = l	frame.args = args return box.main(frame) end

return p