partial support for technic recipes
This commit is contained in:
parent
7b2b9fcc71
commit
5f7e60b30d
@ -12,6 +12,9 @@ read_globals = {
|
||||
-- Minetest
|
||||
"minetest",
|
||||
"vector", "ItemStack",
|
||||
"dump"
|
||||
"dump",
|
||||
|
||||
-- optional deps
|
||||
"technic"
|
||||
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ function register_abm_label(abm, index){
|
||||
|
||||
} else {
|
||||
// try another index
|
||||
register_abm_label(abm, index || 1);
|
||||
register_abm_label(abm, (index || 0) + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
3
init.lua
3
init.lua
@ -15,7 +15,8 @@ dofile(MP .. "/textures.lua")
|
||||
minetest.register_on_mods_loaded(function()
|
||||
|
||||
-- workaround for empty translations, defer a globalstep until everything is initialized
|
||||
minetest.after(0, function()
|
||||
-- deferred by 1 second until technic.recipes is populated
|
||||
minetest.after(1, function()
|
||||
local start = minetest.get_us_time()
|
||||
|
||||
-- copy static assets
|
||||
|
23
recipes.lua
23
recipes.lua
@ -30,6 +30,29 @@ function mtinfo.export_recipes()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for recipe_type, entry in pairs(technic.recipes) do
|
||||
if entry.recipes then
|
||||
for name, recipe in pairs(entry.recipes) do
|
||||
local existing_recipes = data[name]
|
||||
if not existing_recipes then
|
||||
existing_recipes = {}
|
||||
end
|
||||
|
||||
table.insert(existing_recipes, {
|
||||
type = recipe_type,
|
||||
method = recipe_type,
|
||||
items = recipe.input,
|
||||
output = recipe.output,
|
||||
time = recipe.time
|
||||
})
|
||||
|
||||
data[name] = existing_recipes
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
mtinfo.export_json(mtinfo.basepath.."/data/recipes.js", data, "mtinfo.recipes")
|
||||
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user