Remove switch block drops
[minetest_pseudonodes.git] / init.lua
blob13f0e05c1ca05ec8b03cadeaaa9fce73065f1984
1 minetest.register_node("pseudonodes:pseudo_block", {
2 description = "pseudo-block",
3 drawtype = "glasslike",
4 paramtype = "light",
5 tiles = { "pseudonodes_pseudo_block.png" },
6 inventory_image = minetest.inventorycube("pseudonodes_pseudo_block.png"),
7 groups = { pseudo = 1 },
8 sunlight_propagates = true,
9 walkable = false,
10 sounds = { dig = { name="", gain = 0 } },
11 alpha = 0,
12 stack_max = 9999,
13 drop = "",
15 minetest.register_node("pseudonodes:replacable_pseudo_block", {
16 description = "replacable fixed pseudo-block",
17 drawtype = "glasslike",
18 paramtype = "light",
19 tiles = { "pseudonodes_replacable_pseudo_block.png" },
20 inventory_image = minetest.inventorycube("pseudonodes_replacable_pseudo_block.png"),
21 groups = { pseudo = 1 },
22 sunlight_propagates = true,
23 walkable = false,
24 sounds = { dig = { name="", gain = 0 } },
25 alpha = 0,
26 buildable_to = true,
27 stack_max = 9999,
28 drop = "",
31 minetest.register_node("pseudonodes:pseudo_block_timer", {
32 description = "timed pseudo-block",
33 drawtype = "glasslike",
34 paramtype = "light",
35 tiles = {
37 image="pseudonodes_pseudo_block_timer_animated.png",
38 animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2}
41 inventory_image = minetest.inventorycube("pseudonodes_pseudo_block_timer.png"),
42 groups = { pseudo = 1 },
43 sunlight_propagates = true,
44 walkable = false,
45 sounds = { dig = { name="", gain = 0 } },
46 alpha = 0,
47 stack_max = 9999,
48 drop = "",
49 on_construct = function(pos)
50 local timer = minetest.get_node_timer(pos)
51 timer:start(5)
52 end,
53 on_timer = function(pos,elapsed)
54 minetest.remove_node(pos)
55 end,
58 minetest.register_node("pseudonodes:replacable_pseudo_block_timer", {
59 description = "replacable timed pseudo-block",
60 drawtype = "glasslike",
61 paramtype = "light",
62 tiles = {
64 image="pseudonodes_replacable_pseudo_block_timer_animated.png",
65 animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2}
68 inventory_image = minetest.inventorycube("pseudonodes_replacable_pseudo_block_timer.png"),
69 groups = { pseudo = 1 },
70 sunlight_propagates = true,
71 walkable = false,
72 sounds = { dig = { name="", gain = 0 } },
73 alpha = 0,
74 buildable_to = true,
75 stack_max = 9999,
76 drop = "",
77 on_construct = function(pos)
78 local timer = minetest.get_node_timer(pos)
79 timer:start(5)
80 end,
81 on_timer = function(pos,elapsed)
82 minetest.remove_node(pos)
83 end,
86 minetest.register_node("pseudonodes:switch_block_off", {
87 description = "switch block (off)",
88 drawtype = "glasslike",
89 paramtype = "light",
90 tiles = { "pseudonodes_switch_block_off.png" },
91 inventory_image = minetest.inventorycube("pseudonodes_switch_block_off.png"),
92 sunlight_propagates = true,
93 walkable = false,
94 sounds = { dig = { name="", gain = 0 } },
95 groups = { pseudo = 1 },
96 alpha = 0,
97 stack_max = 9999,
98 drop = "",
99 on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
100 local newnode = node
101 newnode.name = "pseudonodes:switch_block_on"
102 minetest.swap_node(pos, newnode)
103 return itemstack
104 end,
107 minetest.register_node("pseudonodes:switch_block_on", {
108 description = "switch block (on)",
109 tiles = { "pseudonodes_switch_block_on.png" },
110 inventory_image = minetest.inventorycube("pseudonodes_switch_block_on.png"),
111 groups = { pseudo = 1 },
112 diggable = true,
113 walkable = true,
114 stack_max = 9999,
115 drop = "",
116 on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
117 local newnode = node
118 newnode.name = "pseudonodes:switch_block_off"
119 minetest.swap_node(pos, newnode)
120 return itemstack
121 end,
125 minetest.register_tool("pseudonodes:pick", {
126 description = "pseudo-pick",
127 inventory_image = "pseudonodes_pick.png",
128 tool_capabilities = {
129 groupcaps = { pseudo = { times = {[1]=0}, maxlevel=1, maxwear=0 }},