Add missing power storage nodes crafts

This commit is contained in:
2023-04-19 09:25:51 +02:00
parent 6c829e5d47
commit 2205b320cd
4 changed files with 93 additions and 4 deletions

23
api.lua
View File

@@ -382,6 +382,29 @@ industrialtest.api.registerResourceDust=function(name,displayName,resources,colo
end
end
end
-- \brief Registers plate of certain resource
-- \param name Technical name of resource
-- \param displayName Display name of resource
-- \param resources List of tables with following keys: <output>, <recipe>, [count(1)]
-- <> - required, [] - optional, () - default value
-- \param color HTML color of plate
-- \param registerCompressorRecipe If true compressor recipe for plate will be registered
-- \returns nil
industrialtest.api.registerPlate=function(name,displayName,resources,color,registerCompressorRecipe)
minetest.register_craftitem("industrialtest:"..name.."_plate",{
description=S(displayName.." Plate"),
inventory_image="industrialtest_plate.png",
color=color
})
if registerCompressorRecipe then
for _,value in ipairs(resources) do
industrialtest.api.registerCompressorRecipe({
output="industrialtest:"..name.."_plate "..(value.count or 1),
recipe=value.resource
})
end
end
end
-- \brief Registers cell with certain fluid
-- \param name Technical name of cell
-- \param displayName Display name of cell