diff --git a/init.lua b/init.lua index 5283c11..867bb8e 100644 --- a/init.lua +++ b/init.lua @@ -11,7 +11,7 @@ minetest.register_node("pseudonodes:pseudo_block", { alpha = 0 }) minetest.register_node("pseudonodes:replacable_pseudo_block", { - description = "replacable pseudo-block", + description = "replacable fixed pseudo-block", drawtype = "glasslike", paramtype = "light", tiles = { "pseudonodes_replacable_pseudo_block.png" }, @@ -24,6 +24,57 @@ minetest.register_node("pseudonodes:replacable_pseudo_block", { buildable_to = true }) +minetest.register_node("pseudonodes:pseudo_block_timer", { + description = "timed pseudo-block", + drawtype = "glasslike", + paramtype = "light", + tiles = { + { + image="pseudonodes_pseudo_block_timer_animated.png", + animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2} + } + }, + inventory_image = minetest.inventorycube("pseudonodes_pseudo_block_timer.png"), + groups = { pseudo = 1 }, + sunlight_propagates = true, + walkable = false, + sounds = { dig = { name="", gain = 0 } }, + alpha = 0, + on_construct = function(pos) + local timer = minetest.get_node_timer(pos) + timer:start(5) + end, + on_timer = function(pos,elapsed) + minetest.remove_node(pos) + end, +}) + +minetest.register_node("pseudonodes:replacable_pseudo_block_timer", { + description = "replacable timed pseudo-block", + drawtype = "glasslike", + paramtype = "light", + tiles = { + { + image="pseudonodes_replacable_pseudo_block_timer_animated.png", + animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2} + } + }, + inventory_image = minetest.inventorycube("pseudonodes_replacable_pseudo_block_timer.png"), + groups = { pseudo = 1 }, + sunlight_propagates = true, + walkable = false, + sounds = { dig = { name="", gain = 0 } }, + alpha = 0, + buildable_to = true, + on_construct = function(pos) + local timer = minetest.get_node_timer(pos) + timer:start(5) + end, + on_timer = function(pos,elapsed) + minetest.remove_node(pos) + end, +}) + minetest.register_node("pseudonodes:switch_block_off", { description = "switch block (off)", drawtype = "glasslike", diff --git a/textures/pseudonodes_pseudo_block_timer_animated.png b/textures/pseudonodes_pseudo_block_timer_animated.png new file mode 100644 index 0000000..ec15fb6 Binary files /dev/null and b/textures/pseudonodes_pseudo_block_timer_animated.png differ diff --git a/textures/pseudonodes_replacable_pseudo_block_timer_animated.png b/textures/pseudonodes_replacable_pseudo_block_timer_animated.png new file mode 100644 index 0000000..8b34a1e Binary files /dev/null and b/textures/pseudonodes_replacable_pseudo_block_timer_animated.png differ