Skip to content

Commit

Permalink
Add marram grass for coastal sand dunes
Browse files Browse the repository at this point in the history
Use noise with 1 octave and flag 'absvalue' to create sand paths
in dunes.
  • Loading branch information
paramat committed Feb 7, 2018
1 parent ca81e9b commit 7f3e9e6
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 3 deletions.
1 change: 1 addition & 0 deletions mods/default/README.txt
Expand Up @@ -114,6 +114,7 @@ paramat (CC BY-SA 3.0):
default_silver_sandstone_brick.png -- Derived from a texture by GreenXenith (CC-BY-SA 3.0)
default_silver_sandstone_block.png -- Derived from a texture by GreenXenith (CC-BY-SA 3.0)
default_bookshelf_slot.png -- Derived from a texture by Gambit (CC-BY-SA 3.0)
default_marram_grass_*.png -- Derived from textures by TumeniNodes (CC-BY-SA 3.0)

TumeniNodes (CC BY-SA 3.0):
default_desert_cobble.png -- Derived from a texture by brunob.santos (CC BY-SA 3.0)
Expand Down
6 changes: 6 additions & 0 deletions mods/default/crafting.lua
Expand Up @@ -1104,6 +1104,12 @@ minetest.register_craft({
burntime = 2,
})

minetest.register_craft({
type = "fuel",
recipe = "default:marram_grass_1",
burntime = 2,
})

minetest.register_craft({
type = "fuel",
recipe = "default:paper",
Expand Down
30 changes: 27 additions & 3 deletions mods/default/mapgen.lua
Expand Up @@ -1603,7 +1603,7 @@ end
local function register_grass_decoration(offset, scale, length)
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass", "default:sand"},
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = offset,
Expand All @@ -1613,8 +1613,7 @@ local function register_grass_decoration(offset, scale, length)
octaves = 3,
persist = 0.6
},
biomes = {"grassland", "grassland_dunes", "deciduous_forest",
"coniferous_forest_dunes", "floatland_grassland"},
biomes = {"grassland", "deciduous_forest", "floatland_grassland"},
y_min = 1,
y_max = 31000,
decoration = "default:grass_" .. length,
Expand Down Expand Up @@ -2022,6 +2021,31 @@ function default.register_decorations()
param2 = 4,
})

-- Marram grass

minetest.register_decoration({
deco_type = "simple",
place_on = {"default:sand"},
sidelen = 4,
noise_params = {
offset = -0.4,
scale = 3.0,
spread = {x = 16, y = 16, z = 16},
seed = 513337,
octaves = 1,
persist = 0.5,
flags = "absvalue"
},
biomes = {"coniferous_forest_dunes", "grassland_dunes"},
y_min = 4,
y_max = 5,
decoration = {
"default:marram_grass_1",
"default:marram_grass_2",
"default:marram_grass_3",
},
})

-- Coral reef

minetest.register_decoration({
Expand Down
55 changes: 55 additions & 0 deletions mods/default/nodes.lua
Expand Up @@ -147,6 +147,10 @@ default:fern_1
default:fern_2
default:fern_3
default:marram_grass_1
default:marram_grass_2
default:marram_grass_3
default:bush_stem
default:bush_leaves
default:bush_sapling
Expand Down Expand Up @@ -1373,6 +1377,57 @@ for i = 2, 3 do
end
minetest.register_node("default:marram_grass_1", {
description = "Marram Grass",
drawtype = "plantlike",
waving = 1,
tiles = {"default_marram_grass_1.png"},
inventory_image = "default_marram_grass_1.png",
wield_image = "default_marram_grass_1.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
groups = {snappy = 3, flammable = 3, attached_node = 1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -0.25, 6 / 16},
},
on_place = function(itemstack, placer, pointed_thing)
-- place a random marram grass node
local stack = ItemStack("default:marram_grass_" .. math.random(1, 3))
local ret = minetest.item_place(stack, placer, pointed_thing)
return ItemStack("default:marram_grass_1 " ..
itemstack:get_count() - (1 - ret:get_count()))
end,
})
for i = 2, 3 do
minetest.register_node("default:marram_grass_" .. i, {
description = "Marram Grass",
drawtype = "plantlike",
waving = 1,
tiles = {"default_marram_grass_" .. i .. ".png"},
inventory_image = "default_marram_grass_" .. i .. ".png",
wield_image = "default_marram_grass_" .. i .. ".png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
groups = {snappy = 3, flammable = 3, attached_node = 1,
not_in_creative_inventory=1},
drop = "default:marram_grass_1",
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -0.25, 6 / 16},
},
})
end
minetest.register_node("default:bush_stem", {
description = "Bush Stem",
drawtype = "plantlike",
Expand Down
Binary file added mods/default/textures/default_marram_grass_1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mods/default/textures/default_marram_grass_2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mods/default/textures/default_marram_grass_3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7f3e9e6

Please sign in to comment.