added blueprints

This commit is contained in:
cale 2016-02-26 16:28:05 +01:00
parent 9e7752b895
commit 254103106d
6 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1 @@
default

26
mods/blueprint/init.lua Normal file
View File

@ -0,0 +1,26 @@
blueprint = {}
blueprint.all = {}
function blueprint.register_blueprint(name, def)
table.insert(def.materials, "blueprint:"..name)
table.insert(blueprint.all, "blueprint:"..name)
minetest.register_craftitem(":blueprint:"..name, {
description = "Blueprint : " .. def.description,
inventory_image = "blueprint_blueprint.png",
})
minetest.register_craft({
type = "shapeless",
output = def.out,
recipe = def.materials,
replacements = {
{"blueprint:"..name, "blueprint:"..name}
}
})
end
minetest.register_craftitem("blueprint:empty", {
description = "Empty Blueprint",
inventory_image = "blueprint_empty.png",
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

View File

@ -1 +1,2 @@
default
blueprint

View File

@ -106,3 +106,17 @@ minetest.register_abm({
end
end,
})
-- craft
blueprint.register_blueprint("pipe", {
description = "Pipe",
materials = {"furnace:iron_plate"},
out = "pipe:pipe"
})
blueprint.register_blueprint("pump", {
description = "Pump",
materials = {"furnace:iron_plate", "furnace:iron_plate", "furnace:iron_plate", "pipe:pipe"},
out = "pipe:pump"
})