minetest_pseudonodes/init.lua

126 lines
3.6 KiB
Lua
Raw Normal View History

2014-06-25 16:35:01 -07:00
minetest.register_node("pseudonodes:pseudo_block", {
description = "pseudo-block",
drawtype = "glasslike",
paramtype = "light",
tiles = { "pseudonodes_pseudo_block.png" },
inventory_image = minetest.inventorycube("pseudonodes_pseudo_block.png"),
2014-06-25 16:48:26 -07:00
groups = { pseudo = 1 },
2014-06-25 16:35:01 -07:00
sunlight_propagates = true,
walkable = false,
sounds = { dig = { name="", gain = 0 } },
2014-06-25 17:44:09 -07:00
alpha = 0,
stack_max = 9999,
2014-06-25 16:35:01 -07:00
})
minetest.register_node("pseudonodes:replacable_pseudo_block", {
2014-06-25 17:17:00 -07:00
description = "replacable fixed pseudo-block",
2014-06-25 16:35:01 -07:00
drawtype = "glasslike",
paramtype = "light",
tiles = { "pseudonodes_replacable_pseudo_block.png" },
inventory_image = minetest.inventorycube("pseudonodes_replacable_pseudo_block.png"),
2014-06-25 16:48:26 -07:00
groups = { pseudo = 1 },
2014-06-25 16:35:01 -07:00
sunlight_propagates = true,
walkable = false,
sounds = { dig = { name="", gain = 0 } },
alpha = 0,
2014-06-25 17:44:09 -07:00
buildable_to = true,
stack_max = 9999,
2014-06-25 16:35:01 -07:00
})
2014-06-25 17:17:00 -07:00
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,
2014-06-25 17:44:09 -07:00
stack_max = 9999,
2014-06-25 17:17:00 -07:00
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,
2014-06-25 17:44:09 -07:00
stack_max = 9999,
2014-06-25 17:17:00 -07:00
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,
})
2014-06-25 16:35:01 -07:00
minetest.register_node("pseudonodes:switch_block_off", {
description = "switch block (off)",
drawtype = "glasslike",
paramtype = "light",
tiles = { "pseudonodes_switch_block_off.png" },
inventory_image = minetest.inventorycube("pseudonodes_switch_block_off.png"),
sunlight_propagates = true,
walkable = false,
sounds = { dig = { name="", gain = 0 } },
2014-06-25 16:48:26 -07:00
groups = { pseudo = 1 },
2014-06-25 16:35:01 -07:00
alpha = 0,
2014-06-25 17:44:09 -07:00
stack_max = 9999,
2014-06-25 16:35:01 -07:00
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local newnode = node
newnode.name = "pseudonodes:switch_block_on"
minetest.swap_node(pos, newnode)
return itemstack
end,
})
minetest.register_node("pseudonodes:switch_block_on", {
description = "switch block (on)",
tiles = { "pseudonodes_switch_block_on.png" },
inventory_image = minetest.inventorycube("pseudonodes_switch_block_on.png"),
2014-06-25 16:48:26 -07:00
groups = { pseudo = 1 },
2014-06-25 16:35:01 -07:00
diggable = true,
walkable = true,
2014-06-25 17:44:09 -07:00
stack_max = 9999,
2014-06-25 16:35:01 -07:00
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local newnode = node
newnode.name = "pseudonodes:switch_block_off"
minetest.swap_node(pos, newnode)
return itemstack
end,
})
2014-06-25 16:48:26 -07:00
minetest.register_tool("pseudonodes:pick", {
description = "pseudo-pick",
inventory_image = "pseudonodes_pick.png",
tool_capabilities = {
groupcaps = { pseudo = { times = {[1]=0}, maxlevel=1, maxwear=0 }},
},
})