From c32b8adaa36353f9b21d896e93cce732e26cf0a0 Mon Sep 17 00:00:00 2001 From: TumeniNodes Date: Fri, 26 Jul 2019 12:50:44 -0400 Subject: [PATCH] Add 'dry dirt' and 'dry dirt with dry grass' nodes for savanna biome --- mods/default/README.txt | 1 + mods/default/functions.lua | 12 +++--- mods/default/mapgen.lua | 22 +++++------ mods/default/nodes.lua | 23 ++++++++++- mods/default/textures/default_dry_dirt.png | Bin 0 -> 256 bytes mods/farming/nodes.lua | 42 +++++++++++++++++++++ 6 files changed, 82 insertions(+), 18 deletions(-) create mode 100644 mods/default/textures/default_dry_dirt.png diff --git a/mods/default/README.txt b/mods/default/README.txt index 98c8f1ea..1bc899b2 100644 --- a/mods/default/README.txt +++ b/mods/default/README.txt @@ -129,6 +129,7 @@ TumeniNodes (CC BY-SA 3.0): default_coniferous_litter.png default_coniferous_litter_side.png default_grass.png + default_dry_dirt.png BlockMen (CC BY-SA 3.0): default_aspen_leaves.png -- Derived from Sofar's texture diff --git a/mods/default/functions.lua b/mods/default/functions.lua index 183b5597..ceeeedc6 100644 --- a/mods/default/functions.lua +++ b/mods/default/functions.lua @@ -477,7 +477,6 @@ minetest.register_abm({ neighbors = { "air", "group:grass", - "group:dry_grass", "default:snow", }, interval = 6, @@ -504,11 +503,8 @@ minetest.register_abm({ -- Snow check is cheapest, so comes first if name == "default:snow" then minetest.set_node(pos, {name = "default:dirt_with_snow"}) - -- Most likely case first elseif minetest.get_item_group(name, "grass") ~= 0 then minetest.set_node(pos, {name = "default:dirt_with_grass"}) - elseif minetest.get_item_group(name, "dry_grass") ~= 0 then - minetest.set_node(pos, {name = "default:dirt_with_dry_grass"}) end end }) @@ -520,7 +516,7 @@ minetest.register_abm({ minetest.register_abm({ label = "Grass covered", - nodenames = {"group:spreading_dirt_type"}, + nodenames = {"group:spreading_dirt_type", "default:dry_dirt_with_dry_grass"}, interval = 8, chance = 50, catch_up = false, @@ -531,7 +527,11 @@ minetest.register_abm({ if name ~= "ignore" and nodedef and not ((nodedef.sunlight_propagates or nodedef.paramtype == "light") and nodedef.liquidtype == "none") then - minetest.set_node(pos, {name = "default:dirt"}) + if node.name == "default:dry_dirt_with_dry_grass" then + minetest.set_node(pos, {name = "default:dry_dirt"}) + else + minetest.set_node(pos, {name = "default:dirt"}) + end end end }) diff --git a/mods/default/mapgen.lua b/mods/default/mapgen.lua index bec2a238..e930c24c 100644 --- a/mods/default/mapgen.lua +++ b/mods/default/mapgen.lua @@ -575,8 +575,8 @@ function default.register_ores() }, -- Only where default:dirt is present as surface material biomes = {"taiga", "snowy_grassland", "grassland", "coniferous_forest", - "deciduous_forest", "deciduous_forest_shore", "savanna", "savanna_shore", - "rainforest", "rainforest_swamp", "floatland_coniferous_forest"} + "deciduous_forest", "deciduous_forest_shore", "rainforest", + "rainforest_swamp", "floatland_coniferous_forest"} }) -- Gravel @@ -1487,9 +1487,9 @@ function default.register_biomes(upper_limit) minetest.register_biome({ name = "savanna", - node_top = "default:dirt_with_dry_grass", + node_top = "default:dry_dirt_with_dry_grass", depth_top = 1, - node_filler = "default:dirt", + node_filler = "default:dry_dirt", depth_filler = 1, node_riverbed = "default:sand", depth_riverbed = 2, @@ -1504,9 +1504,9 @@ function default.register_biomes(upper_limit) minetest.register_biome({ name = "savanna_shore", - node_top = "default:dirt", + node_top = "default:dry_dirt", depth_top = 1, - node_filler = "default:dirt", + node_filler = "default:dry_dirt", depth_filler = 3, node_riverbed = "default:sand", depth_riverbed = 2, @@ -1798,7 +1798,7 @@ local function register_dry_grass_decoration(offset, scale, length) minetest.register_decoration({ name = "default:dry_grass_" .. length, deco_type = "simple", - place_on = {"default:dirt_with_dry_grass"}, + place_on = {"default:dry_dirt_with_dry_grass"}, sidelen = 16, noise_params = { offset = offset, @@ -2012,7 +2012,7 @@ function default.register_decorations() minetest.register_decoration({ name = "default:acacia_tree", deco_type = "schematic", - place_on = {"default:dirt_with_dry_grass"}, + place_on = {"default:dry_dirt_with_dry_grass"}, sidelen = 16, noise_params = { offset = 0, @@ -2033,7 +2033,7 @@ function default.register_decorations() minetest.register_decoration({ name = "default:acacia_log", deco_type = "schematic", - place_on = {"default:dirt_with_dry_grass"}, + place_on = {"default:dry_dirt_with_dry_grass"}, place_offset_y = 1, sidelen = 16, noise_params = { @@ -2050,7 +2050,7 @@ function default.register_decorations() schematic = minetest.get_modpath("default") .. "/schematics/acacia_log.mts", flags = "place_center_x", rotation = "random", - spawn_by = "default:dirt_with_dry_grass", + spawn_by = "default:dry_dirt_with_dry_grass", num_spawn_by = 8, }) @@ -2218,7 +2218,7 @@ function default.register_decorations() minetest.register_decoration({ name = "default:acacia_bush", deco_type = "schematic", - place_on = {"default:dirt_with_dry_grass"}, + place_on = {"default:dry_dirt_with_dry_grass"}, sidelen = 16, noise_params = { offset = -0.004, diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua index 15aca96c..bf7b43aa 100644 --- a/mods/default/nodes.lua +++ b/mods/default/nodes.lua @@ -52,6 +52,8 @@ default:dirt_with_dry_grass default:dirt_with_snow default:dirt_with_rainforest_litter default:dirt_with_coniferous_litter +default:dry_dirt +default:dry_dirt_with_dry_grass default:permafrost default:permafrost_with_stones @@ -459,7 +461,7 @@ minetest.register_node("default:dirt_with_dry_grass", { "default_dirt.png", {name = "default_dirt.png^default_dry_grass_side.png", tileable_vertical = false}}, - groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1}, + groups = {crumbly = 3, soil = 1}, drop = 'default:dirt', sounds = default.node_sound_dirt_defaults({ footstep = {name = "default_grass_footstep", gain = 0.4}, @@ -508,6 +510,25 @@ minetest.register_node("default:dirt_with_coniferous_litter", { }), }) +minetest.register_node("default:dry_dirt", { + description = "Dry Dirt", + tiles = {"default_dry_dirt.png"}, + groups = {crumbly = 3, soil = 1}, + sounds = default.node_sound_dirt_defaults(), +}) + +minetest.register_node("default:dry_dirt_with_dry_grass", { + description = "Dry Dirt with Dry Grass", + tiles = {"default_dry_grass.png", "default_dry_dirt.png", + {name = "default_dry_dirt.png^default_dry_grass_side.png", + tileable_vertical = false}}, + groups = {crumbly = 3, soil = 1}, + drop = "default:dry_dirt", + sounds = default.node_sound_dirt_defaults({ + footstep = {name = "default_grass_footstep", gain = 0.4}, + }), +}) + minetest.register_node("default:permafrost", { description = "Permafrost", tiles = {"default_permafrost.png"}, diff --git a/mods/default/textures/default_dry_dirt.png b/mods/default/textures/default_dry_dirt.png new file mode 100644 index 0000000000000000000000000000000000000000..8ee53984faba09e7c92974d2b0f6fe5b0aaf4dfc GIT binary patch literal 256 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!aez;V>zbyJwGE+bn?u*NgspE4 zU*8tFu|0BAN7Uxd=q+6_+j`=5^(5@+P1xI)cwlPUk*OKSre_7lXT}4ycX+xuhDb=V z9&AiJV!*>}_)GPd%CeW`|1-H?L>eoe_`P8wulMYm$NFA1HqH8eXiivG_c5L`-`r(y za8Lir!m{5Y;B9N<#Kgu8bF!Xn)|_N2ubW}zduaNs-^LtMm}VH|wy@sWXHYUB{41}+ zfjz5w=eI85EpNH&x}xzwU{+T;i;`khr1u89&)zopr E0KnvGbpQYW literal 0 HcmV?d00001 diff --git a/mods/farming/nodes.lua b/mods/farming/nodes.lua index cc9d1f66..bcd627fb 100644 --- a/mods/farming/nodes.lua +++ b/mods/farming/nodes.lua @@ -38,6 +38,22 @@ minetest.override_item("default:dirt_with_coniferous_litter", { } }) +minetest.override_item("default:dry_dirt", { + soil = { + base = "default:dry_dirt", + dry = "farming:dry_soil", + wet = "farming:dry_soil_wet" + } +}) + +minetest.override_item("default:dry_dirt_with_dry_grass", { + soil = { + base = "default:dry_dirt_with_dry_grass", + dry = "farming:dry_soil", + wet = "farming:dry_soil_wet" + } +}) + minetest.register_node("farming:soil", { description = "Soil", tiles = {"default_dirt.png^farming_soil.png", "default_dirt.png"}, @@ -64,6 +80,32 @@ minetest.register_node("farming:soil_wet", { } }) +minetest.register_node("farming:dry_soil", { + description = "Dry Soil", + tiles = {"default_dry_dirt.png^farming_soil.png", "default_dry_dirt.png"}, + drop = "default:dry_dirt", + groups = {crumbly=3, not_in_creative_inventory=1, soil=2, grassland = 1, field = 1}, + sounds = default.node_sound_dirt_defaults(), + soil = { + base = "default:dry_dirt", + dry = "farming:dry_soil", + wet = "farming:dry_soil_wet" + } +}) + +minetest.register_node("farming:dry_soil_wet", { + description = "Wet Dry Soil", + tiles = {"default_dry_dirt.png^farming_soil_wet.png", "default_dry_dirt.png^farming_soil_wet_side.png"}, + drop = "default:dry_dirt", + groups = {crumbly=3, not_in_creative_inventory=1, soil=3, wet = 1, grassland = 1, field = 1}, + sounds = default.node_sound_dirt_defaults(), + soil = { + base = "default:dry_dirt", + dry = "farming:dry_soil", + wet = "farming:dry_soil_wet" + } +}) + minetest.override_item("default:desert_sand", { groups = {crumbly=3, falling_node=1, sand=1, soil = 1}, soil = { -- 2.25.1