mcl_vegan/mcl_vegan_utils/craft.lua

40 lines
762 B
Lua

function mcl_vegan.register_compress_recipe (input, output, def)
def = def or {}
if def.reversible == nil then def.reversible = true end
local reversible = def.reversible
if def.big == nil then def.big = true end
local big = def.big
local compress_factor = 4
if big then compress_factor = 9 end
if big then
minetest.register_craft({
output = output,
recipe = {
{ input, input, input },
{ input, input, input },
{ input, input, input },
},
})
else
minetest.register_craft({
output = output,
recipe = {
{ input, input },
{ input, input },
},
})
end
if reversible then
minetest.register_craft({
type = "shapeless",
output = input .. " " .. compress_factor,
recipe = { output },
})
end
end