Module:MFR/NavItem

Revision as of 02:05, 6 February 2014 by Mastergalen (talk | contribs) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:MFR/NavItem/doc

local itemtable = {
	-- Table/array returned contains name, sprite ID and link
	['auto-anvil'] = {'Auto-Anvil', 1, 'Auto-Anvil'},
	['auto-brewer'] = {'Auto-Brewer', 2, 'Auto-Brewer'},
	['auto-disenchanter'] = {'Auto-Disenchanter', 3, 'Auto-Disenchanter'},
	['auto-enchanter'] = {'Auto-Enchanter', 4, 'Auto-Enchanter'},
	['auto-jukebox'] = {'Auto-Jukebox', 5, 'Auto-Jukebox'},
	['auto-spawner'] = {'Auto-Spawner', 6, 'Auto-Spawner'},
	['biofuel'] = {'BioFuel', 7, 'BioFuel'},
	['biofuel-generator'] = {'BioFuel Generator', 8, 'BioFuel_Generator'},
	['bioreactor'] = {'BioReactor', 9, 'BioReactor'},
	['blackstone-gravel'] = {'Blackstone Gravel', 10, 'Blackstone_Gravel'},
	['blank-record'] = {'Blank Record', 11, 'Blank_Record'},
	['block-breaker'] = {'Block Breaker', 12, 'Block_Breaker_(MineFactory_Reloaded)'},
	['block-smasher'] = {'Block Smasher', 13, 'Block_Smasher'},
	['breeder'] = {'Breeder', 14, 'Breeder'},
	['cargo-dropoff-rail'] = {'Cargo Dropoff Rail', 15, 'Cargo_Dropoff_Rail'},
	['cargo-pickup-rail'] = {'Cargo Pickup Rail', 16, 'Cargo_Pickup_Rail'},
	['ceramic-dye'] = {'Ceramic Dye', 17, 'Ceramic_Dye'},
	['chocolate-milk'] = {'Chocolate Milk', 18, 'Chocolate_Milk'},
	['chronotyper'] = {'Chronotyper', 19, 'Chronotyper'},
	['cobble-blackstone'] = {'Cobble Blackstone', 20, 'Cobble_Blackstone'},
	['cobble-whitestone'] = {'Cobble Whitestone', 21, 'Cobble_Whitestone'},
	['composter'] = {'Composter', 22, 'Composter'},
	['conveyor-belt'] = {'Conveyor Belt', 23, 'Conveyor_Belt_(MineFactory_Reloaded)'},
	['cooked-meat-block'] = {'Cooked Meat Block', 24, 'Cooked_Meat_Block'},
	['cooked-meat-ingot'] = {'Cooked Meat Ingot', 25, 'Cooked_Meat_Ingot'},
	['cooked-meat-nugget'] = {'Cooked Meat Nugget', 26, 'Cooked_Meat_Nugget'},
	['de-zombification-syringe'] = {'De-Zombification Syringe', 27, 'De-Zombification_Syringe'},
	['deep-storage-unit'] = {'Deep Storage Unit', 28, 'Deep_Storage_Unit'},
	['ejector'] = {'Ejector', 29, 'Ejector_(MineFactory_Reloaded)'},
	['empty-syringe'] = {'Empty Syringe', 30, 'Empty_Syringe'},
	['enchantment-router'] = {'Enchantment Router', 31, 'Enchantment_Router'},
	['essence'] = {'Essence', 32, 'Essence'},
	['factory-machine-block'] = {'Factory Machine Block', 33, 'Factory_Machine_Block'},
	['fertilizer'] = {'Fertilizer', 34, 'Fertilizer_(MineFactory_Reloaded)'},
	['fisher'] = {'Fisher', 35, 'Fisher'},
	['fruit-picker'] = {'Fruit Picker', 36, 'Fruit_Picker'},
	['glowstone-bricks'] = {'Glowstone Bricks', 37, 'Glowstone_Bricks'},
	['grinder'] = {'Grinder', 38, 'Grinder_(MineFactory_Reloaded)'},
	['growth-syringe'] = {'Growth Syringe', 39, 'Growth_Syringe'},
	['harvester'] = {'Harvester', 40, 'Harvester'},
	['health-syringe'] = {'Health Syringe', 41, 'Health_Syringe'},
	['ice-bricks'] = {'Ice Bricks', 42, 'Ice_Bricks'},
	['industrial-fertilizer'] = {'Industrial Fertilizer', 43, 'Industrial_Fertilizer'},
	['item-collector'] = {'Item Collector', 44, 'Item_Collector'},
	['item-router'] = {'Item Router', 45, 'Item_Router'},
	['jailers-safari-net'] = {'Jailer\'s Safari Net', 46, 'Jailer\'s_Safari_Net'},
	['lapis-bricks'] = {'Lapis Bricks', 47, 'Lapis_Bricks'},
	['large-blackstone-bricks'] = {'Large Blackstone Bricks', 48, 'Large_Blackstone_Bricks'},
	['large-glowstone-bricks'] = {'Large Glowstone Bricks', 49, 'Large_Glowstone_Bricks'},
	['large-ice-bricks'] = {'Large Ice Bricks', 50, 'Large_Ice_Bricks'},
	['large-lapis-bricks'] = {'Large Lapis Bricks', 51, 'Large_Lapis_Bricks'},
	['large-obsidian-bricks'] = {'Large Obsidian Bricks', 52, 'Large_Obsidian_Bricks'},
	['large-snow-bricks'] = {'Large Snow Bricks', 53, 'Large_Snow_Bricks'},
	['large-whitestone-bricks'] = {'Large Whitestone Bricks', 54, 'Large_Whitestone_Bricks'},
	['laser-drill'] = {'Laser Drill', 55, 'Laser_Drill'},
	['laser-drill-precharger'] = {'Laser Drill Precharger', 56, 'Laser_Drill_Precharger'},
	['lava-fabricator'] = {'Lava Fabricator', 57, 'Lava_Fabricator'},
	['liquicrafter'] = {'LiquiCrafter', 58, 'LiquiCrafter'},
	['liquid-router'] = {'Liquid Router', 59, 'Liquid_Router'},
	['meat'] = {'Meat', 60, 'Meat'},
	['meat-packer'] = {'Meat Packer', 61, 'Meat_Packer'},
	['milk'] = {'Milk', 62, 'Milk_(MineFactory_Reloaded)'},
	['mushroom-soup'] = {'Mushroom Soup', 63, 'Mushroom_Soup'},
	['obsidian-bricks'] = {'Obsidian Bricks', 64, 'Obsidian_Bricks'},
	['oil-fabricator'] = {'Oil Fabricator', 65, 'Oil_Fabricator'},
	['passenger-dropoff-rail'] = {'Passenger Dropoff Rail', 66, 'Passenger_Dropoff_Rail'},
	['passenger-pickup-rail'] = {'Passenger Pickup Rail', 67, 'Passenger_Pickup_Rail'},
	['paved-blackstone'] = {'Paved Blackstone', 68, 'Paved_Blackstone'},
	['paved-stone-bricks'] = {'Paved Stone Bricks', 69, 'Paved_Stone_Bricks'},
	['paved-whitestone'] = {'Paved Whitestone', 70, 'Paved_Whitestone'},
	['pink-slimeball'] = {'Pink Slimeball', 72, 'Pink_Slimeball'},
	['pink-slime-item'] = {'Pink Slime', 71, 'Pink_Slime_(Item)'},
	['pink-slime-mob'] = {'Pink Slime', 73, 'Pink_Slime_(Mob)'},
	['planter'] = {'Planter', 74, 'Planter'},
	['plastic-sheets'] = {'Plastic Sheets', 75, 'Plastic_Sheets'},
	['portaspawner'] = {'PortaSpawner', 76, 'PortaSpawner'},
	['prc-lx-100-logic-expansion-card'] = {'PRC LX-100 Logic Expansion Card', 77, 'PRC_LX-100_Logic_Expansion_Card'},
	['prc-lx-300-logic-expansion-card'] = {'PRC LX-300 Logic Expansion Card', 78, 'PRC_LX-300_Logic_Expansion_Card'},
	['prc-lx-500-logic-expansion-card'] = {'PRC LX-500 Logic Expansion Card', 79, 'PRC_LX-500_Logic_Expansion_Card'},
	['prc-memory-card'] = {'PRC Memory Card', 80, 'PRC_Memory_Card'},
	['prc-owners-manual'] = {'PRC Owner\'s Manual', 81, 'PRC_Owner\'s_Manual'},
	['precision-sledgehammer'] = {'Precision Sledgehammer', 82, 'Precision_Sledgehammer'},
	['programmable-rednet-controller'] = {'Programmable RedNet Controller', 83, 'Programmable_RedNet_Controller'},
	['programmable-rednet-controller-housing'] = {'Programmable RedNet Controller Housing', 84, 'Programmable_RedNet_Controller_Housing'},
	['rancher'] = {'Rancher', 85, 'Rancher'},
	['raw-meat-block'] = {'Raw Meat Block', 86, 'Raw_Meat_Block'},
	['raw-meat-ingot'] = {'Raw Meat Ingot', 87, 'Raw_Meat_Ingot'},
	['raw-meat-nugget'] = {'Raw Meat Nugget', 88, 'Raw_Meat_Nugget'},
	['raw-plastic'] = {'Raw Plastic', 89, 'Raw_Plastic'},
	['rednet-cable'] = {'RedNet Cable', 90, 'RedNet_Cable'},
	['rednet-historian'] = {'RedNet Historian', 91, 'RedNet_Historian'},
	['rednet-meter'] = {'RedNet Meter', 92, 'RedNet_Meter'},
	['rednote-block'] = {'RedNote Block', 93, 'RedNote_Block'},
	['road'] = {'Road', 94, 'Road'},
	['road-light'] = {'Road Light', 95, 'Road_Light'},
	['road-light-inverted'] = {'Road Light (Inverted)', 96, 'Road_Light_(Inverted)'},
	['rubber'] = {'Rubber', 97, 'Rubber_(MineFactory_Reloaded)'},
	['rubber-bar'] = {'Rubber Bar', 98, 'Rubber_Bar'},
	['rubber-leaves'] = {'Rubber Leaves', 99, 'Rubber_Leaves_(MineFactory_Reloaded)'},
	['rubber-sapling'] = {'Rubber Sapling', 100, 'Rubber_Sapling'},
	['rubber-wood'] = {'Rubber Wood', 101, 'Rubber_Wood_(MineFactory_Reloaded)'},
	['ruler'] = {'Ruler', 102, 'Ruler'},
	['safari-net'] = {'Safari Net', 103, 'Safari_Net'},
	['safari-net-single-use'] = {'Safari Net (Single Use)', 104, 'Safari_Net_(Single_Use)'},
	['safari-net-launcher'] = {'Safari Net Launcher', 105, 'Safari_Net_Launcher'},
	['sewage'] = {'Sewage', 106, 'Sewage'},
	['sewer'] = {'Sewer', 107, 'Sewer'},
	['slaughterhouse'] = {'Slaughterhouse', 108, 'Slaughterhouse'},
	['slime-embiggening-syringe'] = {'Slime Embiggening Syringe', 109, 'Slime_Embiggening_Syringe'},
	['sludge'] = {'Sludge', 110, 'Sludge_(MineFactory_Reloaded)'},
	['sludge-boiler'] = {'Sludge Boiler', 111, 'Sludge_Boiler'},
	['small-blackstone-bricks'] = {'Small Blackstone Bricks', 112, 'Small_Blackstone_Bricks'},
	['small-whitestone-bricks'] = {'Small Whitestone Bricks', 113, 'Small_Whitestone_Bricks'},
	['smooth-blackstone'] = {'Smooth Blackstone', 114, 'Smooth_Blackstone'},
	['smooth-whitestone'] = {'Smooth Whitestone', 115, 'Smooth_Whitestone'},
	['snow-bricks'] = {'Snow Bricks', 116, 'Snow_Bricks'},
	['spyglass'] = {'Spyglass', 117, 'Spyglass'},
	['stained-glass'] = {'Stained Glass', 118, 'Stained_Glass_(MineFactory_Reloaded)'},
	['stained-glass-pane'] = {'Stained Glass Pane', 119, 'Stained_Glass_Pane'},
	['straw'] = {'Straw', 120, 'Straw'},
	['sugar-charcoal'] = {'Sugar Charcoal', 121, 'Sugar_Charcoal'},
	['unifier'] = {'Unifier', 122, 'Unifier'},
	['unknown'] = {'Unknown', 123, 'Template:MFR/NavItem'},
	['veterinary-station'] = {'Veterinary Station', 124, 'Veterinary_Station'},
	['vine-scaffolding'] = {'Vine Scaffolding', 125, 'Vine_Scaffolding'},
	['weather-collector'] = {'Weather Collector', 126, 'Weather_Collector'},
	['whitestone-gravel'] = {'Whitestone Gravel', 127, 'Whitestone_Gravel'},
	['xp-extractor'] = {'XP Extractor', 128, 'XP_Extractor'},
	['zombie-syringe'] = {'Zombie Syringe', 129, 'Zombie_Syringe'}
}

function sprite(data)
	local x = ((data[2] - 1) % 16) * 16;
	local y = (math.floor((data[2] - 1) / 16)) * 16;
	return '<div style="position: relative; height: 16px; width: 16px; overflow: hidden; display: inline-block; vertical-align: middle;">' ..
		'<div style="position: absolute; height: 256px; width: 256px; top: -' .. y .. 'px; left: -' .. x .. 'px;">' ..
		'[[File:Sprites_MineFactory_Reloaded_Nav.png|link=' .. data[3] .. '|' .. data[1] .. ']]' ..
		'</div>' ..
		'</div>'
end

function link(data)
	return '[[' .. data[3] .. '|' .. data[1] .. ']]'
end

local p = {}

function p.main(frame)
	local data = itemtable[string.lower(frame.args[1])] or itemtable['unknown']
	local name = frame.args[2] or ''
	if name ~= '' then
		data[1] = name
	end
	return '<span class="nowrap">' .. sprite(data) .. '&nbsp;' .. link(data) .. '</span>'
end
 
return p
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Need wiki hosting?

Do you need a wiki for your Minecraft mod/gaming wiki? We'll host it for free! Contact us.

Other wikis

Indie-game wikis
Powered by Indie Wikis