Skip to content

Commit 7f3e9e6

Browse files
committedFeb 7, 2018
Add marram grass for coastal sand dunes
Use noise with 1 octave and flag 'absvalue' to create sand paths in dunes.
1 parent ca81e9b commit 7f3e9e6

7 files changed

+89
-3
lines changed
 

Diff for: ‎mods/default/README.txt

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ paramat (CC BY-SA 3.0):
114114
default_silver_sandstone_brick.png -- Derived from a texture by GreenXenith (CC-BY-SA 3.0)
115115
default_silver_sandstone_block.png -- Derived from a texture by GreenXenith (CC-BY-SA 3.0)
116116
default_bookshelf_slot.png -- Derived from a texture by Gambit (CC-BY-SA 3.0)
117+
default_marram_grass_*.png -- Derived from textures by TumeniNodes (CC-BY-SA 3.0)
117118

118119
TumeniNodes (CC BY-SA 3.0):
119120
default_desert_cobble.png -- Derived from a texture by brunob.santos (CC BY-SA 3.0)

Diff for: ‎mods/default/crafting.lua

+6
Original file line numberDiff line numberDiff line change
@@ -1104,6 +1104,12 @@ minetest.register_craft({
11041104
burntime = 2,
11051105
})
11061106

1107+
minetest.register_craft({
1108+
type = "fuel",
1109+
recipe = "default:marram_grass_1",
1110+
burntime = 2,
1111+
})
1112+
11071113
minetest.register_craft({
11081114
type = "fuel",
11091115
recipe = "default:paper",

Diff for: ‎mods/default/mapgen.lua

+27-3
Original file line numberDiff line numberDiff line change
@@ -1603,7 +1603,7 @@ end
16031603
local function register_grass_decoration(offset, scale, length)
16041604
minetest.register_decoration({
16051605
deco_type = "simple",
1606-
place_on = {"default:dirt_with_grass", "default:sand"},
1606+
place_on = {"default:dirt_with_grass"},
16071607
sidelen = 16,
16081608
noise_params = {
16091609
offset = offset,
@@ -1613,8 +1613,7 @@ local function register_grass_decoration(offset, scale, length)
16131613
octaves = 3,
16141614
persist = 0.6
16151615
},
1616-
biomes = {"grassland", "grassland_dunes", "deciduous_forest",
1617-
"coniferous_forest_dunes", "floatland_grassland"},
1616+
biomes = {"grassland", "deciduous_forest", "floatland_grassland"},
16181617
y_min = 1,
16191618
y_max = 31000,
16201619
decoration = "default:grass_" .. length,
@@ -2022,6 +2021,31 @@ function default.register_decorations()
20222021
param2 = 4,
20232022
})
20242023

2024+
-- Marram grass
2025+
2026+
minetest.register_decoration({
2027+
deco_type = "simple",
2028+
place_on = {"default:sand"},
2029+
sidelen = 4,
2030+
noise_params = {
2031+
offset = -0.4,
2032+
scale = 3.0,
2033+
spread = {x = 16, y = 16, z = 16},
2034+
seed = 513337,
2035+
octaves = 1,
2036+
persist = 0.5,
2037+
flags = "absvalue"
2038+
},
2039+
biomes = {"coniferous_forest_dunes", "grassland_dunes"},
2040+
y_min = 4,
2041+
y_max = 5,
2042+
decoration = {
2043+
"default:marram_grass_1",
2044+
"default:marram_grass_2",
2045+
"default:marram_grass_3",
2046+
},
2047+
})
2048+
20252049
-- Coral reef
20262050

20272051
minetest.register_decoration({

Diff for: ‎mods/default/nodes.lua

+55
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ default:fern_1
147147
default:fern_2
148148
default:fern_3
149149
150+
default:marram_grass_1
151+
default:marram_grass_2
152+
default:marram_grass_3
153+
150154
default:bush_stem
151155
default:bush_leaves
152156
default:bush_sapling
@@ -1373,6 +1377,57 @@ for i = 2, 3 do
13731377
end
13741378

13751379

1380+
minetest.register_node("default:marram_grass_1", {
1381+
description = "Marram Grass",
1382+
drawtype = "plantlike",
1383+
waving = 1,
1384+
tiles = {"default_marram_grass_1.png"},
1385+
inventory_image = "default_marram_grass_1.png",
1386+
wield_image = "default_marram_grass_1.png",
1387+
paramtype = "light",
1388+
sunlight_propagates = true,
1389+
walkable = false,
1390+
buildable_to = true,
1391+
groups = {snappy = 3, flammable = 3, attached_node = 1},
1392+
sounds = default.node_sound_leaves_defaults(),
1393+
selection_box = {
1394+
type = "fixed",
1395+
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -0.25, 6 / 16},
1396+
},
1397+
1398+
on_place = function(itemstack, placer, pointed_thing)
1399+
-- place a random marram grass node
1400+
local stack = ItemStack("default:marram_grass_" .. math.random(1, 3))
1401+
local ret = minetest.item_place(stack, placer, pointed_thing)
1402+
return ItemStack("default:marram_grass_1 " ..
1403+
itemstack:get_count() - (1 - ret:get_count()))
1404+
end,
1405+
})
1406+
1407+
for i = 2, 3 do
1408+
minetest.register_node("default:marram_grass_" .. i, {
1409+
description = "Marram Grass",
1410+
drawtype = "plantlike",
1411+
waving = 1,
1412+
tiles = {"default_marram_grass_" .. i .. ".png"},
1413+
inventory_image = "default_marram_grass_" .. i .. ".png",
1414+
wield_image = "default_marram_grass_" .. i .. ".png",
1415+
paramtype = "light",
1416+
sunlight_propagates = true,
1417+
walkable = false,
1418+
buildable_to = true,
1419+
groups = {snappy = 3, flammable = 3, attached_node = 1,
1420+
not_in_creative_inventory=1},
1421+
drop = "default:marram_grass_1",
1422+
sounds = default.node_sound_leaves_defaults(),
1423+
selection_box = {
1424+
type = "fixed",
1425+
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -0.25, 6 / 16},
1426+
},
1427+
})
1428+
end
1429+
1430+
13761431
minetest.register_node("default:bush_stem", {
13771432
description = "Bush Stem",
13781433
drawtype = "plantlike",

Diff for: ‎mods/default/textures/default_marram_grass_1.png

253 Bytes
Loading

Diff for: ‎mods/default/textures/default_marram_grass_2.png

447 Bytes
Loading

Diff for: ‎mods/default/textures/default_marram_grass_3.png

341 Bytes
Loading

0 commit comments

Comments
 (0)
Please sign in to comment.