Add timer blocks
This commit is contained in:
parent
7bd641aced
commit
93af1c7442
53
init.lua
53
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",
|
||||
|
BIN
textures/pseudonodes_pseudo_block_timer_animated.png
Normal file
BIN
textures/pseudonodes_pseudo_block_timer_animated.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 115 B |
BIN
textures/pseudonodes_replacable_pseudo_block_timer_animated.png
Normal file
BIN
textures/pseudonodes_replacable_pseudo_block_timer_animated.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 129 B |
Loading…
x
Reference in New Issue
Block a user