fuzzy recipe ingredients
This commit is contained in:
@@ -146,11 +146,12 @@ function itemDB:getName(item)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- fallback to nameDB
|
-- fallback to nameDB
|
||||||
local name = nameDB:getName(item.name .. ':' .. (item.damage or '*'))
|
local strId = self:makeKey(item)
|
||||||
|
local name = nameDB.data[strId]
|
||||||
if not name and not item.damage then
|
if not name and not item.damage then
|
||||||
return self:getName({ name = item.name, damage = 0, nbtHash = item.nbtHash })
|
name = nameDB.data[self:makeKey({ name = item.name, damage = 0, nbtHash = item.nbtHash })]
|
||||||
end
|
end
|
||||||
return name
|
return name or strId
|
||||||
end
|
end
|
||||||
|
|
||||||
function itemDB:getMaxCount(item)
|
function itemDB:getMaxCount(item)
|
||||||
|
|||||||
@@ -168,9 +168,10 @@ function Craft.findRecipe(key)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- handle cases where the request is like : IC2:reactorVent:*
|
-- handle cases where the request is like : IC2:reactorVent:*
|
||||||
for _,recipe in pairs(Craft.recipes) do
|
for rkey,recipe in pairs(Craft.recipes) do
|
||||||
if item.name == recipe.name and
|
local r = itemDB:splitKey(rkey)
|
||||||
(not item.nbtHash or recipe.nbtHash == item.nbtHash) then
|
if item.name == r.name and
|
||||||
|
(not item.nbtHash or r.nbtHash == item.nbtHash) then
|
||||||
return recipe
|
return recipe
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user