From 7f3e9e65b38c3888ce4bfb2e559451adb6acbbb6 Mon Sep 17 00:00:00 2001 From: paramat Date: Wed, 24 Jan 2018 11:29:02 +0000 Subject: [PATCH] Add marram grass for coastal sand dunes Use noise with 1 octave and flag 'absvalue' to create sand paths in dunes. --- mods/default/README.txt | 1 + mods/default/crafting.lua | 6 ++ mods/default/mapgen.lua | 30 +++++++++- mods/default/nodes.lua | 55 ++++++++++++++++++ .../textures/default_marram_grass_1.png | Bin 0 -> 253 bytes .../textures/default_marram_grass_2.png | Bin 0 -> 447 bytes .../textures/default_marram_grass_3.png | Bin 0 -> 341 bytes 7 files changed, 89 insertions(+), 3 deletions(-) create mode 100644 mods/default/textures/default_marram_grass_1.png create mode 100644 mods/default/textures/default_marram_grass_2.png create mode 100644 mods/default/textures/default_marram_grass_3.png diff --git a/mods/default/README.txt b/mods/default/README.txt index f749b0e3..3861eddd 100644 --- a/mods/default/README.txt +++ b/mods/default/README.txt @@ -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) diff --git a/mods/default/crafting.lua b/mods/default/crafting.lua index dd91ad42..847f188f 100644 --- a/mods/default/crafting.lua +++ b/mods/default/crafting.lua @@ -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", diff --git a/mods/default/mapgen.lua b/mods/default/mapgen.lua index 1cb74cbc..243d1ed7 100644 --- a/mods/default/mapgen.lua +++ b/mods/default/mapgen.lua @@ -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, @@ -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, @@ -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({ diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua index c642fc39..4033f37c 100644 --- a/mods/default/nodes.lua +++ b/mods/default/nodes.lua @@ -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 @@ -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", diff --git a/mods/default/textures/default_marram_grass_1.png b/mods/default/textures/default_marram_grass_1.png new file mode 100644 index 0000000000000000000000000000000000000000..73ec9e9d1109cd50041cad225495430c684db935 GIT binary patch literal 253 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbK}cz{ocE0ER=HZqAaGmbSgPBgbj zur*1svPiKsO|`O1wzki7vMsiCEOv1%^mD87@vRLFs0;OP4h?LM@ox?DYYPbJiVp3L zj_QdydwklBiwkdEUVQi3(g!zJcrTst7HBkMNswPKgTu2MX+Tbhr;B5V#O1SHo_q}o z49xB^f`U_B9smFLd)Sb_!Ep!p1*u6{1-oD!M<_1Rhs literal 0 HcmV?d00001 diff --git a/mods/default/textures/default_marram_grass_2.png b/mods/default/textures/default_marram_grass_2.png new file mode 100644 index 0000000000000000000000000000000000000000..2db75c706409472f32463a32f4c09d897940d280 GIT binary patch literal 447 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbMf!vLQUR|WttKYRBM|QC#y6Y%XAxiAem|DkZx<6>12~- zXP@b0m1A$4>tLVjssjN zTv=vnITR^{VW73fnF;#U*uR~O>d;N#Wc@7ECK+ZgQA z65!t)>fag?&=wZd79Q9c8rBgW+!+zv85PnM71|vWF(Kyc@oCr2&%beT;jPPy?_OK_ z;O2_Zsq41_JGde;{4-%a()Usb7q{hagP3)rWbnFFAi`rz1hFwkf41_#EoX{V!kai9U_yY z4*f9Wx)NE>#u@20ThwjB^c4Y%uB$J*yof9B%CQX%&*ki|FS{$v$6It-Byu6=W{Jc% lHT5%$y(QWzY(!r(==c8RjdYjny$N&|gQu&X%Q~loCIBbBqFVp} literal 0 HcmV?d00001 diff --git a/mods/default/textures/default_marram_grass_3.png b/mods/default/textures/default_marram_grass_3.png new file mode 100644 index 0000000000000000000000000000000000000000..f6c155f489cae6641344777ed45f6070e1aa4d98 GIT binary patch literal 341 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbK}W`IwKD+7a}Zm^L_gsDlCnQ^R{ zaiY0Nij_r*rD>{_U9z=(rjv8NuWhldW3h{Cp`Tlkw_BBuZ*6EmU8sL^sBddvU~`Or zYnWeKKuA|~Xm@l}PfW_Jyu^74XOB<2c7FbiiwkdEUVQi3(g!zJ>|3;XDbP~Jk|4ie z28U-i(tw;d>gLgD?O9 literal 0 HcmV?d00001