Module:Smelting

From Aether Project Wiki
Jump to navigation Jump to search
This is the documentation page. It will be transcluded into the main module page. See Template:Documentation for more information

This module implements {{smelting}}.

Dependencies

See also


local p = {}

local i18n = {
	defaultFuel = 'Any fuel',
	moduleArgs = [[Module:ProcessArgs]],
	moduleRecipe = [[Module:Recipe table]],
	type = 'Smelting',
}
p.i18n = i18n

local recipeTable = require( i18n.moduleRecipe ).table

function p.table( f )
	local args = f
	if f == mw.getCurrentFrame() then
		args = require( i18n.moduleArgs ).merge( true )
	else
		f = mw.getCurrentFrame()
	end
	
	args.Input = args[1]
	args.Output = args[2]
	args.Experience = args[3]
	args.Fuel = args.fuel or i18n.defaultFuel
	
	local title = mw.title.getCurrentTitle()
	
	local out = recipeTable( args, {
		uiFunc = 'furnace',
		type = args.link or (title.isSubpage and mw.title.getCurrentTitle().rootText .. '/' .. i18n.type .. '|' .. i18n.type) or i18n.type,
		ingredientArgs = { 'Input', 'Fuel' },
		outputArgs = { 'Output' },
	} )
	
	return out, category
end

return p