Added the ability to specify the number of items in primitive crafting recipes and results

This commit is contained in:
Van
2026-03-30 20:59:34 +03:00
parent 9873e059cb
commit 8a0b5785ab
4 changed files with 14 additions and 59 deletions

View File

@@ -79,14 +79,17 @@ local function getCraftPane(self, playerName, paneType)
if selectedCraft ~= nil then
local craft = PrimitiveCraftHandler:getCraftByName(selectedCraft)
local itemName = craft.output
local item = ItemStack(craft.output)
local itemDef = item:get_definition()
local recipe = ''
for _, itemName in ipairs(craft.recipe) do
recipe = recipe..'- '..core.registered_items[itemName]._title..'\n'
local recipeItem = ItemStack(itemName)
recipe = recipe..'- '..core.strip_colors(recipeItem:get_definition()._title)..' x'..recipeItem:get_count()..'\n'
end
local itemDef = core.registered_items[itemName]
CraftPane:
itemImage(5.5, 0.5, 2, 2, itemName):
itemImage(5.5, 0.5, 2, 2, craft.output):
areaLabel(5.5, 3, 4, 4,
itemDef._title..'\n'..
itemDef._description..'\n\n'..