diff --git a/mods/redstone/mcl_observers/depends.txt b/mods/redstone/mcl_observers/depends.txt new file mode 100644 index 0000000000..95222145e8 --- /dev/null +++ b/mods/redstone/mcl_observers/depends.txt @@ -0,0 +1,2 @@ +mesecons +mcl_util diff --git a/mods/redstone/mcl_observers/init.lua b/mods/redstone/mcl_observers/init.lua new file mode 100644 index 0000000000..250abfb030 --- /dev/null +++ b/mods/redstone/mcl_observers/init.lua @@ -0,0 +1,48 @@ +minetest.register_node("mcl_observers:observer", { + description = "Observer (WIP)", + 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 = { cracky=2, 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, + -- 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" }, + } +}) + diff --git a/mods/redstone/mcl_observers/textures/mcl_observers_observer_back.png b/mods/redstone/mcl_observers/textures/mcl_observers_observer_back.png new file mode 100644 index 0000000000..3723fec741 Binary files /dev/null and b/mods/redstone/mcl_observers/textures/mcl_observers_observer_back.png differ diff --git a/mods/redstone/mcl_observers/textures/mcl_observers_observer_back_lit.png b/mods/redstone/mcl_observers/textures/mcl_observers_observer_back_lit.png new file mode 100644 index 0000000000..b467cfe7c1 Binary files /dev/null and b/mods/redstone/mcl_observers/textures/mcl_observers_observer_back_lit.png differ diff --git a/mods/redstone/mcl_observers/textures/mcl_observers_observer_front.png b/mods/redstone/mcl_observers/textures/mcl_observers_observer_front.png new file mode 100644 index 0000000000..1cd3591859 Binary files /dev/null and b/mods/redstone/mcl_observers/textures/mcl_observers_observer_front.png differ diff --git a/mods/redstone/mcl_observers/textures/mcl_observers_observer_side.png b/mods/redstone/mcl_observers/textures/mcl_observers_observer_side.png new file mode 100644 index 0000000000..fba7cf7044 Binary files /dev/null and b/mods/redstone/mcl_observers/textures/mcl_observers_observer_side.png differ diff --git a/mods/redstone/mcl_observers/textures/mcl_observers_observer_top.png b/mods/redstone/mcl_observers/textures/mcl_observers_observer_top.png new file mode 100644 index 0000000000..02c677c53e Binary files /dev/null and b/mods/redstone/mcl_observers/textures/mcl_observers_observer_top.png differ