Module:Inventory slot/Aliases

require('Module:MultiRequire')

local aliases = {} local table = require('Module:Table') local uiText = require('Module:UIText')._main local string = require('Module:String')

local minionData, petData, textData, rarityData, statData = loadDataMulti(	'Module:Minion/Data',	'Module:Pet/Data',	'Module:UIText/Data',	'Module:RarityTier/Data',	'Module:Statname/Data')

local petModule = require("Module:Pet") local rarityAliases = require('Module:RarityTier/Aliases') local statAliases = require('Module:Statname/aliases')

local tooltips = require('Module:Inventory slot/Tooltips') local itemVariants = require("Module:Item/Variants")

-- Initial values from https://minecraft.gamepedia.com/Module:Inventory_slot/Aliases -- This should not be visible, malicious users might do something

local function mergeTables(target, merger) for k, v in pairs(merger) do		target[k] = v	end return target end

local function getTooltips(keys) local ret = {} if type(keys) == "table" then for i, key in ipairs(keys) do			ret[i] = tooltips[key] or key end return ret else return tooltips[key] or key 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

-- Data from Module:Inventory slot/Tooltips table.merge(aliases, tooltips)

-- Data from Module:Item/Variants local allItemVariants = itemVariants.getVariants table.eachNamed(allItemVariants, function(v, k)	aliases[k] = getTooltips(v)	end) table.merge(aliases, allItemVariants)

-- Wood Planks table.each({	'Oak Wood Plank','Spruce Wood Plank',	'Birch Wood Plank','Jungle Wood Plank',	'Acacia Wood Plank','Dark Oak Wood Plank'	}, function(n)		aliases[n..'s'] = getTooltips(n)	end)

-- -- Hypixel Skyblock stuff -- table.merge(aliases, {	-- Display names --	['Melon'] = { title = 'Melon', name = 'Melon Slice' },	['Melon Slice'] = { title = 'Melon', name = 'Melon Slice' },	['Melon (block)'] = { title = 'Melon', name = 'Melon (block)' },	['Mushroom'] = getTooltips{ 'Red Mushroom', 'Brown Mushroom' },	['Enchanted Mushroom'] = getTooltips{ 'Enchanted Red Mushroom', 'Enchanted Brown Mushroom' },	-- Fake items	['Air (minion)'] = { title = 'Air', name = 'Minions', image = 'Air (minion)', text = '&7Air should be 1 layer/underneath where the minion/is standing.', link = 'none' },	['Blank'] = { image = 'Black Stained Glass Pane', name = 'none', title = 'none', link='none', text='none' },	['Sell Item'] = { name = 'Hopper', title = '&aSell Item', link='none', text='&7Click items in your inventory to/sell them to the shop!' },	['Close'] = { name = 'Barrier', title = '&cClose', link='none', text='none' },	['Cancel'] = { name = 'Barrier', title = '&cCancel', 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'}, ['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!', }, })

-- Make it so minions tiers use the image, but link to actual page local minions = { -- Farming 'Wheat', 'Carrot', 'Potato', 'Pumpkin', 'Melon', 'Mushroom', 'Cocoa Beans', 'Cactus', 'Sugar Cane', 'Cow', 'Pig', 'Chicken', 'Sheep', 'Rabbit', 'Nether Wart', -- Mining 'Cobblestone', 'Coal', 'Iron', 'Gold', 'Diamond', 'Lapis', 'Emerald', 'Redstone', 'Quartz', 'Obsidian', 'Glowstone', 'Gravel', 'Ice', 'Sand', 'End Stone', 'Clay', 'Mithril', -- Combat 'Zombie', 'Skeleton', 'Spider', 'Cave Spider', 'Creeper', 'Enderman', 'Ghast', 'Slime', 'Blaze', 'Magma Cube', -- Slayer 'Revenant', 'Tarantula', 'Voidling', -- Woodcutting 'Oak', 'Spruce', 'Birch', 'Dark Oak', 'Acacia', 'Jungle', -- Misc 'Fishing', 'Flower', 'Snow', }

local minionsTiers = { "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII" }; for _, name in ipairs(minions) do   for i, tier in ipairs(minionsTiers) do    	if minionData[name].stats[i] then local key = name.." Minion "..tier local description = minionData[name].description or 'No Description' aliases[key] = { title = '&9'..key, name = name.." Minion#"..tier, image = key, text = description..'//&7Time Between Action: &a'..minionData[name].stats[i].tba..'s/&7Max Storage: &e'..minionData[name].stats[i].storage } end end end

-- Make it so enchanted books link to enchantments with href to enchant local ench_data = require("Module:Link/enchantmentsLink/Data") for name, ench in pairs(ench_data) do   for tier = 1, ench.max, 1 do    	local tier_display = string._toRoman(tier) local key = "Enchanted Book ("..name.." "..tier_display..")" aliases[key] = { title = "Enchanted Book", text=(ench.isUltimate and "&d&l" or "&9")..name.." "..tier_display, name = "Enchantments#".. mw.uri.anchorEncode(name), image = "Enchanted Book" } end end

-- Mystery XX Pet do local seenPets = {} for _, petName in pairs(table.keys(petData)) do 		local data = petData[petName]; local rarities = table.map(string.split(data.rarities:gsub('%-', ), ), function(v)			return v:lower		end) local stats = {} for stat, value in pairs(data.stats) do			if not value.req then value = tonumber(value[1]) table.push(stats, ('&r%s: &a%s'):format(string.ucfirst(statAliases[stat]), value < 0 and value or '+'..value)) end end aliases['Mystery '..petName..' Pet'] = { title = '&9Mystery '..petName..' Pet', text = uiText(string.dedent			&8%s Pet			%s			&6Perks:&r			&f&l???&r			&7Progress to level 2: &e0%%&r			&f &e0&6/&e100&r			&6Quality:			&f&l???:format(data.petType or , table.concat(stats, '\n')), ), name = petName..' Pet', }		aliases[petName..' Pet'] = petModule._petTooltip(petName) end end

-- Other colored items -- local colors = require("Module:Color/Data").MCColors -- UI Blank (Any Specific Color) -- for _, color in ipairs(colors) do	aliases['Blank ('..color..')'] = { image = color..' Stained Glass Pane', name = 'none', title = 'none', link='none', text='none' } end

return aliases