Add 'dry dirt' and 'dry dirt with dry grass' nodes for savanna biome
authorTumeniNodes <tumeninodes@gmail.com>
Fri, 26 Jul 2019 16:50:44 +0000 (12:50 -0400)
committerParamat <paramat@users.noreply.github.com>
Fri, 26 Jul 2019 16:50:44 +0000 (17:50 +0100)
mods/default/README.txt
mods/default/functions.lua
mods/default/mapgen.lua
mods/default/nodes.lua
mods/default/textures/default_dry_dirt.png [new file with mode: 0644]
mods/farming/nodes.lua

index 98c8f1ea1fa57db79ac343a5db0037122da9572c..1bc899b26e5b0e9ddc429288f867f37cc757129a 100644 (file)
@@ -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
index 183b5597bbbf703993ad67462df1396db8d20813..ceeeedc6dd3d02b1837a54b97d68bcd0d90176fe 100644 (file)
@@ -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
 })
index bec2a23871bb8dbc266d5cd15114056969f6ee2e..e930c24c1b52863c8fac3053ace67e9c094e158c 100644 (file)
@@ -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,
index 15aca96c39f3413cdb74c9ebb78851c87d76d07e..bf7b43aa6f3f6a85c09b39a706ec44537dee5074 100644 (file)
@@ -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 (file)
index 0000000..8ee5398
Binary files /dev/null and b/mods/default/textures/default_dry_dirt.png differ
index cc9d1f66f09724c1577148701427c40fee7d418b..bcd627fb58d17fdc8d08b309a07773addf3c4f2c 100644 (file)
@@ -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 = {