From 94dfe3c2b8f0aca3c707699b764418e0015b2d10 Mon Sep 17 00:00:00 2001 From: Emerson Rosen-Jones Date: Sat, 17 Jan 2026 16:53:25 -0500 Subject: [PATCH] feat: new getName table Table of utility functions --- compacting-storage.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/compacting-storage.lua b/compacting-storage.lua index 37d5bf2..ea4cc06 100644 --- a/compacting-storage.lua +++ b/compacting-storage.lua @@ -57,6 +57,27 @@ local BLOCKS = 81 local MIN_NUM = (4 * STACKS * NUGGETS) + (4 * STACKS * INGOTS) local MAX_NUM = (8 * STACKS * NUGGETS) + (8 * STACKS * INGOTS) +local getName = { + nugget = function (item_type) + return ("%s:%s_nugget"):format( + ITEM_TYPES[item_type].nugget, + item_type, + ) + end, + ingot = function (item_type) + return ("%s:%s_ingot"):format( + ITEM_TYPES[item_type].ingot, + item_type, + ) + end, + block = function (item_type) + return ("%s:%s_block"):format( + ITEM_TYPES[item_type].block, + item_type, + ) + end, +} + -- basic actions function craft (requester, item_type, conversion_type) -- conversion_type key: 1, nuggets to ingots; 2, ingots to blocks;