Skip to content

Commit 57939c6

Browse files
sofarparamat
authored andcommittedJan 7, 2016
Place tree logs as decorations.
We can vary the landscape a bit more by placing "fallen logs" around the various forests. These decorations are quite fast and will provide some gameplay value but are still more rare than the corresponding trees, so they don't provide free materials. I've manually put the schematic as lua tables since these log schematics are only 8 blocks. We vary the log lengths between 1 and 3 blocks by making the end blocks have a lower chance of appearing. Amount is varied by fill_ratio, except for acacia trees where we reduce the scale, so that acacia logs show up near places with acacia trees consistently. Mushrooms are placed optionally on each log. We can't place two different mushrooms on a log, so instead we opt to place brown mushrooms on oak/appletree logs, brown mushrooms on jungletree logs, and red mushrooms on pine logs. No mushrooms are placed on acacia logs, as they occur in a dry biome, savannah, and this adds a bit of biome diversity.
1 parent 9542d11 commit 57939c6

File tree

1 file changed

+112
-4
lines changed

1 file changed

+112
-4
lines changed
 

Diff for: ‎mods/default/mapgen.lua

+112-4
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ end
967967
function default.register_decorations()
968968
minetest.clear_registered_decorations()
969969

970-
-- Apple tree
970+
-- Apple tree and log
971971

972972
minetest.register_decoration({
973973
deco_type = "schematic",
@@ -988,7 +988,33 @@ function default.register_decorations()
988988
flags = "place_center_x, place_center_z",
989989
})
990990

991-
-- Jungle tree
991+
minetest.register_decoration({
992+
deco_type = "schematic",
993+
place_on = {"default:dirt_with_grass"},
994+
sidelen = 80,
995+
fill_ratio = 0.0015,
996+
biomes = {"deciduous_forest"},
997+
y_min = 1,
998+
y_max = 31000,
999+
schematic = {
1000+
size = { x = 3, y = 3, z = 1},
1001+
data = {
1002+
{ name = "air", prob = 0 },
1003+
{ name = "air", prob = 0 },
1004+
{ name = "air", prob = 0 },
1005+
{ name = "default:tree", param2 = 12, prob = 191 },
1006+
{ name = "default:tree", param2 = 12 },
1007+
{ name = "default:tree", param2 = 12, prob = 127 },
1008+
{ name = "air", prob = 0 },
1009+
{ name = "flowers:mushroom_brown", prob = 63 },
1010+
{ name = "air", prob = 0 },
1011+
},
1012+
},
1013+
flags = "place_center_x",
1014+
rotation = "random",
1015+
})
1016+
1017+
-- Jungle tree and log
9921018

9931019
minetest.register_decoration({
9941020
deco_type = "schematic",
@@ -1003,7 +1029,33 @@ function default.register_decorations()
10031029
rotation = "random",
10041030
})
10051031

1006-
-- Taiga and temperate coniferous forest pine tree
1032+
minetest.register_decoration({
1033+
deco_type = "schematic",
1034+
place_on = {"default:dirt_with_grass", "default:dirt"},
1035+
sidelen = 80,
1036+
fill_ratio = 0.01,
1037+
biomes = {"rainforest", "rainforest_swamp"},
1038+
y_min = 1,
1039+
y_max = 31000,
1040+
schematic = {
1041+
size = { x = 3, y = 3, z = 1},
1042+
data = {
1043+
{ name = "air", prob = 0 },
1044+
{ name = "air", prob = 0 },
1045+
{ name = "air", prob = 0 },
1046+
{ name = "default:jungletree", param2 = 12, prob = 191 },
1047+
{ name = "default:jungletree", param2 = 12 },
1048+
{ name = "default:jungletree", param2 = 12, prob = 127 },
1049+
{ name = "air", prob = 0 },
1050+
{ name = "flowers:mushroom_brown", prob = 127 },
1051+
{ name = "air", prob = 0 },
1052+
},
1053+
},
1054+
flags = "place_center_x",
1055+
rotation = "random",
1056+
})
1057+
1058+
-- Taiga and temperate coniferous forest pine tree and log
10071059

10081060
minetest.register_decoration({
10091061
deco_type = "schematic",
@@ -1024,7 +1076,33 @@ function default.register_decorations()
10241076
flags = "place_center_x, place_center_z",
10251077
})
10261078

1027-
-- Acacia tree
1079+
minetest.register_decoration({
1080+
deco_type = "schematic",
1081+
place_on = {"default:dirt_with_snow", "default:dirt_with_grass"},
1082+
sidelen = 80,
1083+
fill_ratio = 0.003,
1084+
biomes = {"taiga", "coniferous_forest"},
1085+
y_min = 1,
1086+
y_max = 31000,
1087+
schematic = {
1088+
size = { x = 3, y = 3, z = 1},
1089+
data = {
1090+
{ name = "air", prob = 0 },
1091+
{ name = "air", prob = 0 },
1092+
{ name = "air", prob = 0 },
1093+
{ name = "default:pine_tree", param2 = 12, prob = 191 },
1094+
{ name = "default:pine_tree", param2 = 12 },
1095+
{ name = "default:pine_tree", param2 = 12, prob = 127 },
1096+
{ name = "air", prob = 0 },
1097+
{ name = "flowers:mushroom_red", prob = 127 },
1098+
{ name = "air", prob = 0 },
1099+
},
1100+
},
1101+
flags = "place_center_x",
1102+
rotation = "random",
1103+
})
1104+
1105+
-- Acacia tree and log
10281106

10291107
minetest.register_decoration({
10301108
deco_type = "schematic",
@@ -1046,6 +1124,36 @@ function default.register_decorations()
10461124
rotation = "random",
10471125
})
10481126

1127+
minetest.register_decoration({
1128+
deco_type = "schematic",
1129+
place_on = {"default:dirt_with_dry_grass"},
1130+
sidelen = 16,
1131+
noise_params = {
1132+
offset = 0,
1133+
scale = 0.001,
1134+
spread = {x = 250, y = 250, z = 250},
1135+
seed = 2,
1136+
octaves = 3,
1137+
persist = 0.66
1138+
},
1139+
biomes = {"savanna"},
1140+
y_min = 1,
1141+
y_max = 31000,
1142+
schematic = {
1143+
size = { x = 3, y = 2, z = 1},
1144+
data = {
1145+
{ name = "air", prob = 0 },
1146+
{ name = "air", prob = 0 },
1147+
{ name = "air", prob = 0 },
1148+
{ name = "default:acacia_tree", param2 = 12, prob = 191 },
1149+
{ name = "default:acacia_tree", param2 = 12 },
1150+
{ name = "default:acacia_tree", param2 = 12, prob = 127 },
1151+
},
1152+
},
1153+
flags = "place_center_x",
1154+
rotation = "random",
1155+
})
1156+
10491157
-- Large cactus
10501158

10511159
minetest.register_decoration({

0 commit comments

Comments
 (0)
Please sign in to comment.