mover block can now put stuff in chest if chest is target

recipe update:
4 coal blocks make 1 diamond
1 diamond + 8 steel makes 2 mese crystals
This commit is contained in:
rnd 2015-04-12 22:47:56 +02:00
parent e28b4ad6fd
commit 6f8a799f46
2 changed files with 34 additions and 0 deletions

View File

@ -92,6 +92,21 @@ minetest.register_node("mymod:mover", {
--minetest.chat_send_all(" moving ")
meta:set_float("fuel", fuel - 1);
meta:set_string("infotext", "Mover block. Fuel "..fuel-1);
-- if target chest put in chest
if node2.name == "default:chest" or node2.name == "default:chest_locked" then
local cmeta = minetest.get_meta(pos2);
local inv = cmeta:get_inventory();
local stack = ItemStack({name=node1.name})
if inv:room_for_item("main", stack) then
minetest.set_node(pos1, {name = "air"});
inv:add_item("main", stack);
else return
end
return
end
minetest.set_node(pos2, {name = node1.name});
minetest.set_node(pos1, {name = "air"});
local meta2 = minetest.get_meta(pos2);meta2:from_table(table1);

View File

@ -57,6 +57,7 @@ minetest.register_craft({
}
})
-- OTHER RECIPES
minetest.register_craft({
output = "default:papyrus",
@ -275,3 +276,21 @@ minetest.register_craft({
{"default:mese","default:mese","default:mese"},
}
})
-- ORES
minetest.register_craft({
output = "default:diamond",
recipe = {
{"default:coalblock", "default:coalblock",""},
{"default:coalblock", "default:coalblock",""}
}
})
minetest.register_craft({
output = "default:mese_crystal 2",
recipe = {
{"default:steel_ingot", "default:steel_ingot","default:steel_ingot"},
{"default:steel_ingot", "default:diamond","default:steel_ingot"},
{"default:steel_ingot", "default:steel_ingot","default:steel_ingot"}
}
})