CraftSystem: BaseCraftHandler: use Smc.matchItemDescription()
This commit is contained in:
@@ -239,14 +239,7 @@ local function getMathedCrafts(crafts, pattern)
|
|||||||
local matchedCrafts = {}
|
local matchedCrafts = {}
|
||||||
|
|
||||||
for _, craft in ipairs(crafts) do
|
for _, craft in ipairs(crafts) do
|
||||||
local outputItem = ItemStack(craft.output)
|
if Smc.matchItemDescription(ItemStack(craft.output):get_name(), pattern) then
|
||||||
local itemSettings = Smc.getItemDefinition(outputItem).settings
|
|
||||||
local ruName = stringLower(core.get_translated_string('ru', itemSettings._title))
|
|
||||||
local enName = stringLower(core.get_translated_string('en', itemSettings._title))
|
|
||||||
|
|
||||||
if stringMatch(outputItem:get_name(), pattern) or
|
|
||||||
stringMatch(ruName, pattern) or
|
|
||||||
stringMatch(enName, pattern) then
|
|
||||||
tableInsert(matchedCrafts, craft)
|
tableInsert(matchedCrafts, craft)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user