mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-23 19:11:06 +01:00
50 lines
1.7 KiB
Lua
50 lines
1.7 KiB
Lua
minetest.register_node("mcl_observers:observer", {
|
|
description = "Observer",
|
|
is_ground_content = false,
|
|
sounds = mcl_sounds.node_sound_stone_defaults(),
|
|
paramtype2 = "facedir",
|
|
-- TODO: Add to craft guide and creative inventory when it's useful
|
|
groups = {pickaxey=1, not_in_craft_guide=1, not_in_creative_inventory=1 },
|
|
tiles = {
|
|
"mcl_observers_observer_top.png", "default_furnace_bottom.png",
|
|
"mcl_observers_observer_side.png", "mcl_observers_observer_side.png",
|
|
"mcl_observers_observer_front.png", "mcl_observers_observer_back.png",
|
|
},
|
|
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
|
local meta = minetest.get_meta(pos)
|
|
local meta2 = meta
|
|
meta:from_table(oldmetadata)
|
|
local inv = meta:get_inventory()
|
|
for i=1, inv:get_size("main") do
|
|
local stack = inv:get_stack("main", i)
|
|
if not stack:is_empty() then
|
|
local p = {x=pos.x+math.random(0, 10)/10-0.5, y=pos.y, z=pos.z+math.random(0, 10)/10-0.5}
|
|
minetest.add_item(p, stack)
|
|
end
|
|
end
|
|
meta:from_table(meta2:to_table())
|
|
end,
|
|
_mcl_blast_resistance = 17.5,
|
|
_mcl_hardness = 3.5,
|
|
-- TODO: Mesecons handling
|
|
mesecons = {effector = {
|
|
}}
|
|
})
|
|
|
|
minetest.register_craft({
|
|
output = "mcl_observers:observer",
|
|
recipe = {
|
|
{ "mcl_core:cobble", "mcl_core:cobble", "mcl_core:cobble" },
|
|
{ "mcl_nether:quartz", "mesecons:redstone", "mesecons:redstone" },
|
|
{ "mcl_core:cobble", "mcl_core:cobble", "mcl_core:cobble" },
|
|
}
|
|
})
|
|
minetest.register_craft({
|
|
output = "mcl_observers:observer",
|
|
recipe = {
|
|
{ "mcl_core:cobble", "mcl_core:cobble", "mcl_core:cobble" },
|
|
{ "mesecons:redstone", "mesecons:redstone", "mcl_nether:quartz" },
|
|
{ "mcl_core:cobble", "mcl_core:cobble", "mcl_core:cobble" },
|
|
}
|
|
})
|
|
|