1 print("Initializing nodes")
3 minetest.register_node("main:stone", {
6 groups = {stone = 1, hard = 1, pickaxe = 1, hand = 4},
7 sounds = main.stoneSound(),
11 local ores = {"coal","iron","gold","diamond"}
12 for id,ore in pairs(ores) do
13 local drop = "main:"..ore.."ore"
14 if ore == "diamond" then drop = "main:diamond" elseif ore == "coal" then drop = "main:coal" end
16 minetest.register_node("main:"..ore.."ore", {
17 description = ore:gsub("^%l", string.upper).." Ore",
18 tiles = {"stone.png^"..ore.."ore.png"},
19 groups = {stone = id, hard = id, pickaxe = 1, hand = 4},
20 sounds = main.stoneSound(),
21 --light_source = 14,--debugging ore spawn
26 minetest.register_node("main:cobble", {
27 description = "Cobblestone",
28 tiles = {"cobble.png"},
29 groups = {stone = 2, hard = 1, pickaxe = 2, hand = 4},
30 sounds = main.stoneSound(),
33 minetest.register_node("main:dirt", {
36 groups = {dirt = 1, soft = 1, shovel = 1, hand = 1},
37 sounds = main.grassSound(),
40 minetest.register_node("main:grass", {
41 description = "Grass",
42 tiles = {"grass.png"},
43 groups = {dirt = 1, soft = 1, shovel = 1, hand = 1},
44 sounds = main.grassSound(),
48 minetest.register_node("main:sand", {
51 groups = {dirt = 1, sand = 1, soft = 1, shovel = 1, hand = 1},
52 sounds = main.sandSound(),
55 minetest.register_node("main:tree", {
57 tiles = {"treeCore.png","treeCore.png","treeOut.png","treeOut.png","treeOut.png","treeOut.png"},
58 groups = {wood = 2, tree = 1, hard = 1, axe = 1, hand = 3},
59 sounds = main.woodSound(),
60 --set metadata so treecapitator doesn't destroy houses
61 on_place = function(itemstack, placer, pointed_thing)
62 local pos = pointed_thing.above
63 minetest.item_place_node(itemstack, placer, pointed_thing)
64 local meta = minetest.get_meta(pos)
65 meta:set_string("placed", "true")
68 --treecapitator - move treecapitator into own file using override
69 on_dig = function(pos, node, digger)
71 --check if wielding axe?
73 local meta = minetest.get_meta(pos)
74 if not meta:contains("placed") then
78 if minetest.get_node(vector.new(pos.x,pos.y+y,pos.z)).name == "main:tree" then
79 minetest.node_dig(vector.new(pos.x,pos.y+y,pos.z), node, digger)
83 minetest.node_dig(pos, node, digger)
88 minetest.register_node("main:wood", {
91 groups = {wood = 1, hard = 1, axe = 1, hand = 3},
92 sounds = main.woodSound(),
95 minetest.register_node("main:leaves", {
96 description = "Leaves",
97 drawtype = "allfaces_optional",
102 is_ground_content = false,
103 tiles = {"leaves.png"},
104 groups = {leaves = 1, plant = 1, axe = 1, hand = 0, leafdecay = 1},
105 sounds = main.grassSound(),
110 -- Only drop if using a tool whose name is identical to one
112 tools = {"main:shears"},
114 items = {"main:leaves"},
115 -- Whether all items in the dropped item list inherit the
116 -- hardware coloring palette color from the dug node.
117 -- Default is 'false'.
118 --inherit_color = true,
121 -- Only drop if using a tool whose name is identical to one
123 tools = {"main:shears"},
125 items = {"main:stick"},
126 -- Whether all items in the dropped item list inherit the
127 -- hardware coloring palette color from the dug node.
128 -- Default is 'false'.
129 --inherit_color = true,
132 -- Only drop if using a tool whose name is identical to one
134 tools = {"main:shears"},
136 items = {"main:apple"},
137 -- Whether all items in the dropped item list inherit the
138 -- hardware coloring palette color from the dug node.
139 -- Default is 'false'.
140 --inherit_color = true,
146 minetest.register_node("main:waterSource", {
147 description = "Water Source",
152 name = "waterSource.png",
153 backface_culling = false,
155 type = "vertical_frames",
162 name = "waterSource.png",
163 backface_culling = true,
165 type = "vertical_frames",
178 is_ground_content = false,
181 liquidtype = "source",
182 liquid_alternative_flowing = "main:waterFlow",
183 liquid_alternative_source = "main:waterSource",
184 liquid_viscosity = 1,
185 post_effect_color = {a = 103, r = 30, g = 60, b = 90},
186 groups = {water = 1, liquid = 1, cools_lava = 1, bucket = 1, source = 1},
187 --sounds = default.node_sound_water_defaults(),
190 minetest.register_node("main:waterFlow", {
191 description = "Water Flow",
192 drawtype = "flowingliquid",
194 tiles = {"water.png"},
197 name = "waterFlow.png",
198 backface_culling = false,
200 type = "vertical_frames",
207 name = "waterFlow.png",
208 backface_culling = true,
210 type = "vertical_frames",
219 paramtype2 = "flowingliquid",
224 is_ground_content = false,
227 liquidtype = "flowing",
228 liquid_alternative_flowing = "main:waterFlow",
229 liquid_alternative_source = "main:waterSource",
230 liquid_viscosity = 1,
231 post_effect_color = {a = 103, r = 30, g = 60, b = 90},
232 groups = {water = 1, liquid = 1, notInCreative = 1, cools_lava = 1},
233 --sounds = default.node_sound_water_defaults(),
238 minetest.register_node("default:lava_source", {
239 description = S("Lava Source"),
243 name = "default_lava_source_animated.png",
244 backface_culling = false,
246 type = "vertical_frames",
253 name = "default_lava_source_animated.png",
254 backface_culling = true,
256 type = "vertical_frames",
264 light_source = default.LIGHT_MAX - 1,
269 is_ground_content = false,
272 liquidtype = "source",
273 liquid_alternative_flowing = "default:lava_flowing",
274 liquid_alternative_source = "default:lava_source",
275 liquid_viscosity = 7,
276 liquid_renewable = false,
277 damage_per_second = 4 * 2,
278 post_effect_color = {a = 191, r = 255, g = 64, b = 0},
279 groups = {lava = 3, liquid = 2, igniter = 1},
282 minetest.register_node("default:lava_flowing", {
283 description = S("Flowing Lava"),
284 drawtype = "flowingliquid",
285 tiles = {"default_lava.png"},
288 name = "default_lava_flowing_animated.png",
289 backface_culling = false,
291 type = "vertical_frames",
298 name = "default_lava_flowing_animated.png",
299 backface_culling = true,
301 type = "vertical_frames",
309 paramtype2 = "flowingliquid",
310 light_source = default.LIGHT_MAX - 1,
315 is_ground_content = false,
318 liquidtype = "flowing",
319 liquid_alternative_flowing = "default:lava_flowing",
320 liquid_alternative_source = "default:lava_source",
321 liquid_viscosity = 7,
322 liquid_renewable = false,
323 damage_per_second = 4 * 2,
324 post_effect_color = {a = 191, r = 255, g = 64, b = 0},
325 groups = {lava = 3, liquid = 2, igniter = 1,
326 not_in_creative_inventory = 1},