mirror of
https://github.com/minetest-mods/craftguide.git
synced 2025-03-20 19:50:18 +01:00
Put back some code because it was actually useful
This commit is contained in:
parent
74785bca5e
commit
2b8dbcea49
32
init.lua
32
init.lua
@ -1466,9 +1466,39 @@ core.register_craft = function(def)
|
|||||||
local name = output[i]
|
local name = output[i]
|
||||||
|
|
||||||
if def.type == "fuel" then
|
if def.type == "fuel" then
|
||||||
def.replacements = def.replacements
|
|
||||||
def.items = {def.recipe}
|
def.items = {def.recipe}
|
||||||
fuel_cache[name] = def
|
fuel_cache[name] = def
|
||||||
|
|
||||||
|
elseif def.type == "cooking" then
|
||||||
|
def.items = {def.recipe}
|
||||||
|
|
||||||
|
elseif def.type == "shapeless" then
|
||||||
|
def.items, def.width = {}, 0
|
||||||
|
for j = 1, #def.recipe do
|
||||||
|
def.items[#def.items + 1] = def.recipe[j]
|
||||||
|
end
|
||||||
|
else
|
||||||
|
def.items, def.width = {}, #def.recipe[1]
|
||||||
|
local c = 0
|
||||||
|
|
||||||
|
for j = 1, #def.recipe do
|
||||||
|
if def.recipe[j] then
|
||||||
|
for h = 1, def.width do
|
||||||
|
c = c + 1
|
||||||
|
local it = def.recipe[j][h]
|
||||||
|
|
||||||
|
if it and it ~= "" then
|
||||||
|
def.items[c] = it
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if def.type ~= "fuel" then
|
||||||
|
def.recipe = nil
|
||||||
|
recipes_cache[name] = recipes_cache[name] or {}
|
||||||
|
insert(recipes_cache[name], 1, def)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user