1-- mods/default/nodes.lua
2
3-- support for MT game translation.
4local S = default.get_translator
5
6--[[ Node name convention:
7
8Although many node names are in combined-word form, the required form for new
9node names is words separated by underscores. If both forms are used in written
10language (for example pinewood and pine wood) the underscore form should be used.
11
12--]]
13
14
15--[[ Index:
16
17Stone
18-----
19(1. Material 2. Cobble variant 3. Brick variant 4. Modified forms)
20
21default:stone
22default:cobble
23default:stonebrick
24default:stone_block
25default:mossycobble
26
27default:desert_stone
28default:desert_cobble
29default:desert_stonebrick
30default:desert_stone_block
31
32default:sandstone
33default:sandstonebrick
34default:sandstone_block
35default:desert_sandstone
36default:desert_sandstone_brick
37default:desert_sandstone_block
38default:silver_sandstone
39default:silver_sandstone_brick
40default:silver_sandstone_block
41
42default:obsidian
43default:obsidianbrick
44default:obsidian_block
45
46Soft / Non-Stone
47----------------
48(1. Material 2. Modified forms)
49
50default:dirt
51default:dirt_with_grass
52default:dirt_with_grass_footsteps
53default:dirt_with_dry_grass
54default:dirt_with_snow
55default:dirt_with_rainforest_litter
56default:dirt_with_coniferous_litter
57default:dry_dirt
58default:dry_dirt_with_dry_grass
59
60default:permafrost
61default:permafrost_with_stones
62default:permafrost_with_moss
63
64default:sand
65default:desert_sand
66default:silver_sand
67
68default:gravel
69
70default:clay
71
72default:snow
73default:snowblock
74default:ice
75default:cave_ice
76
77Trees
78-----
79(1. Trunk 2. Fabricated trunk 3. Leaves 4. Sapling 5. Fruits)
80
81default:tree
82default:wood
83default:leaves
84default:sapling
85default:apple
86
87default:jungletree
88default:junglewood
89default:jungleleaves
90default:junglesapling
91default:emergent_jungle_sapling
92
93default:pine_tree
94default:pine_wood
95default:pine_needles
96default:pine_sapling
97
98default:acacia_tree
99default:acacia_wood
100default:acacia_leaves
101default:acacia_sapling
102
103default:aspen_tree
104default:aspen_wood
105default:aspen_leaves
106default:aspen_sapling
107
108Ores
109----
110(1. In stone 2. Blocks)
111
112default:stone_with_coal
113default:coalblock
114
115default:stone_with_iron
116default:steelblock
117
118default:stone_with_copper
119default:copperblock
120
121default:stone_with_tin
122default:tinblock
123
124default:bronzeblock
125
126default:stone_with_gold
127default:goldblock
128
129default:stone_with_mese
130default:mese
131
132default:stone_with_diamond
133default:diamondblock
134
135Plantlife
136---------
137
138default:cactus
139default:large_cactus_seedling
140
141default:papyrus
142default:dry_shrub
143default:junglegrass
144
145default:grass_1
146default:grass_2
147default:grass_3
148default:grass_4
149default:grass_5
150
151default:dry_grass_1
152default:dry_grass_2
153default:dry_grass_3
154default:dry_grass_4
155default:dry_grass_5
156
157default:fern_1
158default:fern_2
159default:fern_3
160
161default:marram_grass_1
162default:marram_grass_2
163default:marram_grass_3
164
165default:bush_stem
166default:bush_leaves
167default:bush_sapling
168default:acacia_bush_stem
169default:acacia_bush_leaves
170default:acacia_bush_sapling
171default:pine_bush_stem
172default:pine_bush_needles
173default:pine_bush_sapling
174default:blueberry_bush_leaves_with_berries
175default:blueberry_bush_leaves
176default:blueberry_bush_sapling
177
178default:sand_with_kelp
179
180Corals
181------
182
183default:coral_green
184default:coral_pink
185default:coral_cyan
186default:coral_brown
187default:coral_orange
188default:coral_skeleton
189
190Liquids
191-------
192(1. Source 2. Flowing)
193
194default:water_source
195default:water_flowing
196
197default:river_water_source
198default:river_water_flowing
199
200default:lava_source
201default:lava_flowing
202
203Tools / "Advanced" crafting / Non-"natural"
204-------------------------------------------
205
206default:bookshelf
207
208default:sign_wall_wood
209default:sign_wall_steel
210
211default:ladder_wood
212default:ladder_steel
213
214default:fence_wood
215default:fence_acacia_wood
216default:fence_junglewood
217default:fence_pine_wood
218default:fence_aspen_wood
219
220default:fence_rail_wood
221default:fence_rail_acacia_wood
222default:fence_rail_junglewood
223default:fence_rail_pine_wood
224default:fence_rail_aspen_wood
225
226default:glass
227default:obsidian_glass
228
229default:brick
230
231default:meselamp
232default:mese_post_light
233default:mese_post_light_acacia_wood
234default:mese_post_light_junglewood
235default:mese_post_light_pine_wood
236default:mese_post_light_aspen_wood
237
238Misc
239----
240
241default:cloud
242
243--]]
244
245-- Required wrapper to allow customization of default.after_place_leaves
246local function after_place_leaves(...)
247	return default.after_place_leaves(...)
248end
249
250-- Required wrapper to allow customization of default.grow_sapling
251local function grow_sapling(...)
252	return default.grow_sapling(...)
253end
254
255--
256-- Stone
257--
258
259minetest.register_node("default:stone", {
260	description = S("Stone"),
261	tiles = {"default_stone.png"},
262	groups = {cracky = 3, stone = 1},
263	drop = "default:cobble",
264	legacy_mineral = true,
265	sounds = default.node_sound_stone_defaults(),
266})
267
268minetest.register_node("default:cobble", {
269	description = S("Cobblestone"),
270	tiles = {"default_cobble.png"},
271	is_ground_content = false,
272	groups = {cracky = 3, stone = 2},
273	sounds = default.node_sound_stone_defaults(),
274})
275
276minetest.register_node("default:stonebrick", {
277	description = S("Stone Brick"),
278	paramtype2 = "facedir",
279	place_param2 = 0,
280	tiles = {"default_stone_brick.png"},
281	is_ground_content = false,
282	groups = {cracky = 2, stone = 1},
283	sounds = default.node_sound_stone_defaults(),
284})
285
286minetest.register_node("default:stone_block", {
287	description = S("Stone Block"),
288	tiles = {"default_stone_block.png"},
289	is_ground_content = false,
290	groups = {cracky = 2, stone = 1},
291	sounds = default.node_sound_stone_defaults(),
292})
293
294minetest.register_node("default:mossycobble", {
295	description = S("Mossy Cobblestone"),
296	tiles = {"default_mossycobble.png"},
297	is_ground_content = false,
298	groups = {cracky = 3, stone = 1},
299	sounds = default.node_sound_stone_defaults(),
300})
301
302
303minetest.register_node("default:desert_stone", {
304	description = S("Desert Stone"),
305	tiles = {"default_desert_stone.png"},
306	groups = {cracky = 3, stone = 1},
307	drop = "default:desert_cobble",
308	legacy_mineral = true,
309	sounds = default.node_sound_stone_defaults(),
310})
311
312minetest.register_node("default:desert_cobble", {
313	description = S("Desert Cobblestone"),
314	tiles = {"default_desert_cobble.png"},
315	is_ground_content = false,
316	groups = {cracky = 3, stone = 2},
317	sounds = default.node_sound_stone_defaults(),
318})
319
320minetest.register_node("default:desert_stonebrick", {
321	description = S("Desert Stone Brick"),
322	paramtype2 = "facedir",
323	place_param2 = 0,
324	tiles = {"default_desert_stone_brick.png"},
325	is_ground_content = false,
326	groups = {cracky = 2, stone = 1},
327	sounds = default.node_sound_stone_defaults(),
328})
329
330minetest.register_node("default:desert_stone_block", {
331	description = S("Desert Stone Block"),
332	tiles = {"default_desert_stone_block.png"},
333	is_ground_content = false,
334	groups = {cracky = 2, stone = 1},
335	sounds = default.node_sound_stone_defaults(),
336})
337
338minetest.register_node("default:sandstone", {
339	description = S("Sandstone"),
340	tiles = {"default_sandstone.png"},
341	groups = {crumbly = 1, cracky = 3},
342	sounds = default.node_sound_stone_defaults(),
343})
344
345minetest.register_node("default:sandstonebrick", {
346	description = S("Sandstone Brick"),
347	paramtype2 = "facedir",
348	place_param2 = 0,
349	tiles = {"default_sandstone_brick.png"},
350	is_ground_content = false,
351	groups = {cracky = 2},
352	sounds = default.node_sound_stone_defaults(),
353})
354
355minetest.register_node("default:sandstone_block", {
356	description = S("Sandstone Block"),
357	tiles = {"default_sandstone_block.png"},
358	is_ground_content = false,
359	groups = {cracky = 2},
360	sounds = default.node_sound_stone_defaults(),
361})
362
363minetest.register_node("default:desert_sandstone", {
364	description = S("Desert Sandstone"),
365	tiles = {"default_desert_sandstone.png"},
366	groups = {crumbly = 1, cracky = 3},
367	sounds = default.node_sound_stone_defaults(),
368})
369
370minetest.register_node("default:desert_sandstone_brick", {
371	description = S("Desert Sandstone Brick"),
372	paramtype2 = "facedir",
373	place_param2 = 0,
374	tiles = {"default_desert_sandstone_brick.png"},
375	is_ground_content = false,
376	groups = {cracky = 2},
377	sounds = default.node_sound_stone_defaults(),
378})
379
380minetest.register_node("default:desert_sandstone_block", {
381	description = S("Desert Sandstone Block"),
382	tiles = {"default_desert_sandstone_block.png"},
383	is_ground_content = false,
384	groups = {cracky = 2},
385	sounds = default.node_sound_stone_defaults(),
386})
387
388minetest.register_node("default:silver_sandstone", {
389	description = S("Silver Sandstone"),
390	tiles = {"default_silver_sandstone.png"},
391	groups = {crumbly = 1, cracky = 3},
392	sounds = default.node_sound_stone_defaults(),
393})
394
395minetest.register_node("default:silver_sandstone_brick", {
396	description = S("Silver Sandstone Brick"),
397	paramtype2 = "facedir",
398	place_param2 = 0,
399	tiles = {"default_silver_sandstone_brick.png"},
400	is_ground_content = false,
401	groups = {cracky = 2},
402	sounds = default.node_sound_stone_defaults(),
403})
404
405minetest.register_node("default:silver_sandstone_block", {
406	description = S("Silver Sandstone Block"),
407	tiles = {"default_silver_sandstone_block.png"},
408	is_ground_content = false,
409	groups = {cracky = 2},
410	sounds = default.node_sound_stone_defaults(),
411})
412
413minetest.register_node("default:obsidian", {
414	description = S("Obsidian"),
415	tiles = {"default_obsidian.png"},
416	sounds = default.node_sound_stone_defaults(),
417	groups = {cracky = 1, level = 2},
418})
419
420minetest.register_node("default:obsidianbrick", {
421	description = S("Obsidian Brick"),
422	paramtype2 = "facedir",
423	place_param2 = 0,
424	tiles = {"default_obsidian_brick.png"},
425	is_ground_content = false,
426	sounds = default.node_sound_stone_defaults(),
427	groups = {cracky = 1, level = 2},
428})
429
430minetest.register_node("default:obsidian_block", {
431	description = S("Obsidian Block"),
432	tiles = {"default_obsidian_block.png"},
433	is_ground_content = false,
434	sounds = default.node_sound_stone_defaults(),
435	groups = {cracky = 1, level = 2},
436})
437
438--
439-- Soft / Non-Stone
440--
441
442minetest.register_node("default:dirt", {
443	description = S("Dirt"),
444	tiles = {"default_dirt.png"},
445	groups = {crumbly = 3, soil = 1},
446	sounds = default.node_sound_dirt_defaults(),
447})
448
449minetest.register_node("default:dirt_with_grass", {
450	description = S("Dirt with Grass"),
451	tiles = {"default_grass.png", "default_dirt.png",
452		{name = "default_dirt.png^default_grass_side.png",
453			tileable_vertical = false}},
454	groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
455	drop = "default:dirt",
456	sounds = default.node_sound_dirt_defaults({
457		footstep = {name = "default_grass_footstep", gain = 0.25},
458	}),
459})
460
461minetest.register_node("default:dirt_with_grass_footsteps", {
462	description = S("Dirt with Grass and Footsteps"),
463	tiles = {"default_grass.png^default_footprint.png", "default_dirt.png",
464		{name = "default_dirt.png^default_grass_side.png",
465			tileable_vertical = false}},
466	groups = {crumbly = 3, soil = 1, not_in_creative_inventory = 1},
467	drop = "default:dirt",
468	sounds = default.node_sound_dirt_defaults({
469		footstep = {name = "default_grass_footstep", gain = 0.25},
470	}),
471})
472
473minetest.register_node("default:dirt_with_dry_grass", {
474	description = S("Dirt with Savanna Grass"),
475	tiles = {"default_dry_grass.png",
476		"default_dirt.png",
477		{name = "default_dirt.png^default_dry_grass_side.png",
478			tileable_vertical = false}},
479	groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
480	drop = "default:dirt",
481	sounds = default.node_sound_dirt_defaults({
482		footstep = {name = "default_grass_footstep", gain = 0.4},
483	}),
484})
485
486minetest.register_node("default:dirt_with_snow", {
487	description = S("Dirt with Snow"),
488	tiles = {"default_snow.png", "default_dirt.png",
489		{name = "default_dirt.png^default_snow_side.png",
490			tileable_vertical = false}},
491	groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1, snowy = 1},
492	drop = "default:dirt",
493	sounds = default.node_sound_dirt_defaults({
494		footstep = {name = "default_snow_footstep", gain = 0.2},
495	}),
496})
497
498minetest.register_node("default:dirt_with_rainforest_litter", {
499	description = S("Dirt with Rainforest Litter"),
500	tiles = {
501		"default_rainforest_litter.png",
502		"default_dirt.png",
503		{name = "default_dirt.png^default_rainforest_litter_side.png",
504			tileable_vertical = false}
505	},
506	groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
507	drop = "default:dirt",
508	sounds = default.node_sound_dirt_defaults({
509		footstep = {name = "default_grass_footstep", gain = 0.4},
510	}),
511})
512
513minetest.register_node("default:dirt_with_coniferous_litter", {
514	description = S("Dirt with Coniferous Litter"),
515	tiles = {
516		"default_coniferous_litter.png",
517		"default_dirt.png",
518		{name = "default_dirt.png^default_coniferous_litter_side.png",
519			tileable_vertical = false}
520	},
521	groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
522	drop = "default:dirt",
523	sounds = default.node_sound_dirt_defaults({
524		footstep = {name = "default_grass_footstep", gain = 0.4},
525	}),
526})
527
528minetest.register_node("default:dry_dirt", {
529	description = S("Savanna Dirt"),
530	tiles = {"default_dry_dirt.png"},
531	groups = {crumbly = 3, soil = 1},
532	sounds = default.node_sound_dirt_defaults(),
533})
534
535minetest.register_node("default:dry_dirt_with_dry_grass", {
536	description = S("Savanna Dirt with Savanna Grass"),
537	tiles = {"default_dry_grass.png", "default_dry_dirt.png",
538		{name = "default_dry_dirt.png^default_dry_grass_side.png",
539			tileable_vertical = false}},
540	groups = {crumbly = 3, soil = 1},
541	drop = "default:dry_dirt",
542	sounds = default.node_sound_dirt_defaults({
543		footstep = {name = "default_grass_footstep", gain = 0.4},
544	}),
545})
546
547minetest.register_node("default:permafrost", {
548	description = S("Permafrost"),
549	tiles = {"default_permafrost.png"},
550	groups = {cracky = 3},
551	sounds = default.node_sound_dirt_defaults(),
552})
553
554minetest.register_node("default:permafrost_with_stones", {
555	description = S("Permafrost with Stones"),
556	tiles = {"default_permafrost.png^default_stones.png",
557		"default_permafrost.png",
558		"default_permafrost.png^default_stones_side.png"},
559	groups = {cracky = 3},
560	sounds = default.node_sound_gravel_defaults(),
561})
562
563minetest.register_node("default:permafrost_with_moss", {
564	description = S("Permafrost with Moss"),
565	tiles = {"default_moss.png", "default_permafrost.png",
566		{name = "default_permafrost.png^default_moss_side.png",
567			tileable_vertical = false}},
568	groups = {cracky = 3},
569	sounds = default.node_sound_dirt_defaults({
570		footstep = {name = "default_grass_footstep", gain = 0.25},
571	}),
572})
573
574minetest.register_node("default:sand", {
575	description = S("Sand"),
576	tiles = {"default_sand.png"},
577	groups = {crumbly = 3, falling_node = 1, sand = 1},
578	sounds = default.node_sound_sand_defaults(),
579})
580
581minetest.register_node("default:desert_sand", {
582	description = S("Desert Sand"),
583	tiles = {"default_desert_sand.png"},
584	groups = {crumbly = 3, falling_node = 1, sand = 1},
585	sounds = default.node_sound_sand_defaults(),
586})
587
588minetest.register_node("default:silver_sand", {
589	description = S("Silver Sand"),
590	tiles = {"default_silver_sand.png"},
591	groups = {crumbly = 3, falling_node = 1, sand = 1},
592	sounds = default.node_sound_sand_defaults(),
593})
594
595
596minetest.register_node("default:gravel", {
597	description = S("Gravel"),
598	tiles = {"default_gravel.png"},
599	groups = {crumbly = 2, falling_node = 1},
600	sounds = default.node_sound_gravel_defaults(),
601	drop = {
602		max_items = 1,
603		items = {
604			{items = {"default:flint"}, rarity = 16},
605			{items = {"default:gravel"}}
606		}
607	}
608})
609
610minetest.register_node("default:clay", {
611	description = S("Clay"),
612	tiles = {"default_clay.png"},
613	groups = {crumbly = 3},
614	drop = "default:clay_lump 4",
615	sounds = default.node_sound_dirt_defaults(),
616})
617
618
619minetest.register_node("default:snow", {
620	description = S("Snow"),
621	tiles = {"default_snow.png"},
622	inventory_image = "default_snowball.png",
623	wield_image = "default_snowball.png",
624	paramtype = "light",
625	buildable_to = true,
626	floodable = true,
627	drawtype = "nodebox",
628	node_box = {
629		type = "fixed",
630		fixed = {
631			{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
632		},
633	},
634	collision_box = {
635		type = "fixed",
636		fixed = {
637			{-0.5, -0.5, -0.5, 0.5, -6 / 16, 0.5},
638		},
639	},
640	groups = {crumbly = 3, falling_node = 1, snowy = 1},
641	sounds = default.node_sound_snow_defaults(),
642
643	on_construct = function(pos)
644		pos.y = pos.y - 1
645		if minetest.get_node(pos).name == "default:dirt_with_grass" then
646			minetest.set_node(pos, {name = "default:dirt_with_snow"})
647		end
648	end,
649})
650
651minetest.register_node("default:snowblock", {
652	description = S("Snow Block"),
653	tiles = {"default_snow.png"},
654	groups = {crumbly = 3, cools_lava = 1, snowy = 1},
655	sounds = default.node_sound_snow_defaults(),
656
657	on_construct = function(pos)
658		pos.y = pos.y - 1
659		if minetest.get_node(pos).name == "default:dirt_with_grass" then
660			minetest.set_node(pos, {name = "default:dirt_with_snow"})
661		end
662	end,
663})
664
665-- 'is ground content = false' to avoid tunnels in sea ice or ice rivers
666minetest.register_node("default:ice", {
667	description = S("Ice"),
668	tiles = {"default_ice.png"},
669	is_ground_content = false,
670	paramtype = "light",
671	groups = {cracky = 3, cools_lava = 1, slippery = 3},
672	sounds = default.node_sound_ice_defaults(),
673})
674
675-- Mapgen-placed ice with 'is ground content = true' to contain tunnels
676minetest.register_node("default:cave_ice", {
677	description = S("Cave Ice"),
678	tiles = {"default_ice.png"},
679	paramtype = "light",
680	groups = {cracky = 3, cools_lava = 1, slippery = 3,
681		not_in_creative_inventory = 1},
682	drop = "default:ice",
683	sounds = default.node_sound_ice_defaults(),
684})
685
686--
687-- Trees
688--
689
690minetest.register_node("default:tree", {
691	description = S("Apple Tree"),
692	tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
693	paramtype2 = "facedir",
694	is_ground_content = false,
695	groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
696	sounds = default.node_sound_wood_defaults(),
697
698	on_place = minetest.rotate_node
699})
700
701minetest.register_node("default:wood", {
702	description = S("Apple Wood Planks"),
703	paramtype2 = "facedir",
704	place_param2 = 0,
705	tiles = {"default_wood.png"},
706	is_ground_content = false,
707	groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
708	sounds = default.node_sound_wood_defaults(),
709})
710
711minetest.register_node("default:sapling", {
712	description = S("Apple Tree Sapling"),
713	drawtype = "plantlike",
714	tiles = {"default_sapling.png"},
715	inventory_image = "default_sapling.png",
716	wield_image = "default_sapling.png",
717	paramtype = "light",
718	sunlight_propagates = true,
719	walkable = false,
720	on_timer = grow_sapling,
721	selection_box = {
722		type = "fixed",
723		fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
724	},
725	groups = {snappy = 2, dig_immediate = 3, flammable = 2,
726		attached_node = 1, sapling = 1},
727	sounds = default.node_sound_leaves_defaults(),
728
729	on_construct = function(pos)
730		minetest.get_node_timer(pos):start(math.random(300, 1500))
731	end,
732
733	on_place = function(itemstack, placer, pointed_thing)
734		itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
735			"default:sapling",
736			-- minp, maxp to be checked, relative to sapling pos
737			-- minp_relative.y = 1 because sapling pos has been checked
738			{x = -3, y = 1, z = -3},
739			{x = 3, y = 6, z = 3},
740			-- maximum interval of interior volume check
741			4)
742
743		return itemstack
744	end,
745})
746
747minetest.register_node("default:leaves", {
748	description = S("Apple Tree Leaves"),
749	drawtype = "allfaces_optional",
750	waving = 1,
751	tiles = {"default_leaves.png"},
752	special_tiles = {"default_leaves_simple.png"},
753	paramtype = "light",
754	is_ground_content = false,
755	groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
756	drop = {
757		max_items = 1,
758		items = {
759			{
760				-- player will get sapling with 1/20 chance
761				items = {"default:sapling"},
762				rarity = 20,
763			},
764			{
765				-- player will get leaves only if he get no saplings,
766				-- this is because max_items is 1
767				items = {"default:leaves"},
768			}
769		}
770	},
771	sounds = default.node_sound_leaves_defaults(),
772
773	after_place_node = after_place_leaves,
774})
775
776minetest.register_node("default:apple", {
777	description = S("Apple"),
778	drawtype = "plantlike",
779	tiles = {"default_apple.png"},
780	inventory_image = "default_apple.png",
781	paramtype = "light",
782	sunlight_propagates = true,
783	walkable = false,
784	is_ground_content = false,
785	selection_box = {
786		type = "fixed",
787		fixed = {-3 / 16, -7 / 16, -3 / 16, 3 / 16, 4 / 16, 3 / 16}
788	},
789	groups = {fleshy = 3, dig_immediate = 3, flammable = 2,
790		leafdecay = 3, leafdecay_drop = 1, food_apple = 1},
791	on_use = minetest.item_eat(2),
792	sounds = default.node_sound_leaves_defaults(),
793
794	after_place_node = function(pos, placer, itemstack)
795		minetest.set_node(pos, {name = "default:apple", param2 = 1})
796	end,
797
798	after_dig_node = function(pos, oldnode, oldmetadata, digger)
799		if oldnode.param2 == 0 then
800			minetest.set_node(pos, {name = "default:apple_mark"})
801			minetest.get_node_timer(pos):start(math.random(300, 1500))
802		end
803	end,
804})
805
806minetest.register_node("default:apple_mark", {
807	description = S("Apple Marker"),
808	inventory_image = "default_apple.png^default_invisible_node_overlay.png",
809	wield_image = "default_apple.png^default_invisible_node_overlay.png",
810	drawtype = "airlike",
811	paramtype = "light",
812	sunlight_propagates = true,
813	walkable = false,
814	pointable = false,
815	diggable = false,
816	buildable_to = true,
817	drop = "",
818	groups = {not_in_creative_inventory = 1},
819	on_timer = function(pos, elapsed)
820		if not minetest.find_node_near(pos, 1, "default:leaves") then
821			minetest.remove_node(pos)
822		elseif minetest.get_node_light(pos) < 11 then
823			minetest.get_node_timer(pos):start(200)
824		else
825			minetest.set_node(pos, {name = "default:apple"})
826		end
827	end
828})
829
830
831minetest.register_node("default:jungletree", {
832	description = S("Jungle Tree"),
833	tiles = {"default_jungletree_top.png", "default_jungletree_top.png",
834		"default_jungletree.png"},
835	paramtype2 = "facedir",
836	is_ground_content = false,
837	groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
838	sounds = default.node_sound_wood_defaults(),
839
840	on_place = minetest.rotate_node
841})
842
843minetest.register_node("default:junglewood", {
844	description = S("Jungle Wood Planks"),
845	paramtype2 = "facedir",
846	place_param2 = 0,
847	tiles = {"default_junglewood.png"},
848	is_ground_content = false,
849	groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
850	sounds = default.node_sound_wood_defaults(),
851})
852
853minetest.register_node("default:jungleleaves", {
854	description = S("Jungle Tree Leaves"),
855	drawtype = "allfaces_optional",
856	waving = 1,
857	tiles = {"default_jungleleaves.png"},
858	special_tiles = {"default_jungleleaves_simple.png"},
859	paramtype = "light",
860	is_ground_content = false,
861	groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
862	drop = {
863		max_items = 1,
864		items = {
865			{items = {"default:junglesapling"}, rarity = 20},
866			{items = {"default:jungleleaves"}}
867		}
868	},
869	sounds = default.node_sound_leaves_defaults(),
870
871	after_place_node = after_place_leaves,
872})
873
874minetest.register_node("default:junglesapling", {
875	description = S("Jungle Tree Sapling"),
876	drawtype = "plantlike",
877	tiles = {"default_junglesapling.png"},
878	inventory_image = "default_junglesapling.png",
879	wield_image = "default_junglesapling.png",
880	paramtype = "light",
881	sunlight_propagates = true,
882	walkable = false,
883	on_timer = grow_sapling,
884	selection_box = {
885		type = "fixed",
886		fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
887	},
888	groups = {snappy = 2, dig_immediate = 3, flammable = 2,
889		attached_node = 1, sapling = 1},
890	sounds = default.node_sound_leaves_defaults(),
891
892	on_construct = function(pos)
893		minetest.get_node_timer(pos):start(math.random(300, 1500))
894	end,
895
896	on_place = function(itemstack, placer, pointed_thing)
897		itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
898			"default:junglesapling",
899			-- minp, maxp to be checked, relative to sapling pos
900			-- minp_relative.y = 1 because sapling pos has been checked
901			{x = -2, y = 1, z = -2},
902			{x = 2, y = 15, z = 2},
903			-- maximum interval of interior volume check
904			4)
905
906		return itemstack
907	end,
908})
909
910minetest.register_node("default:emergent_jungle_sapling", {
911	description = S("Emergent Jungle Tree Sapling"),
912	drawtype = "plantlike",
913	tiles = {"default_emergent_jungle_sapling.png"},
914	inventory_image = "default_emergent_jungle_sapling.png",
915	wield_image = "default_emergent_jungle_sapling.png",
916	paramtype = "light",
917	sunlight_propagates = true,
918	walkable = false,
919	on_timer = grow_sapling,
920	selection_box = {
921		type = "fixed",
922		fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
923	},
924	groups = {snappy = 2, dig_immediate = 3, flammable = 2,
925		attached_node = 1, sapling = 1},
926	sounds = default.node_sound_leaves_defaults(),
927
928	on_construct = function(pos)
929		minetest.get_node_timer(pos):start(math.random(300, 1500))
930	end,
931
932	on_place = function(itemstack, placer, pointed_thing)
933		itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
934			"default:emergent_jungle_sapling",
935			-- minp, maxp to be checked, relative to sapling pos
936			{x = -3, y = -5, z = -3},
937			{x = 3, y = 31, z = 3},
938			-- maximum interval of interior volume check
939			4)
940
941		return itemstack
942	end,
943})
944
945
946minetest.register_node("default:pine_tree", {
947	description = S("Pine Tree"),
948	tiles = {"default_pine_tree_top.png", "default_pine_tree_top.png",
949		"default_pine_tree.png"},
950	paramtype2 = "facedir",
951	is_ground_content = false,
952	groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
953	sounds = default.node_sound_wood_defaults(),
954
955	on_place = minetest.rotate_node
956})
957
958minetest.register_node("default:pine_wood", {
959	description = S("Pine Wood Planks"),
960	paramtype2 = "facedir",
961	place_param2 = 0,
962	tiles = {"default_pine_wood.png"},
963	is_ground_content = false,
964	groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
965	sounds = default.node_sound_wood_defaults(),
966})
967
968minetest.register_node("default:pine_needles",{
969	description = S("Pine Needles"),
970	drawtype = "allfaces_optional",
971	tiles = {"default_pine_needles.png"},
972	waving = 1,
973	paramtype = "light",
974	is_ground_content = false,
975	groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
976	drop = {
977		max_items = 1,
978		items = {
979			{items = {"default:pine_sapling"}, rarity = 20},
980			{items = {"default:pine_needles"}}
981		}
982	},
983	sounds = default.node_sound_leaves_defaults(),
984
985	after_place_node = after_place_leaves,
986})
987
988minetest.register_node("default:pine_sapling", {
989	description = S("Pine Tree Sapling"),
990	drawtype = "plantlike",
991	tiles = {"default_pine_sapling.png"},
992	inventory_image = "default_pine_sapling.png",
993	wield_image = "default_pine_sapling.png",
994	paramtype = "light",
995	sunlight_propagates = true,
996	walkable = false,
997	on_timer = grow_sapling,
998	selection_box = {
999		type = "fixed",
1000		fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
1001	},
1002	groups = {snappy = 2, dig_immediate = 3, flammable = 3,
1003		attached_node = 1, sapling = 1},
1004	sounds = default.node_sound_leaves_defaults(),
1005
1006	on_construct = function(pos)
1007		minetest.get_node_timer(pos):start(math.random(300, 1500))
1008	end,
1009
1010	on_place = function(itemstack, placer, pointed_thing)
1011		itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
1012			"default:pine_sapling",
1013			-- minp, maxp to be checked, relative to sapling pos
1014			-- minp_relative.y = 1 because sapling pos has been checked
1015			{x = -2, y = 1, z = -2},
1016			{x = 2, y = 14, z = 2},
1017			-- maximum interval of interior volume check
1018			4)
1019
1020		return itemstack
1021	end,
1022})
1023
1024
1025minetest.register_node("default:acacia_tree", {
1026	description = S("Acacia Tree"),
1027	tiles = {"default_acacia_tree_top.png", "default_acacia_tree_top.png",
1028		"default_acacia_tree.png"},
1029	paramtype2 = "facedir",
1030	is_ground_content = false,
1031	groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
1032	sounds = default.node_sound_wood_defaults(),
1033
1034	on_place = minetest.rotate_node
1035})
1036
1037minetest.register_node("default:acacia_wood", {
1038	description = S("Acacia Wood Planks"),
1039	paramtype2 = "facedir",
1040	place_param2 = 0,
1041	tiles = {"default_acacia_wood.png"},
1042	is_ground_content = false,
1043	groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
1044	sounds = default.node_sound_wood_defaults(),
1045})
1046
1047minetest.register_node("default:acacia_leaves", {
1048	description = S("Acacia Tree Leaves"),
1049	drawtype = "allfaces_optional",
1050	tiles = {"default_acacia_leaves.png"},
1051	special_tiles = {"default_acacia_leaves_simple.png"},
1052	waving = 1,
1053	paramtype = "light",
1054	is_ground_content = false,
1055	groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
1056	drop = {
1057		max_items = 1,
1058		items = {
1059			{items = {"default:acacia_sapling"}, rarity = 20},
1060			{items = {"default:acacia_leaves"}}
1061		}
1062	},
1063	sounds = default.node_sound_leaves_defaults(),
1064
1065	after_place_node = after_place_leaves,
1066})
1067
1068minetest.register_node("default:acacia_sapling", {
1069	description = S("Acacia Tree Sapling"),
1070	drawtype = "plantlike",
1071	tiles = {"default_acacia_sapling.png"},
1072	inventory_image = "default_acacia_sapling.png",
1073	wield_image = "default_acacia_sapling.png",
1074	paramtype = "light",
1075	sunlight_propagates = true,
1076	walkable = false,
1077	on_timer = grow_sapling,
1078	selection_box = {
1079		type = "fixed",
1080		fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
1081	},
1082	groups = {snappy = 2, dig_immediate = 3, flammable = 2,
1083		attached_node = 1, sapling = 1},
1084	sounds = default.node_sound_leaves_defaults(),
1085
1086	on_construct = function(pos)
1087		minetest.get_node_timer(pos):start(math.random(300, 1500))
1088	end,
1089
1090	on_place = function(itemstack, placer, pointed_thing)
1091		itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
1092			"default:acacia_sapling",
1093			-- minp, maxp to be checked, relative to sapling pos
1094			-- minp_relative.y = 1 because sapling pos has been checked
1095			{x = -4, y = 1, z = -4},
1096			{x = 4, y = 7, z = 4},
1097			-- maximum interval of interior volume check
1098			4)
1099
1100		return itemstack
1101	end,
1102})
1103
1104minetest.register_node("default:aspen_tree", {
1105	description = S("Aspen Tree"),
1106	tiles = {"default_aspen_tree_top.png", "default_aspen_tree_top.png",
1107		"default_aspen_tree.png"},
1108	paramtype2 = "facedir",
1109	is_ground_content = false,
1110	groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
1111	sounds = default.node_sound_wood_defaults(),
1112
1113	on_place = minetest.rotate_node
1114})
1115
1116minetest.register_node("default:aspen_wood", {
1117	description = S("Aspen Wood Planks"),
1118	paramtype2 = "facedir",
1119	place_param2 = 0,
1120	tiles = {"default_aspen_wood.png"},
1121	is_ground_content = false,
1122	groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
1123	sounds = default.node_sound_wood_defaults(),
1124})
1125
1126minetest.register_node("default:aspen_leaves", {
1127	description = S("Aspen Tree Leaves"),
1128	drawtype = "allfaces_optional",
1129	tiles = {"default_aspen_leaves.png"},
1130	waving = 1,
1131	paramtype = "light",
1132	is_ground_content = false,
1133	groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
1134	drop = {
1135		max_items = 1,
1136		items = {
1137			{items = {"default:aspen_sapling"}, rarity = 20},
1138			{items = {"default:aspen_leaves"}}
1139		}
1140	},
1141	sounds = default.node_sound_leaves_defaults(),
1142
1143	after_place_node = after_place_leaves,
1144})
1145
1146minetest.register_node("default:aspen_sapling", {
1147	description = S("Aspen Tree Sapling"),
1148	drawtype = "plantlike",
1149	tiles = {"default_aspen_sapling.png"},
1150	inventory_image = "default_aspen_sapling.png",
1151	wield_image = "default_aspen_sapling.png",
1152	paramtype = "light",
1153	sunlight_propagates = true,
1154	walkable = false,
1155	on_timer = grow_sapling,
1156	selection_box = {
1157		type = "fixed",
1158		fixed = {-3 / 16, -0.5, -3 / 16, 3 / 16, 0.5, 3 / 16}
1159	},
1160	groups = {snappy = 2, dig_immediate = 3, flammable = 3,
1161		attached_node = 1, sapling = 1},
1162	sounds = default.node_sound_leaves_defaults(),
1163
1164	on_construct = function(pos)
1165		minetest.get_node_timer(pos):start(math.random(300, 1500))
1166	end,
1167
1168	on_place = function(itemstack, placer, pointed_thing)
1169		itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
1170			"default:aspen_sapling",
1171			-- minp, maxp to be checked, relative to sapling pos
1172			-- minp_relative.y = 1 because sapling pos has been checked
1173			{x = -2, y = 1, z = -2},
1174			{x = 2, y = 12, z = 2},
1175			-- maximum interval of interior volume check
1176			4)
1177
1178		return itemstack
1179	end,
1180})
1181
1182--
1183-- Ores
1184--
1185
1186minetest.register_node("default:stone_with_coal", {
1187	description = S("Coal Ore"),
1188	tiles = {"default_stone.png^default_mineral_coal.png"},
1189	groups = {cracky = 3},
1190	drop = "default:coal_lump",
1191	sounds = default.node_sound_stone_defaults(),
1192})
1193
1194minetest.register_node("default:coalblock", {
1195	description = S("Coal Block"),
1196	tiles = {"default_coal_block.png"},
1197	is_ground_content = false,
1198	groups = {cracky = 3},
1199	sounds = default.node_sound_stone_defaults(),
1200})
1201
1202
1203minetest.register_node("default:stone_with_iron", {
1204	description = S("Iron Ore"),
1205	tiles = {"default_stone.png^default_mineral_iron.png"},
1206	groups = {cracky = 2},
1207	drop = "default:iron_lump",
1208	sounds = default.node_sound_stone_defaults(),
1209})
1210
1211minetest.register_node("default:steelblock", {
1212	description = S("Steel Block"),
1213	tiles = {"default_steel_block.png"},
1214	is_ground_content = false,
1215	groups = {cracky = 1, level = 2},
1216	sounds = default.node_sound_metal_defaults(),
1217})
1218
1219
1220minetest.register_node("default:stone_with_copper", {
1221	description = S("Copper Ore"),
1222	tiles = {"default_stone.png^default_mineral_copper.png"},
1223	groups = {cracky = 2},
1224	drop = "default:copper_lump",
1225	sounds = default.node_sound_stone_defaults(),
1226})
1227
1228minetest.register_node("default:copperblock", {
1229	description = S("Copper Block"),
1230	tiles = {"default_copper_block.png"},
1231	is_ground_content = false,
1232	groups = {cracky = 1, level = 2},
1233	sounds = default.node_sound_metal_defaults(),
1234})
1235
1236
1237minetest.register_node("default:stone_with_tin", {
1238	description = S("Tin Ore"),
1239	tiles = {"default_stone.png^default_mineral_tin.png"},
1240	groups = {cracky = 2},
1241	drop = "default:tin_lump",
1242	sounds = default.node_sound_stone_defaults(),
1243})
1244
1245minetest.register_node("default:tinblock", {
1246	description = S("Tin Block"),
1247	tiles = {"default_tin_block.png"},
1248	is_ground_content = false,
1249	groups = {cracky = 1, level = 2},
1250	sounds = default.node_sound_metal_defaults(),
1251})
1252
1253
1254minetest.register_node("default:bronzeblock", {
1255	description = S("Bronze Block"),
1256	tiles = {"default_bronze_block.png"},
1257	is_ground_content = false,
1258	groups = {cracky = 1, level = 2},
1259	sounds = default.node_sound_metal_defaults(),
1260})
1261
1262
1263minetest.register_node("default:stone_with_mese", {
1264	description = S("Mese Ore"),
1265	tiles = {"default_stone.png^default_mineral_mese.png"},
1266	groups = {cracky = 1},
1267	drop = "default:mese_crystal",
1268	sounds = default.node_sound_stone_defaults(),
1269})
1270
1271minetest.register_node("default:mese", {
1272	description = S("Mese Block"),
1273	tiles = {"default_mese_block.png"},
1274	paramtype = "light",
1275	groups = {cracky = 1, level = 2},
1276	sounds = default.node_sound_stone_defaults(),
1277	light_source = 3,
1278})
1279
1280
1281minetest.register_node("default:stone_with_gold", {
1282	description = S("Gold Ore"),
1283	tiles = {"default_stone.png^default_mineral_gold.png"},
1284	groups = {cracky = 2},
1285	drop = "default:gold_lump",
1286	sounds = default.node_sound_stone_defaults(),
1287})
1288
1289minetest.register_node("default:goldblock", {
1290	description = S("Gold Block"),
1291	tiles = {"default_gold_block.png"},
1292	is_ground_content = false,
1293	groups = {cracky = 1},
1294	sounds = default.node_sound_metal_defaults(),
1295})
1296
1297
1298minetest.register_node("default:stone_with_diamond", {
1299	description = S("Diamond Ore"),
1300	tiles = {"default_stone.png^default_mineral_diamond.png"},
1301	groups = {cracky = 1},
1302	drop = "default:diamond",
1303	sounds = default.node_sound_stone_defaults(),
1304})
1305
1306minetest.register_node("default:diamondblock", {
1307	description = S("Diamond Block"),
1308	tiles = {"default_diamond_block.png"},
1309	is_ground_content = false,
1310	groups = {cracky = 1, level = 3},
1311	sounds = default.node_sound_stone_defaults(),
1312})
1313
1314--
1315-- Plantlife (non-cubic)
1316--
1317
1318minetest.register_node("default:cactus", {
1319	description = S("Cactus"),
1320	tiles = {"default_cactus_top.png", "default_cactus_top.png",
1321		"default_cactus_side.png"},
1322	paramtype2 = "facedir",
1323	groups = {choppy = 3},
1324	sounds = default.node_sound_wood_defaults(),
1325	on_place = minetest.rotate_node,
1326})
1327
1328minetest.register_node("default:large_cactus_seedling", {
1329	description = S("Large Cactus Seedling"),
1330	drawtype = "plantlike",
1331	tiles = {"default_large_cactus_seedling.png"},
1332	inventory_image = "default_large_cactus_seedling.png",
1333	wield_image = "default_large_cactus_seedling.png",
1334	paramtype = "light",
1335	sunlight_propagates = true,
1336	walkable = false,
1337	selection_box = {
1338		type = "fixed",
1339		fixed = {
1340			-5 / 16, -0.5, -5 / 16,
1341			5 / 16, 0.5, 5 / 16
1342		}
1343	},
1344	groups = {choppy = 3, dig_immediate = 3, attached_node = 1},
1345	sounds = default.node_sound_wood_defaults(),
1346
1347	on_place = function(itemstack, placer, pointed_thing)
1348		itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
1349			"default:large_cactus_seedling",
1350			{x = -2, y = -1, z = -2},
1351			{x = 2, y = 5, z = 2},
1352			4)
1353
1354		return itemstack
1355	end,
1356
1357	on_construct = function(pos)
1358		-- Normal cactus farming adds 1 cactus node by ABM,
1359		-- interval 12s, chance 83.
1360		-- Consider starting with 5 cactus nodes. We make sure that growing a
1361		-- large cactus is not a faster way to produce new cactus nodes.
1362		-- Confirmed by experiment, when farming 5 cacti, on average 1 new
1363		-- cactus node is added on average every
1364		-- 83 / 5 = 16.6 intervals = 16.6 * 12 = 199.2s.
1365		-- Large cactus contains on average 14 cactus nodes.
1366		-- 14 * 199.2 = 2788.8s.
1367		-- Set random range to average to 2789s.
1368		minetest.get_node_timer(pos):start(math.random(1859, 3719))
1369	end,
1370
1371	on_timer = function(pos)
1372		local node_under = minetest.get_node_or_nil(
1373			{x = pos.x, y = pos.y - 1, z = pos.z})
1374		if not node_under then
1375			-- Node under not yet loaded, try later
1376			minetest.get_node_timer(pos):start(300)
1377			return
1378		end
1379
1380		if minetest.get_item_group(node_under.name, "sand") == 0 then
1381			-- Seedling dies
1382			minetest.remove_node(pos)
1383			return
1384		end
1385
1386		local light_level = minetest.get_node_light(pos)
1387		if not light_level or light_level < 13 then
1388			-- Too dark for growth, try later in case it's night
1389			minetest.get_node_timer(pos):start(300)
1390			return
1391		end
1392
1393		minetest.log("action", "A large cactus seedling grows into a large" ..
1394			"cactus at ".. minetest.pos_to_string(pos))
1395		default.grow_large_cactus(pos)
1396	end,
1397})
1398
1399minetest.register_node("default:papyrus", {
1400	description = S("Papyrus"),
1401	drawtype = "plantlike",
1402	tiles = {"default_papyrus.png"},
1403	inventory_image = "default_papyrus.png",
1404	wield_image = "default_papyrus.png",
1405	paramtype = "light",
1406	sunlight_propagates = true,
1407	walkable = false,
1408	selection_box = {
1409		type = "fixed",
1410		fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
1411	},
1412	groups = {snappy = 3, flammable = 2},
1413	sounds = default.node_sound_leaves_defaults(),
1414
1415	after_dig_node = function(pos, node, metadata, digger)
1416		default.dig_up(pos, node, digger)
1417	end,
1418})
1419
1420minetest.register_node("default:dry_shrub", {
1421	description = S("Dry Shrub"),
1422	drawtype = "plantlike",
1423	waving = 1,
1424	tiles = {"default_dry_shrub.png"},
1425	inventory_image = "default_dry_shrub.png",
1426	wield_image = "default_dry_shrub.png",
1427	paramtype = "light",
1428	paramtype2 = "meshoptions",
1429	place_param2 = 4,
1430	sunlight_propagates = true,
1431	walkable = false,
1432	buildable_to = true,
1433	groups = {snappy = 3, flammable = 3, attached_node = 1},
1434	sounds = default.node_sound_leaves_defaults(),
1435	selection_box = {
1436		type = "fixed",
1437		fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 4 / 16, 6 / 16},
1438	},
1439})
1440
1441minetest.register_node("default:junglegrass", {
1442	description = S("Jungle Grass"),
1443	drawtype = "plantlike",
1444	waving = 1,
1445	visual_scale = 1.69,
1446	tiles = {"default_junglegrass.png"},
1447	inventory_image = "default_junglegrass.png",
1448	wield_image = "default_junglegrass.png",
1449	paramtype = "light",
1450	sunlight_propagates = true,
1451	walkable = false,
1452	buildable_to = true,
1453	groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, junglegrass = 1, flammable = 1},
1454	sounds = default.node_sound_leaves_defaults(),
1455	selection_box = {
1456		type = "fixed",
1457		fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
1458	},
1459})
1460
1461
1462minetest.register_node("default:grass_1", {
1463	description = S("Grass"),
1464	drawtype = "plantlike",
1465	waving = 1,
1466	tiles = {"default_grass_1.png"},
1467	-- Use texture of a taller grass stage in inventory
1468	inventory_image = "default_grass_3.png",
1469	wield_image = "default_grass_3.png",
1470	paramtype = "light",
1471	sunlight_propagates = true,
1472	walkable = false,
1473	buildable_to = true,
1474	groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1,
1475		normal_grass = 1, flammable = 1},
1476	sounds = default.node_sound_leaves_defaults(),
1477	selection_box = {
1478		type = "fixed",
1479		fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -5 / 16, 6 / 16},
1480	},
1481
1482	on_place = function(itemstack, placer, pointed_thing)
1483		-- place a random grass node
1484		local stack = ItemStack("default:grass_" .. math.random(1,5))
1485		local ret = minetest.item_place(stack, placer, pointed_thing)
1486		return ItemStack("default:grass_1 " ..
1487			itemstack:get_count() - (1 - ret:get_count()))
1488	end,
1489})
1490
1491for i = 2, 5 do
1492	minetest.register_node("default:grass_" .. i, {
1493		description = S("Grass"),
1494		drawtype = "plantlike",
1495		waving = 1,
1496		tiles = {"default_grass_" .. i .. ".png"},
1497		inventory_image = "default_grass_" .. i .. ".png",
1498		wield_image = "default_grass_" .. i .. ".png",
1499		paramtype = "light",
1500		sunlight_propagates = true,
1501		walkable = false,
1502		buildable_to = true,
1503		drop = "default:grass_1",
1504		groups = {snappy = 3, flora = 1, attached_node = 1,
1505			not_in_creative_inventory = 1, grass = 1,
1506			normal_grass = 1, flammable = 1},
1507		sounds = default.node_sound_leaves_defaults(),
1508		selection_box = {
1509			type = "fixed",
1510			fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16},
1511		},
1512	})
1513end
1514
1515
1516minetest.register_node("default:dry_grass_1", {
1517	description = S("Savanna Grass"),
1518	drawtype = "plantlike",
1519	waving = 1,
1520	tiles = {"default_dry_grass_1.png"},
1521	inventory_image = "default_dry_grass_3.png",
1522	wield_image = "default_dry_grass_3.png",
1523	paramtype = "light",
1524	sunlight_propagates = true,
1525	walkable = false,
1526	buildable_to = true,
1527	groups = {snappy = 3, flammable = 3, flora = 1,
1528		attached_node = 1, grass = 1, dry_grass = 1},
1529	sounds = default.node_sound_leaves_defaults(),
1530	selection_box = {
1531		type = "fixed",
1532		fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16},
1533	},
1534
1535	on_place = function(itemstack, placer, pointed_thing)
1536		-- place a random dry grass node
1537		local stack = ItemStack("default:dry_grass_" .. math.random(1, 5))
1538		local ret = minetest.item_place(stack, placer, pointed_thing)
1539		return ItemStack("default:dry_grass_1 " ..
1540			itemstack:get_count() - (1 - ret:get_count()))
1541	end,
1542})
1543
1544for i = 2, 5 do
1545	minetest.register_node("default:dry_grass_" .. i, {
1546		description = S("Savanna Grass"),
1547		drawtype = "plantlike",
1548		waving = 1,
1549		tiles = {"default_dry_grass_" .. i .. ".png"},
1550		inventory_image = "default_dry_grass_" .. i .. ".png",
1551		wield_image = "default_dry_grass_" .. i .. ".png",
1552		paramtype = "light",
1553		sunlight_propagates = true,
1554		walkable = false,
1555		buildable_to = true,
1556		groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1,
1557			not_in_creative_inventory = 1, grass = 1, dry_grass = 1},
1558		drop = "default:dry_grass_1",
1559		sounds = default.node_sound_leaves_defaults(),
1560		selection_box = {
1561			type = "fixed",
1562			fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -1 / 16, 6 / 16},
1563		},
1564	})
1565end
1566
1567
1568minetest.register_node("default:fern_1", {
1569	description = S("Fern"),
1570	drawtype = "plantlike",
1571	waving = 1,
1572	tiles = {"default_fern_1.png"},
1573	inventory_image = "default_fern_1.png",
1574	wield_image = "default_fern_1.png",
1575	paramtype = "light",
1576	sunlight_propagates = true,
1577	walkable = false,
1578	buildable_to = true,
1579	groups = {snappy = 3, flammable = 3, flora = 1, grass = 1,
1580		fern = 1, attached_node = 1},
1581	sounds = default.node_sound_leaves_defaults(),
1582	selection_box = {
1583		type = "fixed",
1584		fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -0.25, 6 / 16},
1585	},
1586
1587	on_place = function(itemstack, placer, pointed_thing)
1588		-- place a random fern node
1589		local stack = ItemStack("default:fern_" .. math.random(1, 3))
1590		local ret = minetest.item_place(stack, placer, pointed_thing)
1591		return ItemStack("default:fern_1 " ..
1592			itemstack:get_count() - (1 - ret:get_count()))
1593	end,
1594})
1595
1596for i = 2, 3 do
1597	minetest.register_node("default:fern_" .. i, {
1598		description = S("Fern"),
1599		drawtype = "plantlike",
1600		waving = 1,
1601		visual_scale = 2,
1602		tiles = {"default_fern_" .. i .. ".png"},
1603		inventory_image = "default_fern_" .. i .. ".png",
1604		wield_image = "default_fern_" .. i .. ".png",
1605		paramtype = "light",
1606		sunlight_propagates = true,
1607		walkable = false,
1608		buildable_to = true,
1609		groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1,
1610			grass = 1, fern = 1, not_in_creative_inventory = 1},
1611		drop = "default:fern_1",
1612		sounds = default.node_sound_leaves_defaults(),
1613		selection_box = {
1614			type = "fixed",
1615			fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -0.25, 6 / 16},
1616		},
1617	})
1618end
1619
1620
1621minetest.register_node("default:marram_grass_1", {
1622	description = S("Marram Grass"),
1623	drawtype = "plantlike",
1624	waving = 1,
1625	tiles = {"default_marram_grass_1.png"},
1626	inventory_image = "default_marram_grass_1.png",
1627	wield_image = "default_marram_grass_1.png",
1628	paramtype = "light",
1629	sunlight_propagates = true,
1630	walkable = false,
1631	buildable_to = true,
1632	groups = {snappy = 3, flammable = 3, flora = 1, grass = 1, marram_grass = 1,
1633		attached_node = 1},
1634	sounds = default.node_sound_leaves_defaults(),
1635	selection_box = {
1636		type = "fixed",
1637		fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -0.25, 6 / 16},
1638	},
1639
1640	on_place = function(itemstack, placer, pointed_thing)
1641		-- place a random marram grass node
1642		local stack = ItemStack("default:marram_grass_" .. math.random(1, 3))
1643		local ret = minetest.item_place(stack, placer, pointed_thing)
1644		return ItemStack("default:marram_grass_1 " ..
1645			itemstack:get_count() - (1 - ret:get_count()))
1646	end,
1647})
1648
1649for i = 2, 3 do
1650	minetest.register_node("default:marram_grass_" .. i, {
1651		description = S("Marram Grass"),
1652		drawtype = "plantlike",
1653		waving = 1,
1654		tiles = {"default_marram_grass_" .. i .. ".png"},
1655		inventory_image = "default_marram_grass_" .. i .. ".png",
1656		wield_image = "default_marram_grass_" .. i .. ".png",
1657		paramtype = "light",
1658		sunlight_propagates = true,
1659		walkable = false,
1660		buildable_to = true,
1661		groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1,
1662			grass = 1, marram_grass = 1, not_in_creative_inventory = 1},
1663		drop = "default:marram_grass_1",
1664		sounds = default.node_sound_leaves_defaults(),
1665		selection_box = {
1666			type = "fixed",
1667			fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -0.25, 6 / 16},
1668		},
1669	})
1670end
1671
1672
1673minetest.register_node("default:bush_stem", {
1674	description = S("Bush Stem"),
1675	drawtype = "plantlike",
1676	visual_scale = 1.41,
1677	tiles = {"default_bush_stem.png"},
1678	inventory_image = "default_bush_stem.png",
1679	wield_image = "default_bush_stem.png",
1680	paramtype = "light",
1681	sunlight_propagates = true,
1682	groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
1683	sounds = default.node_sound_wood_defaults(),
1684	selection_box = {
1685		type = "fixed",
1686		fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.5, 7 / 16},
1687	},
1688})
1689
1690minetest.register_node("default:bush_leaves", {
1691	description = S("Bush Leaves"),
1692	drawtype = "allfaces_optional",
1693	tiles = {"default_leaves_simple.png"},
1694	paramtype = "light",
1695	groups = {snappy = 3, flammable = 2, leaves = 1},
1696	drop = {
1697		max_items = 1,
1698		items = {
1699			{items = {"default:bush_sapling"}, rarity = 5},
1700			{items = {"default:bush_leaves"}}
1701		}
1702	},
1703	sounds = default.node_sound_leaves_defaults(),
1704
1705	after_place_node = after_place_leaves,
1706})
1707
1708minetest.register_node("default:bush_sapling", {
1709	description = S("Bush Sapling"),
1710	drawtype = "plantlike",
1711	tiles = {"default_bush_sapling.png"},
1712	inventory_image = "default_bush_sapling.png",
1713	wield_image = "default_bush_sapling.png",
1714	paramtype = "light",
1715	sunlight_propagates = true,
1716	walkable = false,
1717	on_timer = grow_sapling,
1718	selection_box = {
1719		type = "fixed",
1720		fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 2 / 16, 4 / 16}
1721	},
1722	groups = {snappy = 2, dig_immediate = 3, flammable = 2,
1723		attached_node = 1, sapling = 1},
1724	sounds = default.node_sound_leaves_defaults(),
1725
1726	on_construct = function(pos)
1727		minetest.get_node_timer(pos):start(math.random(300, 1500))
1728	end,
1729
1730	on_place = function(itemstack, placer, pointed_thing)
1731		itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
1732			"default:bush_sapling",
1733			-- minp, maxp to be checked, relative to sapling pos
1734			{x = -1, y = 0, z = -1},
1735			{x = 1, y = 1, z = 1},
1736			-- maximum interval of interior volume check
1737			2)
1738
1739		return itemstack
1740	end,
1741})
1742
1743minetest.register_node("default:blueberry_bush_leaves_with_berries", {
1744	description = S("Blueberry Bush Leaves with Berries"),
1745	drawtype = "allfaces_optional",
1746	tiles = {"default_blueberry_bush_leaves.png^default_blueberry_overlay.png"},
1747	paramtype = "light",
1748	groups = {snappy = 3, flammable = 2, leaves = 1, dig_immediate = 3},
1749	drop = "default:blueberries",
1750	sounds = default.node_sound_leaves_defaults(),
1751	node_dig_prediction = "default:blueberry_bush_leaves",
1752
1753	after_dig_node = function(pos, oldnode, oldmetadata, digger)
1754		minetest.set_node(pos, {name = "default:blueberry_bush_leaves"})
1755		minetest.get_node_timer(pos):start(math.random(300, 1500))
1756	end,
1757})
1758
1759minetest.register_node("default:blueberry_bush_leaves", {
1760	description = S("Blueberry Bush Leaves"),
1761	drawtype = "allfaces_optional",
1762	tiles = {"default_blueberry_bush_leaves.png"},
1763	paramtype = "light",
1764	groups = {snappy = 3, flammable = 2, leaves = 1},
1765	drop = {
1766		max_items = 1,
1767		items = {
1768			{items = {"default:blueberry_bush_sapling"}, rarity = 5},
1769			{items = {"default:blueberry_bush_leaves"}}
1770		}
1771	},
1772	sounds = default.node_sound_leaves_defaults(),
1773
1774	on_timer = function(pos, elapsed)
1775		if minetest.get_node_light(pos) < 11 then
1776			minetest.get_node_timer(pos):start(200)
1777		else
1778			minetest.set_node(pos, {name = "default:blueberry_bush_leaves_with_berries"})
1779		end
1780	end,
1781
1782	after_place_node = after_place_leaves,
1783})
1784
1785minetest.register_node("default:blueberry_bush_sapling", {
1786	description = S("Blueberry Bush Sapling"),
1787	drawtype = "plantlike",
1788	tiles = {"default_blueberry_bush_sapling.png"},
1789	inventory_image = "default_blueberry_bush_sapling.png",
1790	wield_image = "default_blueberry_bush_sapling.png",
1791	paramtype = "light",
1792	sunlight_propagates = true,
1793	walkable = false,
1794	on_timer = grow_sapling,
1795	selection_box = {
1796		type = "fixed",
1797		fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 2 / 16, 4 / 16}
1798	},
1799	groups = {snappy = 2, dig_immediate = 3, flammable = 2,
1800		attached_node = 1, sapling = 1},
1801	sounds = default.node_sound_leaves_defaults(),
1802
1803	on_construct = function(pos)
1804		minetest.get_node_timer(pos):start(math.random(300, 1500))
1805	end,
1806
1807	on_place = function(itemstack, placer, pointed_thing)
1808		itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
1809			"default:blueberry_bush_sapling",
1810			-- minp, maxp to be checked, relative to sapling pos
1811			{x = -1, y = 0, z = -1},
1812			{x = 1, y = 1, z = 1},
1813			-- maximum interval of interior volume check
1814			2)
1815
1816		return itemstack
1817	end,
1818})
1819
1820minetest.register_node("default:acacia_bush_stem", {
1821	description = S("Acacia Bush Stem"),
1822	drawtype = "plantlike",
1823	visual_scale = 1.41,
1824	tiles = {"default_acacia_bush_stem.png"},
1825	inventory_image = "default_acacia_bush_stem.png",
1826	wield_image = "default_acacia_bush_stem.png",
1827	paramtype = "light",
1828	sunlight_propagates = true,
1829	groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
1830	sounds = default.node_sound_wood_defaults(),
1831	selection_box = {
1832		type = "fixed",
1833		fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.5, 7 / 16},
1834	},
1835})
1836
1837minetest.register_node("default:acacia_bush_leaves", {
1838	description = S("Acacia Bush Leaves"),
1839	drawtype = "allfaces_optional",
1840	tiles = {"default_acacia_leaves_simple.png"},
1841	paramtype = "light",
1842	groups = {snappy = 3, flammable = 2, leaves = 1},
1843	drop = {
1844		max_items = 1,
1845		items = {
1846			{items = {"default:acacia_bush_sapling"}, rarity = 5},
1847			{items = {"default:acacia_bush_leaves"}}
1848		}
1849	},
1850	sounds = default.node_sound_leaves_defaults(),
1851
1852	after_place_node = after_place_leaves,
1853})
1854
1855minetest.register_node("default:acacia_bush_sapling", {
1856	description = S("Acacia Bush Sapling"),
1857	drawtype = "plantlike",
1858	tiles = {"default_acacia_bush_sapling.png"},
1859	inventory_image = "default_acacia_bush_sapling.png",
1860	wield_image = "default_acacia_bush_sapling.png",
1861	paramtype = "light",
1862	sunlight_propagates = true,
1863	walkable = false,
1864	on_timer = grow_sapling,
1865	selection_box = {
1866		type = "fixed",
1867		fixed = {-3 / 16, -0.5, -3 / 16, 3 / 16, 2 / 16, 3 / 16}
1868	},
1869	groups = {snappy = 2, dig_immediate = 3, flammable = 2,
1870		attached_node = 1, sapling = 1},
1871	sounds = default.node_sound_leaves_defaults(),
1872
1873	on_construct = function(pos)
1874		minetest.get_node_timer(pos):start(math.random(300, 1500))
1875	end,
1876
1877	on_place = function(itemstack, placer, pointed_thing)
1878		itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
1879			"default:acacia_bush_sapling",
1880			-- minp, maxp to be checked, relative to sapling pos
1881			{x = -1, y = 0, z = -1},
1882			{x = 1, y = 1, z = 1},
1883			-- maximum interval of interior volume check
1884			2)
1885
1886		return itemstack
1887	end,
1888})
1889
1890minetest.register_node("default:pine_bush_stem", {
1891	description = S("Pine Bush Stem"),
1892	drawtype = "plantlike",
1893	visual_scale = 1.41,
1894	tiles = {"default_pine_bush_stem.png"},
1895	inventory_image = "default_pine_bush_stem.png",
1896	wield_image = "default_pine_bush_stem.png",
1897	paramtype = "light",
1898	sunlight_propagates = true,
1899	groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
1900	sounds = default.node_sound_wood_defaults(),
1901	selection_box = {
1902		type = "fixed",
1903		fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.5, 7 / 16},
1904	},
1905})
1906
1907minetest.register_node("default:pine_bush_needles", {
1908	description = S("Pine Bush Needles"),
1909	drawtype = "allfaces_optional",
1910	tiles = {"default_pine_needles.png"},
1911	paramtype = "light",
1912	groups = {snappy = 3, flammable = 2, leaves = 1},
1913	drop = {
1914		max_items = 1,
1915		items = {
1916			{items = {"default:pine_bush_sapling"}, rarity = 5},
1917			{items = {"default:pine_bush_needles"}}
1918		}
1919	},
1920	sounds = default.node_sound_leaves_defaults(),
1921
1922	after_place_node = after_place_leaves,
1923})
1924
1925minetest.register_node("default:pine_bush_sapling", {
1926	description = S("Pine Bush Sapling"),
1927	drawtype = "plantlike",
1928	tiles = {"default_pine_bush_sapling.png"},
1929	inventory_image = "default_pine_bush_sapling.png",
1930	wield_image = "default_pine_bush_sapling.png",
1931	paramtype = "light",
1932	sunlight_propagates = true,
1933	walkable = false,
1934	on_timer = grow_sapling,
1935	selection_box = {
1936		type = "fixed",
1937		fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 2 / 16, 4 / 16}
1938	},
1939	groups = {snappy = 2, dig_immediate = 3, flammable = 2,
1940		attached_node = 1, sapling = 1},
1941	sounds = default.node_sound_leaves_defaults(),
1942
1943	on_construct = function(pos)
1944		minetest.get_node_timer(pos):start(math.random(300, 1500))
1945	end,
1946
1947	on_place = function(itemstack, placer, pointed_thing)
1948		itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
1949			"default:pine_bush_sapling",
1950			-- minp, maxp to be checked, relative to sapling pos
1951			{x = -1, y = 0, z = -1},
1952			{x = 1, y = 1, z = 1},
1953			-- maximum interval of interior volume check
1954			2)
1955
1956		return itemstack
1957	end,
1958})
1959
1960
1961minetest.register_node("default:sand_with_kelp", {
1962	description = S("Kelp"),
1963	drawtype = "plantlike_rooted",
1964	waving = 1,
1965	tiles = {"default_sand.png"},
1966	special_tiles = {{name = "default_kelp.png", tileable_vertical = true}},
1967	inventory_image = "default_kelp.png",
1968	wield_image = "default_kelp.png",
1969	paramtype = "light",
1970	paramtype2 = "leveled",
1971	groups = {snappy = 3},
1972	selection_box = {
1973		type = "fixed",
1974		fixed = {
1975				{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
1976				{-2/16, 0.5, -2/16, 2/16, 3.5, 2/16},
1977		},
1978	},
1979	node_dig_prediction = "default:sand",
1980	node_placement_prediction = "",
1981	sounds = default.node_sound_sand_defaults({
1982		dig = {name = "default_dig_snappy", gain = 0.2},
1983		dug = {name = "default_grass_footstep", gain = 0.25},
1984	}),
1985
1986	on_place = function(itemstack, placer, pointed_thing)
1987		-- Call on_rightclick if the pointed node defines it
1988		if pointed_thing.type == "node" and placer and
1989				not placer:get_player_control().sneak then
1990			local node_ptu = minetest.get_node(pointed_thing.under)
1991			local def_ptu = minetest.registered_nodes[node_ptu.name]
1992			if def_ptu and def_ptu.on_rightclick then
1993				return def_ptu.on_rightclick(pointed_thing.under, node_ptu, placer,
1994					itemstack, pointed_thing)
1995			end
1996		end
1997
1998		local pos = pointed_thing.under
1999		if minetest.get_node(pos).name ~= "default:sand" then
2000			return itemstack
2001		end
2002
2003		local height = math.random(4, 6)
2004		local pos_top = {x = pos.x, y = pos.y + height, z = pos.z}
2005		local node_top = minetest.get_node(pos_top)
2006		local def_top = minetest.registered_nodes[node_top.name]
2007		local player_name = placer:get_player_name()
2008
2009		if def_top and def_top.liquidtype == "source" and
2010				minetest.get_item_group(node_top.name, "water") > 0 then
2011			if not minetest.is_protected(pos, player_name) and
2012					not minetest.is_protected(pos_top, player_name) then
2013				minetest.set_node(pos, {name = "default:sand_with_kelp",
2014					param2 = height * 16})
2015				if not minetest.is_creative_enabled(player_name) then
2016					itemstack:take_item()
2017				end
2018			else
2019				minetest.chat_send_player(player_name, "Node is protected")
2020				minetest.record_protection_violation(pos, player_name)
2021			end
2022		end
2023
2024		return itemstack
2025	end,
2026
2027	after_destruct  = function(pos, oldnode)
2028		minetest.set_node(pos, {name = "default:sand"})
2029	end
2030})
2031
2032
2033--
2034-- Corals
2035--
2036
2037local function coral_on_place(itemstack, placer, pointed_thing)
2038	if pointed_thing.type ~= "node" or not placer then
2039		return itemstack
2040	end
2041
2042	local player_name = placer:get_player_name()
2043	local pos_under = pointed_thing.under
2044	local pos_above = pointed_thing.above
2045	local node_under = minetest.get_node(pos_under)
2046	local def_under = minetest.registered_nodes[node_under.name]
2047
2048	if def_under and def_under.on_rightclick and not placer:get_player_control().sneak then
2049		return def_under.on_rightclick(pos_under, node_under,
2050				placer, itemstack, pointed_thing) or itemstack
2051	end
2052
2053	if node_under.name ~= "default:coral_skeleton" or
2054			minetest.get_node(pos_above).name ~= "default:water_source" then
2055		return itemstack
2056	end
2057
2058	if minetest.is_protected(pos_under, player_name) or
2059			minetest.is_protected(pos_above, player_name) then
2060		minetest.log("action", player_name
2061			.. " tried to place " .. itemstack:get_name()
2062			.. " at protected position "
2063			.. minetest.pos_to_string(pos_under))
2064		minetest.record_protection_violation(pos_under, player_name)
2065		return itemstack
2066	end
2067
2068	node_under.name = itemstack:get_name()
2069	minetest.set_node(pos_under, node_under)
2070	if not minetest.is_creative_enabled(player_name) then
2071		itemstack:take_item()
2072	end
2073
2074	return itemstack
2075end
2076
2077minetest.register_node("default:coral_green", {
2078	description = S("Green Coral"),
2079	drawtype = "plantlike_rooted",
2080	waving = 1,
2081	paramtype = "light",
2082	tiles = {"default_coral_skeleton.png"},
2083	special_tiles = {{name = "default_coral_green.png", tileable_vertical = true}},
2084	inventory_image = "default_coral_green.png",
2085	wield_image = "default_coral_green.png",
2086	groups = {snappy = 3},
2087	selection_box = {
2088		type = "fixed",
2089		fixed = {
2090				{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
2091				{-4/16, 0.5, -4/16, 4/16, 1.5, 4/16},
2092		},
2093	},
2094	node_dig_prediction = "default:coral_skeleton",
2095	node_placement_prediction = "",
2096	sounds = default.node_sound_stone_defaults({
2097		dig = {name = "default_dig_snappy", gain = 0.2},
2098		dug = {name = "default_grass_footstep", gain = 0.25},
2099	}),
2100
2101	on_place = coral_on_place,
2102
2103	after_destruct  = function(pos, oldnode)
2104		minetest.set_node(pos, {name = "default:coral_skeleton"})
2105	end,
2106})
2107
2108minetest.register_node("default:coral_pink", {
2109	description = S("Pink Coral"),
2110	drawtype = "plantlike_rooted",
2111	waving = 1,
2112	paramtype = "light",
2113	tiles = {"default_coral_skeleton.png"},
2114	special_tiles = {{name = "default_coral_pink.png", tileable_vertical = true}},
2115	inventory_image = "default_coral_pink.png",
2116	wield_image = "default_coral_pink.png",
2117	groups = {snappy = 3},
2118	selection_box = {
2119		type = "fixed",
2120		fixed = {
2121				{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
2122				{-4/16, 0.5, -4/16, 4/16, 1.5, 4/16},
2123		},
2124	},
2125	node_dig_prediction = "default:coral_skeleton",
2126	node_placement_prediction = "",
2127	sounds = default.node_sound_stone_defaults({
2128		dig = {name = "default_dig_snappy", gain = 0.2},
2129		dug = {name = "default_grass_footstep", gain = 0.25},
2130	}),
2131
2132	on_place = coral_on_place,
2133
2134	after_destruct  = function(pos, oldnode)
2135		minetest.set_node(pos, {name = "default:coral_skeleton"})
2136	end,
2137})
2138
2139minetest.register_node("default:coral_cyan", {
2140	description = S("Cyan Coral"),
2141	drawtype = "plantlike_rooted",
2142	waving = 1,
2143	paramtype = "light",
2144	tiles = {"default_coral_skeleton.png"},
2145	special_tiles = {{name = "default_coral_cyan.png", tileable_vertical = true}},
2146	inventory_image = "default_coral_cyan.png",
2147	wield_image = "default_coral_cyan.png",
2148	groups = {snappy = 3},
2149	selection_box = {
2150		type = "fixed",
2151		fixed = {
2152				{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
2153				{-4/16, 0.5, -4/16, 4/16, 1.5, 4/16},
2154		},
2155	},
2156	node_dig_prediction = "default:coral_skeleton",
2157	node_placement_prediction = "",
2158	sounds = default.node_sound_stone_defaults({
2159		dig = {name = "default_dig_snappy", gain = 0.2},
2160		dug = {name = "default_grass_footstep", gain = 0.25},
2161	}),
2162
2163	on_place = coral_on_place,
2164
2165	after_destruct  = function(pos, oldnode)
2166		minetest.set_node(pos, {name = "default:coral_skeleton"})
2167	end,
2168})
2169
2170minetest.register_node("default:coral_brown", {
2171	description = S("Brown Coral"),
2172	tiles = {"default_coral_brown.png"},
2173	groups = {cracky = 3},
2174	drop = "default:coral_skeleton",
2175	sounds = default.node_sound_stone_defaults(),
2176})
2177
2178minetest.register_node("default:coral_orange", {
2179	description = S("Orange Coral"),
2180	tiles = {"default_coral_orange.png"},
2181	groups = {cracky = 3},
2182	drop = "default:coral_skeleton",
2183	sounds = default.node_sound_stone_defaults(),
2184})
2185
2186minetest.register_node("default:coral_skeleton", {
2187	description = S("Coral Skeleton"),
2188	tiles = {"default_coral_skeleton.png"},
2189	groups = {cracky = 3},
2190	sounds = default.node_sound_stone_defaults(),
2191})
2192
2193
2194--
2195-- Liquids
2196--
2197
2198minetest.register_node("default:water_source", {
2199	description = S("Water Source"),
2200	drawtype = "liquid",
2201	waving = 3,
2202	tiles = {
2203		{
2204			name = "default_water_source_animated.png",
2205			backface_culling = false,
2206			animation = {
2207				type = "vertical_frames",
2208				aspect_w = 16,
2209				aspect_h = 16,
2210				length = 2.0,
2211			},
2212		},
2213		{
2214			name = "default_water_source_animated.png",
2215			backface_culling = true,
2216			animation = {
2217				type = "vertical_frames",
2218				aspect_w = 16,
2219				aspect_h = 16,
2220				length = 2.0,
2221			},
2222		},
2223	},
2224	use_texture_alpha = "blend",
2225	paramtype = "light",
2226	walkable = false,
2227	pointable = false,
2228	diggable = false,
2229	buildable_to = true,
2230	is_ground_content = false,
2231	drop = "",
2232	drowning = 1,
2233	liquidtype = "source",
2234	liquid_alternative_flowing = "default:water_flowing",
2235	liquid_alternative_source = "default:water_source",
2236	liquid_viscosity = 1,
2237	post_effect_color = {a = 103, r = 30, g = 60, b = 90},
2238	groups = {water = 3, liquid = 3, cools_lava = 1},
2239	sounds = default.node_sound_water_defaults(),
2240})
2241
2242minetest.register_node("default:water_flowing", {
2243	description = S("Flowing Water"),
2244	drawtype = "flowingliquid",
2245	waving = 3,
2246	tiles = {"default_water.png"},
2247	special_tiles = {
2248		{
2249			name = "default_water_flowing_animated.png",
2250			backface_culling = false,
2251			animation = {
2252				type = "vertical_frames",
2253				aspect_w = 16,
2254				aspect_h = 16,
2255				length = 0.5,
2256			},
2257		},
2258		{
2259			name = "default_water_flowing_animated.png",
2260			backface_culling = true,
2261			animation = {
2262				type = "vertical_frames",
2263				aspect_w = 16,
2264				aspect_h = 16,
2265				length = 0.5,
2266			},
2267		},
2268	},
2269	use_texture_alpha = "blend",
2270	paramtype = "light",
2271	paramtype2 = "flowingliquid",
2272	walkable = false,
2273	pointable = false,
2274	diggable = false,
2275	buildable_to = true,
2276	is_ground_content = false,
2277	drop = "",
2278	drowning = 1,
2279	liquidtype = "flowing",
2280	liquid_alternative_flowing = "default:water_flowing",
2281	liquid_alternative_source = "default:water_source",
2282	liquid_viscosity = 1,
2283	post_effect_color = {a = 103, r = 30, g = 60, b = 90},
2284	groups = {water = 3, liquid = 3, not_in_creative_inventory = 1,
2285		cools_lava = 1},
2286	sounds = default.node_sound_water_defaults(),
2287})
2288
2289
2290minetest.register_node("default:river_water_source", {
2291	description = S("River Water Source"),
2292	drawtype = "liquid",
2293	tiles = {
2294		{
2295			name = "default_river_water_source_animated.png",
2296			backface_culling = false,
2297			animation = {
2298				type = "vertical_frames",
2299				aspect_w = 16,
2300				aspect_h = 16,
2301				length = 2.0,
2302			},
2303		},
2304		{
2305			name = "default_river_water_source_animated.png",
2306			backface_culling = true,
2307			animation = {
2308				type = "vertical_frames",
2309				aspect_w = 16,
2310				aspect_h = 16,
2311				length = 2.0,
2312			},
2313		},
2314	},
2315	use_texture_alpha = "blend",
2316	paramtype = "light",
2317	walkable = false,
2318	pointable = false,
2319	diggable = false,
2320	buildable_to = true,
2321	is_ground_content = false,
2322	drop = "",
2323	drowning = 1,
2324	liquidtype = "source",
2325	liquid_alternative_flowing = "default:river_water_flowing",
2326	liquid_alternative_source = "default:river_water_source",
2327	liquid_viscosity = 1,
2328	-- Not renewable to avoid horizontal spread of water sources in sloping
2329	-- rivers that can cause water to overflow riverbanks and cause floods.
2330	-- River water source is instead made renewable by the 'force renew'
2331	-- option used in the 'bucket' mod by the river water bucket.
2332	liquid_renewable = false,
2333	liquid_range = 2,
2334	post_effect_color = {a = 103, r = 30, g = 76, b = 90},
2335	groups = {water = 3, liquid = 3, cools_lava = 1},
2336	sounds = default.node_sound_water_defaults(),
2337})
2338
2339minetest.register_node("default:river_water_flowing", {
2340	description = S("Flowing River Water"),
2341	drawtype = "flowingliquid",
2342	tiles = {"default_river_water.png"},
2343	special_tiles = {
2344		{
2345			name = "default_river_water_flowing_animated.png",
2346			backface_culling = false,
2347			animation = {
2348				type = "vertical_frames",
2349				aspect_w = 16,
2350				aspect_h = 16,
2351				length = 0.5,
2352			},
2353		},
2354		{
2355			name = "default_river_water_flowing_animated.png",
2356			backface_culling = true,
2357			animation = {
2358				type = "vertical_frames",
2359				aspect_w = 16,
2360				aspect_h = 16,
2361				length = 0.5,
2362			},
2363		},
2364	},
2365	use_texture_alpha = "blend",
2366	paramtype = "light",
2367	paramtype2 = "flowingliquid",
2368	walkable = false,
2369	pointable = false,
2370	diggable = false,
2371	buildable_to = true,
2372	is_ground_content = false,
2373	drop = "",
2374	drowning = 1,
2375	liquidtype = "flowing",
2376	liquid_alternative_flowing = "default:river_water_flowing",
2377	liquid_alternative_source = "default:river_water_source",
2378	liquid_viscosity = 1,
2379	liquid_renewable = false,
2380	liquid_range = 2,
2381	post_effect_color = {a = 103, r = 30, g = 76, b = 90},
2382	groups = {water = 3, liquid = 3, not_in_creative_inventory = 1,
2383		cools_lava = 1},
2384	sounds = default.node_sound_water_defaults(),
2385})
2386
2387
2388minetest.register_node("default:lava_source", {
2389	description = S("Lava Source"),
2390	drawtype = "liquid",
2391	tiles = {
2392		{
2393			name = "default_lava_source_animated.png",
2394			backface_culling = false,
2395			animation = {
2396				type = "vertical_frames",
2397				aspect_w = 16,
2398				aspect_h = 16,
2399				length = 3.0,
2400			},
2401		},
2402		{
2403			name = "default_lava_source_animated.png",
2404			backface_culling = true,
2405			animation = {
2406				type = "vertical_frames",
2407				aspect_w = 16,
2408				aspect_h = 16,
2409				length = 3.0,
2410			},
2411		},
2412	},
2413	paramtype = "light",
2414	light_source = default.LIGHT_MAX - 1,
2415	walkable = false,
2416	pointable = false,
2417	diggable = false,
2418	buildable_to = true,
2419	is_ground_content = false,
2420	drop = "",
2421	drowning = 1,
2422	liquidtype = "source",
2423	liquid_alternative_flowing = "default:lava_flowing",
2424	liquid_alternative_source = "default:lava_source",
2425	liquid_viscosity = 7,
2426	liquid_renewable = false,
2427	damage_per_second = 4 * 2,
2428	post_effect_color = {a = 191, r = 255, g = 64, b = 0},
2429	groups = {lava = 3, liquid = 2, igniter = 1},
2430})
2431
2432minetest.register_node("default:lava_flowing", {
2433	description = S("Flowing Lava"),
2434	drawtype = "flowingliquid",
2435	tiles = {"default_lava.png"},
2436	special_tiles = {
2437		{
2438			name = "default_lava_flowing_animated.png",
2439			backface_culling = false,
2440			animation = {
2441				type = "vertical_frames",
2442				aspect_w = 16,
2443				aspect_h = 16,
2444				length = 3.3,
2445			},
2446		},
2447		{
2448			name = "default_lava_flowing_animated.png",
2449			backface_culling = true,
2450			animation = {
2451				type = "vertical_frames",
2452				aspect_w = 16,
2453				aspect_h = 16,
2454				length = 3.3,
2455			},
2456		},
2457	},
2458	paramtype = "light",
2459	paramtype2 = "flowingliquid",
2460	light_source = default.LIGHT_MAX - 1,
2461	walkable = false,
2462	pointable = false,
2463	diggable = false,
2464	buildable_to = true,
2465	is_ground_content = false,
2466	drop = "",
2467	drowning = 1,
2468	liquidtype = "flowing",
2469	liquid_alternative_flowing = "default:lava_flowing",
2470	liquid_alternative_source = "default:lava_source",
2471	liquid_viscosity = 7,
2472	liquid_renewable = false,
2473	damage_per_second = 4 * 2,
2474	post_effect_color = {a = 191, r = 255, g = 64, b = 0},
2475	groups = {lava = 3, liquid = 2, igniter = 1,
2476		not_in_creative_inventory = 1},
2477})
2478
2479--
2480-- Tools / "Advanced" crafting / Non-"natural"
2481--
2482
2483local bookshelf_formspec =
2484	"size[8,7;]" ..
2485	"list[context;books;0,0.3;8,2;]" ..
2486	"list[current_player;main;0,2.85;8,1;]" ..
2487	"list[current_player;main;0,4.08;8,3;8]" ..
2488	"listring[context;books]" ..
2489	"listring[current_player;main]" ..
2490	default.get_hotbar_bg(0,2.85)
2491
2492local function update_bookshelf(pos)
2493	local meta = minetest.get_meta(pos)
2494	local inv = meta:get_inventory()
2495	local invlist = inv:get_list("books")
2496
2497	local formspec = bookshelf_formspec
2498	-- Inventory slots overlay
2499	local bx, by = 0, 0.3
2500	local n_written, n_empty = 0, 0
2501	for i = 1, 16 do
2502		if i == 9 then
2503			bx = 0
2504			by = by + 1
2505		end
2506		local stack = invlist[i]
2507		if stack:is_empty() then
2508			formspec = formspec ..
2509				"image[" .. bx .. "," .. by .. ";1,1;default_bookshelf_slot.png]"
2510		else
2511			local metatable = stack:get_meta():to_table() or {}
2512			if metatable.fields and metatable.fields.text then
2513				n_written = n_written + stack:get_count()
2514			else
2515				n_empty = n_empty + stack:get_count()
2516			end
2517		end
2518		bx = bx + 1
2519	end
2520	meta:set_string("formspec", formspec)
2521	if n_written + n_empty == 0 then
2522		meta:set_string("infotext", S("Empty Bookshelf"))
2523	else
2524		meta:set_string("infotext", S("Bookshelf (@1 written, @2 empty books)", n_written, n_empty))
2525	end
2526end
2527
2528minetest.register_node("default:bookshelf", {
2529	description = S("Bookshelf"),
2530	tiles = {"default_wood.png", "default_wood.png", "default_wood.png",
2531		"default_wood.png", "default_bookshelf.png", "default_bookshelf.png"},
2532	paramtype2 = "facedir",
2533	is_ground_content = false,
2534	groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
2535	sounds = default.node_sound_wood_defaults(),
2536
2537	on_construct = function(pos)
2538		local meta = minetest.get_meta(pos)
2539		local inv = meta:get_inventory()
2540		inv:set_size("books", 8 * 2)
2541		update_bookshelf(pos)
2542	end,
2543	can_dig = function(pos,player)
2544		local inv = minetest.get_meta(pos):get_inventory()
2545		return inv:is_empty("books")
2546	end,
2547	allow_metadata_inventory_put = function(pos, listname, index, stack)
2548		if minetest.get_item_group(stack:get_name(), "book") ~= 0 then
2549			return stack:get_count()
2550		end
2551		return 0
2552	end,
2553	on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
2554		minetest.log("action", player:get_player_name() ..
2555			" moves stuff in bookshelf at " .. minetest.pos_to_string(pos))
2556		update_bookshelf(pos)
2557	end,
2558	on_metadata_inventory_put = function(pos, listname, index, stack, player)
2559		minetest.log("action", player:get_player_name() ..
2560			" puts stuff to bookshelf at " .. minetest.pos_to_string(pos))
2561		update_bookshelf(pos)
2562	end,
2563	on_metadata_inventory_take = function(pos, listname, index, stack, player)
2564		minetest.log("action", player:get_player_name() ..
2565			" takes stuff from bookshelf at " .. minetest.pos_to_string(pos))
2566		update_bookshelf(pos)
2567	end,
2568	on_blast = function(pos)
2569		local drops = {}
2570		default.get_inventory_drops(pos, "books", drops)
2571		drops[#drops+1] = "default:bookshelf"
2572		minetest.remove_node(pos)
2573		return drops
2574	end,
2575})
2576
2577local function register_sign(material, desc, def)
2578	minetest.register_node("default:sign_wall_" .. material, {
2579		description = desc,
2580		drawtype = "nodebox",
2581		tiles = {"default_sign_wall_" .. material .. ".png"},
2582		inventory_image = "default_sign_" .. material .. ".png",
2583		wield_image = "default_sign_" .. material .. ".png",
2584		paramtype = "light",
2585		paramtype2 = "wallmounted",
2586		sunlight_propagates = true,
2587		is_ground_content = false,
2588		walkable = false,
2589		use_texture_alpha = "opaque",
2590		node_box = {
2591			type = "wallmounted",
2592			wall_top    = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
2593			wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
2594			wall_side   = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375},
2595		},
2596		groups = def.groups,
2597		legacy_wallmounted = true,
2598		sounds = def.sounds,
2599
2600		on_construct = function(pos)
2601			local meta = minetest.get_meta(pos)
2602			meta:set_string("formspec", "field[text;;${text}]")
2603		end,
2604		on_receive_fields = function(pos, formname, fields, sender)
2605			local player_name = sender:get_player_name()
2606			if minetest.is_protected(pos, player_name) then
2607				minetest.record_protection_violation(pos, player_name)
2608				return
2609			end
2610			local text = fields.text
2611			if not text then
2612				return
2613			end
2614			if string.len(text) > 512 then
2615				minetest.chat_send_player(player_name, S("Text too long"))
2616				return
2617			end
2618			minetest.log("action", player_name .. " wrote \"" .. text ..
2619				"\" to the sign at " .. minetest.pos_to_string(pos))
2620			local meta = minetest.get_meta(pos)
2621			meta:set_string("text", text)
2622
2623			if #text > 0 then
2624				meta:set_string("infotext", S('"@1"', text))
2625			else
2626				meta:set_string("infotext", '')
2627			end
2628		end,
2629	})
2630end
2631
2632register_sign("wood", S("Wooden Sign"), {
2633	sounds = default.node_sound_wood_defaults(),
2634	groups = {choppy = 2, attached_node = 1, flammable = 2, oddly_breakable_by_hand = 3}
2635})
2636
2637register_sign("steel", S("Steel Sign"), {
2638	sounds = default.node_sound_metal_defaults(),
2639	groups = {cracky = 2, attached_node = 1}
2640})
2641
2642minetest.register_node("default:ladder_wood", {
2643	description = S("Wooden Ladder"),
2644	drawtype = "signlike",
2645	tiles = {"default_ladder_wood.png"},
2646	inventory_image = "default_ladder_wood.png",
2647	wield_image = "default_ladder_wood.png",
2648	paramtype = "light",
2649	paramtype2 = "wallmounted",
2650	sunlight_propagates = true,
2651	walkable = false,
2652	climbable = true,
2653	is_ground_content = false,
2654	selection_box = {
2655		type = "wallmounted",
2656		--wall_top = = <default>
2657		--wall_bottom = = <default>
2658		--wall_side = = <default>
2659	},
2660	groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2},
2661	legacy_wallmounted = true,
2662	sounds = default.node_sound_wood_defaults(),
2663})
2664
2665minetest.register_node("default:ladder_steel", {
2666	description = S("Steel Ladder"),
2667	drawtype = "signlike",
2668	tiles = {"default_ladder_steel.png"},
2669	inventory_image = "default_ladder_steel.png",
2670	wield_image = "default_ladder_steel.png",
2671	paramtype = "light",
2672	paramtype2 = "wallmounted",
2673	sunlight_propagates = true,
2674	walkable = false,
2675	climbable = true,
2676	is_ground_content = false,
2677	selection_box = {
2678		type = "wallmounted",
2679		--wall_top = = <default>
2680		--wall_bottom = = <default>
2681		--wall_side = = <default>
2682	},
2683	groups = {cracky = 2},
2684	sounds = default.node_sound_metal_defaults(),
2685})
2686
2687default.register_fence("default:fence_wood", {
2688	description = S("Apple Wood Fence"),
2689	texture = "default_fence_wood.png",
2690	inventory_image = "default_fence_overlay.png^default_wood.png^" ..
2691				"default_fence_overlay.png^[makealpha:255,126,126",
2692	wield_image = "default_fence_overlay.png^default_wood.png^" ..
2693				"default_fence_overlay.png^[makealpha:255,126,126",
2694	material = "default:wood",
2695	groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
2696	sounds = default.node_sound_wood_defaults()
2697})
2698
2699default.register_fence("default:fence_acacia_wood", {
2700	description = S("Acacia Wood Fence"),
2701	texture = "default_fence_acacia_wood.png",
2702	inventory_image = "default_fence_overlay.png^default_acacia_wood.png^" ..
2703				"default_fence_overlay.png^[makealpha:255,126,126",
2704	wield_image = "default_fence_overlay.png^default_acacia_wood.png^" ..
2705				"default_fence_overlay.png^[makealpha:255,126,126",
2706	material = "default:acacia_wood",
2707	groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
2708	sounds = default.node_sound_wood_defaults()
2709})
2710
2711default.register_fence("default:fence_junglewood", {
2712	description = S("Jungle Wood Fence"),
2713	texture = "default_fence_junglewood.png",
2714	inventory_image = "default_fence_overlay.png^default_junglewood.png^" ..
2715				"default_fence_overlay.png^[makealpha:255,126,126",
2716	wield_image = "default_fence_overlay.png^default_junglewood.png^" ..
2717				"default_fence_overlay.png^[makealpha:255,126,126",
2718	material = "default:junglewood",
2719	groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
2720	sounds = default.node_sound_wood_defaults()
2721})
2722
2723default.register_fence("default:fence_pine_wood", {
2724	description = S("Pine Wood Fence"),
2725	texture = "default_fence_pine_wood.png",
2726	inventory_image = "default_fence_overlay.png^default_pine_wood.png^" ..
2727				"default_fence_overlay.png^[makealpha:255,126,126",
2728	wield_image = "default_fence_overlay.png^default_pine_wood.png^" ..
2729				"default_fence_overlay.png^[makealpha:255,126,126",
2730	material = "default:pine_wood",
2731	groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
2732	sounds = default.node_sound_wood_defaults()
2733})
2734
2735default.register_fence("default:fence_aspen_wood", {
2736	description = S("Aspen Wood Fence"),
2737	texture = "default_fence_aspen_wood.png",
2738	inventory_image = "default_fence_overlay.png^default_aspen_wood.png^" ..
2739				"default_fence_overlay.png^[makealpha:255,126,126",
2740	wield_image = "default_fence_overlay.png^default_aspen_wood.png^" ..
2741				"default_fence_overlay.png^[makealpha:255,126,126",
2742	material = "default:aspen_wood",
2743	groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
2744	sounds = default.node_sound_wood_defaults()
2745})
2746
2747default.register_fence_rail("default:fence_rail_wood", {
2748	description = S("Apple Wood Fence Rail"),
2749	texture = "default_fence_rail_wood.png",
2750	inventory_image = "default_fence_rail_overlay.png^default_wood.png^" ..
2751				"default_fence_rail_overlay.png^[makealpha:255,126,126",
2752	wield_image = "default_fence_rail_overlay.png^default_wood.png^" ..
2753				"default_fence_rail_overlay.png^[makealpha:255,126,126",
2754	material = "default:wood",
2755	groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
2756	sounds = default.node_sound_wood_defaults()
2757})
2758
2759default.register_fence_rail("default:fence_rail_acacia_wood", {
2760	description = S("Acacia Wood Fence Rail"),
2761	texture = "default_fence_rail_acacia_wood.png",
2762	inventory_image = "default_fence_rail_overlay.png^default_acacia_wood.png^" ..
2763				"default_fence_rail_overlay.png^[makealpha:255,126,126",
2764	wield_image = "default_fence_rail_overlay.png^default_acacia_wood.png^" ..
2765				"default_fence_rail_overlay.png^[makealpha:255,126,126",
2766	material = "default:acacia_wood",
2767	groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
2768	sounds = default.node_sound_wood_defaults()
2769})
2770
2771default.register_fence_rail("default:fence_rail_junglewood", {
2772	description = S("Jungle Wood Fence Rail"),
2773	texture = "default_fence_rail_junglewood.png",
2774	inventory_image = "default_fence_rail_overlay.png^default_junglewood.png^" ..
2775				"default_fence_rail_overlay.png^[makealpha:255,126,126",
2776	wield_image = "default_fence_rail_overlay.png^default_junglewood.png^" ..
2777				"default_fence_rail_overlay.png^[makealpha:255,126,126",
2778	material = "default:junglewood",
2779	groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
2780	sounds = default.node_sound_wood_defaults()
2781})
2782
2783default.register_fence_rail("default:fence_rail_pine_wood", {
2784	description = S("Pine Wood Fence Rail"),
2785	texture = "default_fence_rail_pine_wood.png",
2786	inventory_image = "default_fence_rail_overlay.png^default_pine_wood.png^" ..
2787				"default_fence_rail_overlay.png^[makealpha:255,126,126",
2788	wield_image = "default_fence_rail_overlay.png^default_pine_wood.png^" ..
2789				"default_fence_rail_overlay.png^[makealpha:255,126,126",
2790	material = "default:pine_wood",
2791	groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
2792	sounds = default.node_sound_wood_defaults()
2793})
2794
2795default.register_fence_rail("default:fence_rail_aspen_wood", {
2796	description = S("Aspen Wood Fence Rail"),
2797	texture = "default_fence_rail_aspen_wood.png",
2798	inventory_image = "default_fence_rail_overlay.png^default_aspen_wood.png^" ..
2799				"default_fence_rail_overlay.png^[makealpha:255,126,126",
2800	wield_image = "default_fence_rail_overlay.png^default_aspen_wood.png^" ..
2801				"default_fence_rail_overlay.png^[makealpha:255,126,126",
2802	material = "default:aspen_wood",
2803	groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 2},
2804	sounds = default.node_sound_wood_defaults()
2805})
2806
2807minetest.register_node("default:glass", {
2808	description = S("Glass"),
2809	drawtype = "glasslike_framed_optional",
2810	tiles = {"default_glass.png", "default_glass_detail.png"},
2811	use_texture_alpha = "clip", -- only needed for stairs API
2812	paramtype = "light",
2813	paramtype2 = "glasslikeliquidlevel",
2814	sunlight_propagates = true,
2815	is_ground_content = false,
2816	groups = {cracky = 3, oddly_breakable_by_hand = 3},
2817	sounds = default.node_sound_glass_defaults(),
2818})
2819
2820minetest.register_node("default:obsidian_glass", {
2821	description = S("Obsidian Glass"),
2822	drawtype = "glasslike_framed_optional",
2823	tiles = {"default_obsidian_glass.png", "default_obsidian_glass_detail.png"},
2824	use_texture_alpha = "clip", -- only needed for stairs API
2825	paramtype = "light",
2826	paramtype2 = "glasslikeliquidlevel",
2827	is_ground_content = false,
2828	sunlight_propagates = true,
2829	sounds = default.node_sound_glass_defaults(),
2830	groups = {cracky = 3},
2831})
2832
2833
2834minetest.register_node("default:brick", {
2835	description = S("Brick Block"),
2836	paramtype2 = "facedir",
2837	place_param2 = 0,
2838	tiles = {
2839		"default_brick.png^[transformFX",
2840		"default_brick.png",
2841	},
2842	is_ground_content = false,
2843	groups = {cracky = 3},
2844	sounds = default.node_sound_stone_defaults(),
2845})
2846
2847
2848minetest.register_node("default:meselamp", {
2849	description = S("Mese Lamp"),
2850	drawtype = "glasslike",
2851	tiles = {"default_meselamp.png"},
2852	paramtype = "light",
2853	sunlight_propagates = true,
2854	is_ground_content = false,
2855	groups = {cracky = 3, oddly_breakable_by_hand = 3},
2856	sounds = default.node_sound_glass_defaults(),
2857	light_source = default.LIGHT_MAX,
2858})
2859
2860default.register_mesepost("default:mese_post_light", {
2861	description = S("Apple Wood Mese Post Light"),
2862	texture = "default_fence_wood.png",
2863	material = "default:wood",
2864})
2865
2866default.register_mesepost("default:mese_post_light_acacia_wood", {
2867	description = S("Acacia Wood Mese Post Light"),
2868	texture = "default_fence_acacia_wood.png",
2869	material = "default:acacia_wood",
2870})
2871
2872default.register_mesepost("default:mese_post_light_junglewood", {
2873	description = S("Jungle Wood Mese Post Light"),
2874	texture = "default_fence_junglewood.png",
2875	material = "default:junglewood",
2876})
2877
2878default.register_mesepost("default:mese_post_light_pine_wood", {
2879	description = S("Pine Wood Mese Post Light"),
2880	texture = "default_fence_pine_wood.png",
2881	material = "default:pine_wood",
2882})
2883
2884default.register_mesepost("default:mese_post_light_aspen_wood", {
2885	description = S("Aspen Wood Mese Post Light"),
2886	texture = "default_fence_aspen_wood.png",
2887	material = "default:aspen_wood",
2888})
2889
2890--
2891-- Misc
2892--
2893
2894minetest.register_node("default:cloud", {
2895	description = S("Cloud"),
2896	tiles = {"default_cloud.png"},
2897	is_ground_content = false,
2898	sounds = default.node_sound_defaults(),
2899	groups = {not_in_creative_inventory = 1},
2900})
2901
2902--
2903-- register trees for leafdecay
2904--
2905
2906if minetest.get_mapgen_setting("mg_name") == "v6" then
2907	default.register_leafdecay({
2908		trunks = {"default:tree"},
2909		leaves = {"default:apple", "default:leaves"},
2910		radius = 2,
2911	})
2912
2913	default.register_leafdecay({
2914		trunks = {"default:jungletree"},
2915		leaves = {"default:jungleleaves"},
2916		radius = 3,
2917	})
2918else
2919	default.register_leafdecay({
2920		trunks = {"default:tree"},
2921		leaves = {"default:apple", "default:leaves"},
2922		radius = 3,
2923	})
2924
2925	default.register_leafdecay({
2926		trunks = {"default:jungletree"},
2927		leaves = {"default:jungleleaves"},
2928		radius = 2,
2929	})
2930end
2931
2932default.register_leafdecay({
2933	trunks = {"default:pine_tree"},
2934	leaves = {"default:pine_needles"},
2935	radius = 3,
2936})
2937
2938default.register_leafdecay({
2939	trunks = {"default:acacia_tree"},
2940	leaves = {"default:acacia_leaves"},
2941	radius = 2,
2942})
2943
2944default.register_leafdecay({
2945	trunks = {"default:aspen_tree"},
2946	leaves = {"default:aspen_leaves"},
2947	radius = 3,
2948})
2949
2950default.register_leafdecay({
2951	trunks = {"default:bush_stem"},
2952	leaves = {"default:bush_leaves"},
2953	radius = 1,
2954})
2955
2956default.register_leafdecay({
2957	trunks = {"default:acacia_bush_stem"},
2958	leaves = {"default:acacia_bush_leaves"},
2959	radius = 1,
2960})
2961
2962default.register_leafdecay({
2963	trunks = {"default:pine_bush_stem"},
2964	leaves = {"default:pine_bush_needles"},
2965	radius = 1,
2966})
2967