Module:Inventory slot/Aliases

-- Initially taken from https://minecraft.gamepedia.com/Module:Inventory_slot/Aliases

local loader = require('Module:Loader')

local string, table, utils, tooltipsTable, templates, itemVariants = loader.require('String', 'Table', 'Inventory slot/Utils', 'Inventory slot/Tooltips', 'Inventory_slot/Templates', 'Item/Variants')

local minionData, colorData = loader.loadData('Minion/Data', 'Color/Data')

local aliasesTable, templatesTable, itemVariantsTable = {}, {}, {}

local function getTooltips(keys) if type(keys) == 'table' then local ret = {} for i, key in ipairs(keys) do			ret[i] = tooltipsTable[key] or aliasesTable[key] or templatesTable[key] or itemVariantsTable[key] end return ret else return tooltipsTable[keys] or aliasesTable[keys] or templatesTable[keys] or itemVariantsTable[keys] end end

-- Item Tool tips -- -- See https://hypixel.net/threads/guide-minecraft-color-codes.1741307/ -- for information on the color syntax. -- -- Other syntax: -- *\ - New line

local function main --	-- Hypixel Skyblock stuff --	table.merge(aliasesTable, {		-- Fake items		['Air (minion)'] = { title = 'Air', name = 'Minions', image = 'Air (minion)', text = '&7Air should be 1 layer/&7underneath where the minion/&7is standing.', link = 'none' },		['Blank'] = { image = 'Black Stained Glass Pane', name = 'none', title = 'none', link='none', text='none', image_id='Blank:0' },		['Cancel'] = { name = 'Barrier', title = '&cCancel', link='none', text='none' },		['Coming Soon'] = {name = 'Bedrock', title = '&cCOMING SOON', link='none', text = 'none', },		['Close'] = { name = 'Barrier', title = '&cClose', link='none', text='none' },		['Go Back'] = { name = 'Arrow', title = '&aGo Back', link='none'},		['Next Page'] = { name = 'Arrow', title = '&aNext Page', link='none'},		['Previous Page'] = { name = 'Arrow', title = '&aPrevious Page', link='none'},		['Sell Item'] = { name = 'Hopper', title = '&aSell Item', link='none', text='&7Click items in your inventory to/&7sell them to the shop!' }, ['SkyBlock Menu'] = { name = 'SkyBlock Menu', title = '&aSkyBlock Menu &7(Right Click)', text = '&7View all of your SkyBlock/&7progress, including your Skills,/&7Collections, Recipes, and more!//&eClick to open!', }, })	-- Other colored items --	local colors = colorData.MCColors	-- UI Blank (Any Specific Color) --	for i, color in ipairs(colors) do		aliasesTable['Blank ('..color..')'] = { image = color..' Stained Glass Pane', name = 'none', title = 'none', link='none', text='none', image_id='Blank:'..(i-1) }	end	-- Process Data from Inventory slot/Templates --	local MAX_RUNS = 20	local allow_continue, made_change, currentProcess, templateStorage, installed, runs = true, false, 1, {}, {}, 0	while allow_continue and ((currentProcess == 1) or (table.length(templateStorage) > 0)) do		if (currentProcess > 1) and (not made_change) then allow_continue = false end		runs, made_change = runs + 1, false		if runs > MAX_RUNS then error('Too many iterations in processing templates') end		for key, values in pairs(currentProcess == 1 and templates or templateStorage) do			local default = getTooltips(key)			if not default then if allow_continue then templateStorage[key] = values else error('Key '..key..' no default') end else made_change = true table.push(installed, key) table.merge(templatesTable, utils._templateReplacements(values, default)) end end for _, key in ipairs(installed) do			templateStorage[key] = nil end currentProcess, installed = currentProcess + 1, {} end for k,v in pairs(itemVariants) do		itemVariantsTable[k] = getTooltips(v) end return table.merge( {}, tooltipsTable, aliasesTable, templatesTable, itemVariantsTable ) end

-- For Debugging -- local p = { main = main } -- return p

-- Actual Usage return main