melterns/tinkering/pattern.lua

23 lines
689 B
Lua
Raw Normal View History

2018-04-05 14:40:35 +02:00
tinkering.patterns = {}
2018-04-05 07:57:30 +02:00
-- Register a new pattern
function tinkering.register_pattern(name, data)
local mod = data.mod_name or minetest.get_current_modname()
2018-04-05 07:57:30 +02:00
local desc = data.description
2018-04-05 14:40:35 +02:00
tinkering.patterns[name] = data
2018-04-05 07:57:30 +02:00
minetest.register_craftitem(mod..":"..name.."_pattern", {
2018-04-05 14:40:35 +02:00
description = desc.." Pattern\n\nMaterial Cost: "..data.cost,
2018-04-05 07:57:30 +02:00
inventory_image = "tinkering_"..name.."_pattern.png",
2018-04-05 14:40:35 +02:00
groups = {tinker_pattern=1, ["tc_"..name] = 1}
2018-04-05 07:57:30 +02:00
})
end
-- Create blank pattern
minetest.register_craftitem("tinkering:blank_pattern", {
description = "Blank Pattern",
inventory_image = "tinkering_blank_pattern.png",
2018-04-05 14:40:35 +02:00
groups = {tinker_pattern=1}
2018-04-05 07:57:30 +02:00
})