PlayerInventory & PlayerInventoryUI: You can now specify groups as materials for primitive crafting in your inventory. #34
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user