minetest_pseudonodes/init.lua

168 lines
4.7 KiB
Lua
Raw Normal View History

2016-08-11 09:36:25 -07:00
local S
if (minetest.get_modpath("intllib")) then
2016-11-08 17:29:56 -08:00
S = intllib.Getter()
else
S = function ( s ) return s end
end
2014-06-25 16:35:01 -07:00
minetest.register_node("pseudonodes:pseudo_block", {
2016-11-10 06:19:40 -08:00
description = S("Pseudo-block"),
2014-10-09 07:31:20 -07:00
drawtype = "glasslike_framed",
2014-06-25 16:35:01 -07:00
paramtype = "light",
2014-10-09 07:31:20 -07:00
tiles = { "pseudonodes_pseudo_block.png", "pseudonodes_nothing.png" },
2014-06-25 16:35:01 -07:00
inventory_image = minetest.inventorycube("pseudonodes_pseudo_block.png"),
2014-06-25 16:48:26 -07:00
groups = { pseudo = 1 },
2016-11-01 17:08:49 -07:00
is_ground_content = false,
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 17:45:29 -07:00
drop = "",
on_blast = function() end,
2014-06-25 16:35:01 -07:00
})
minetest.register_node("pseudonodes:replacable_pseudo_block", {
2016-11-10 06:19:40 -08:00
description = S("Replacable pseudo-block"),
2014-10-09 07:31:20 -07:00
drawtype = "glasslike_framed",
2014-06-25 16:35:01 -07:00
paramtype = "light",
2014-10-09 07:31:20 -07:00
tiles = { "pseudonodes_replacable_pseudo_block.png", "pseudonodes_nothing.png" },
2014-06-25 16:35:01 -07:00
inventory_image = minetest.inventorycube("pseudonodes_replacable_pseudo_block.png"),
2014-06-25 16:48:26 -07:00
groups = { pseudo = 1 },
2016-11-01 17:08:49 -07:00
is_ground_content = false,
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 17:45:29 -07:00
drop = "",
on_blast = function() end,
2014-06-28 14:49:30 -07:00
})
minetest.register_node("pseudonodes:replacable_block", {
2016-11-10 06:19:40 -08:00
description = S("Replacable block"),
2014-06-28 14:49:30 -07:00
tiles = { "pseudonodes_replacable_block.png" },
groups = { pseudo = 1 },
2016-11-01 17:08:49 -07:00
is_ground_content = false,
2014-06-28 14:49:30 -07:00
walkable = true,
buildable_to = true,
sounds = { dig = { name="", gain = 0 } },
stack_max = 9999,
drop = "",
on_blast = function() end,
2014-06-25 16:35:01 -07:00
})
2014-06-25 17:17:00 -07:00
minetest.register_node("pseudonodes:pseudo_block_timer", {
2016-11-10 06:19:40 -08:00
description = S("Timed pseudo-block"),
2014-10-09 07:31:20 -07:00
drawtype = "glasslike_framed",
2014-06-25 17:17:00 -07:00
paramtype = "light",
tiles = {
{
image="pseudonodes_pseudo_block_timer_animated.png",
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2}
2014-10-09 07:31:20 -07:00
},
"pseudonodes_nothing.png",
2014-06-25 17:17:00 -07:00
},
inventory_image = minetest.inventorycube("pseudonodes_pseudo_block_timer.png"),
groups = { pseudo = 1 },
2016-11-01 17:08:49 -07:00
is_ground_content = false,
2014-06-25 17:17:00 -07:00
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:45:29 -07:00
drop = "",
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,
on_blast = function() end,
2014-06-25 17:17:00 -07:00
})
minetest.register_node("pseudonodes:replacable_pseudo_block_timer", {
2016-11-10 06:19:40 -08:00
description = S("Replacable timed pseudo-block"),
2014-10-09 07:31:20 -07:00
drawtype = "glasslike_framed",
2014-06-25 17:17:00 -07:00
paramtype = "light",
tiles = {
{
image="pseudonodes_replacable_pseudo_block_timer_animated.png",
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2}
2014-10-09 07:31:20 -07:00
},
"pseudonodes_nothing.png",
2014-06-25 17:17:00 -07:00
},
inventory_image = minetest.inventorycube("pseudonodes_replacable_pseudo_block_timer.png"),
groups = { pseudo = 1 },
2016-11-01 17:08:49 -07:00
is_ground_content = false,
2014-06-25 17:17:00 -07:00
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:45:29 -07:00
drop = "",
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,
on_blast = function() end,
2014-06-25 17:17:00 -07:00
})
2014-06-25 16:35:01 -07:00
minetest.register_node("pseudonodes:switch_block_off", {
2016-11-10 06:19:40 -08:00
description = S("Switch block (off)"),
2014-06-25 16:35:01 -07:00
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 },
2016-11-01 17:08:49 -07:00
is_ground_content = false,
2014-06-25 16:35:01 -07:00
alpha = 0,
2014-06-25 17:44:09 -07:00
stack_max = 9999,
2014-06-25 17:48:17 -07:00
drop = "",
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,
on_blast = function() end,
2014-06-25 16:35:01 -07:00
})
minetest.register_node("pseudonodes:switch_block_on", {
2016-11-10 06:19:40 -08:00
description = S("Switch block (on)"),
2014-06-25 16:35:01 -07:00
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 },
2016-11-01 17:08:49 -07:00
is_ground_content = false,
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 17:45:29 -07:00
drop = "",
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,
on_blast = function(pos, intensity)
minetest.set_node(pos, {name="pseudonodes:switch_block_off"})
end,
2014-06-25 16:35:01 -07:00
})
2014-06-25 16:48:26 -07:00
minetest.register_tool("pseudonodes:pick", {
2016-11-10 06:19:40 -08:00
description = S("Pseudo-pick"),
2014-06-25 16:48:26 -07:00
inventory_image = "pseudonodes_pick.png",
tool_capabilities = {
groupcaps = { pseudo = { times = {[1]=0}, maxlevel=1, maxwear=0 }},
},
})