PlayerInventory & PlayerInventoryUI: You can now specify groups as materials for primitive crafting in your inventory. #34

This commit is contained in:
Van
2026-04-04 18:00:24 +03:00
parent d5c6101c0f
commit bddcb4e36c
4 changed files with 49 additions and 5 deletions

View File

@@ -105,8 +105,14 @@ local function getCraftPane(self, playerName, paneType)
local recipe = ''
for _, itemName in ipairs(craft.recipe) do
local recipeItem = ItemStack(itemName)
recipe = recipe..'- '..core.strip_colors(recipeItem:get_definition()._title)..' x'..recipeItem:get_count()..'\n'
local group, count = itemName:match('group:(%S+)'), itemName:match('group:%S+ (%S+)') or 1
if group == nil then
local recipeItem = ItemStack(itemName)
recipe = recipe..'- '..core.strip_colors(recipeItem:get_definition()._title)..' x'..recipeItem:get_count()..'\n'
else
recipe = recipe..'- any item from the group "'..group..'" x'..count..'\n'
end
end
CraftPane: