Add screenshot
[minetest_pseudonodes.git] / init.lua
blobc5a0c9798d15af12281a7846ed459feed95255a9
1 local S
2 if (minetest.get_modpath("intllib")) then
3 dofile(minetest.get_modpath("intllib").."/intllib.lua")
4 S = intllib.Getter(minetest.get_current_modname())
5 else
6 S = function ( s ) return s end
7 end
9 minetest.register_node("pseudonodes:pseudo_block", {
10 description = S("pseudo-block"),
11 drawtype = "glasslike_framed",
12 paramtype = "light",
13 tiles = { "pseudonodes_pseudo_block.png", "pseudonodes_nothing.png" },
14 inventory_image = minetest.inventorycube("pseudonodes_pseudo_block.png"),
15 groups = { pseudo = 1 },
16 is_ground_content = false,
17 sunlight_propagates = true,
18 walkable = false,
19 sounds = { dig = { name="", gain = 0 } },
20 alpha = 0,
21 stack_max = 9999,
22 drop = "",
23 on_blast = function() end,
25 minetest.register_node("pseudonodes:replacable_pseudo_block", {
26 description = S("replacable pseudo-block"),
27 drawtype = "glasslike_framed",
28 paramtype = "light",
29 tiles = { "pseudonodes_replacable_pseudo_block.png", "pseudonodes_nothing.png" },
30 inventory_image = minetest.inventorycube("pseudonodes_replacable_pseudo_block.png"),
31 groups = { pseudo = 1 },
32 is_ground_content = false,
33 sunlight_propagates = true,
34 walkable = false,
35 sounds = { dig = { name="", gain = 0 } },
36 alpha = 0,
37 buildable_to = true,
38 stack_max = 9999,
39 drop = "",
40 on_blast = function() end,
43 minetest.register_node("pseudonodes:replacable_block", {
44 description = S("replacable block"),
45 tiles = { "pseudonodes_replacable_block.png" },
46 groups = { pseudo = 1 },
47 is_ground_content = false,
48 walkable = true,
49 buildable_to = true,
50 sounds = { dig = { name="", gain = 0 } },
51 stack_max = 9999,
52 drop = "",
53 on_blast = function() end,
56 minetest.register_node("pseudonodes:pseudo_block_timer", {
57 description = S("timed pseudo-block"),
58 drawtype = "glasslike_framed",
59 paramtype = "light",
60 tiles = {
62 image="pseudonodes_pseudo_block_timer_animated.png",
63 animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2}
65 "pseudonodes_nothing.png",
67 inventory_image = minetest.inventorycube("pseudonodes_pseudo_block_timer.png"),
68 groups = { pseudo = 1 },
69 is_ground_content = false,
70 sunlight_propagates = true,
71 walkable = false,
72 sounds = { dig = { name="", gain = 0 } },
73 alpha = 0,
74 stack_max = 9999,
75 drop = "",
76 on_construct = function(pos)
77 local timer = minetest.get_node_timer(pos)
78 timer:start(5)
79 end,
80 on_timer = function(pos,elapsed)
81 minetest.remove_node(pos)
82 end,
83 on_blast = function() end,
86 minetest.register_node("pseudonodes:replacable_pseudo_block_timer", {
87 description = S("replacable timed pseudo-block"),
88 drawtype = "glasslike_framed",
89 paramtype = "light",
90 tiles = {
92 image="pseudonodes_replacable_pseudo_block_timer_animated.png",
93 animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2}
95 "pseudonodes_nothing.png",
97 inventory_image = minetest.inventorycube("pseudonodes_replacable_pseudo_block_timer.png"),
98 groups = { pseudo = 1 },
99 is_ground_content = false,
100 sunlight_propagates = true,
101 walkable = false,
102 sounds = { dig = { name="", gain = 0 } },
103 alpha = 0,
104 buildable_to = true,
105 stack_max = 9999,
106 drop = "",
107 on_construct = function(pos)
108 local timer = minetest.get_node_timer(pos)
109 timer:start(5)
110 end,
111 on_timer = function(pos,elapsed)
112 minetest.remove_node(pos)
113 end,
114 on_blast = function() end,
117 minetest.register_node("pseudonodes:switch_block_off", {
118 description = S("switch block (off)"),
119 drawtype = "glasslike",
120 paramtype = "light",
121 tiles = { "pseudonodes_switch_block_off.png" },
122 inventory_image = minetest.inventorycube("pseudonodes_switch_block_off.png"),
123 sunlight_propagates = true,
124 walkable = false,
125 sounds = { dig = { name="", gain = 0 } },
126 groups = { pseudo = 1 },
127 is_ground_content = false,
128 alpha = 0,
129 stack_max = 9999,
130 drop = "",
131 on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
132 local newnode = node
133 newnode.name = "pseudonodes:switch_block_on"
134 minetest.swap_node(pos, newnode)
135 return itemstack
136 end,
137 on_blast = function() end,
140 minetest.register_node("pseudonodes:switch_block_on", {
141 description = S("switch block (on)"),
142 tiles = { "pseudonodes_switch_block_on.png" },
143 inventory_image = minetest.inventorycube("pseudonodes_switch_block_on.png"),
144 groups = { pseudo = 1 },
145 is_ground_content = false,
146 diggable = true,
147 walkable = true,
148 stack_max = 9999,
149 drop = "",
150 on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
151 local newnode = node
152 newnode.name = "pseudonodes:switch_block_off"
153 minetest.swap_node(pos, newnode)
154 return itemstack
155 end,
156 on_blast = function(pos, intensity)
157 minetest.set_node(pos, {name="pseudonodes:switch_block_off"})
158 end,
162 minetest.register_tool("pseudonodes:pick", {
163 description = S("pseudo-pick"),
164 inventory_image = "pseudonodes_pick.png",
165 tool_capabilities = {
166 groupcaps = { pseudo = { times = {[1]=0}, maxlevel=1, maxwear=0 }},