diff --git a/depends.txt b/depends.txt index 41bb35a..9d0cab1 100644 --- a/depends.txt +++ b/depends.txt @@ -1,2 +1,3 @@ default +flowers? moreblocks? diff --git a/src/mapgen_v6.lua b/src/mapgen_v6.lua index 0ee6ee1..c33e2f3 100644 --- a/src/mapgen_v6.lua +++ b/src/mapgen_v6.lua @@ -78,7 +78,7 @@ local function is_plantlike(id) return true end -local c +local c, known_plants local function define_contents() c = { dirt_with_grass = minetest.get_content_id("default:dirt_with_grass"), @@ -100,6 +100,7 @@ local function define_contents() papyrus = minetest.get_content_id("default:papyrus"), sand = minetest.get_content_id("default:sand"), } + known_plants = snow.known_plants or {} end minetest.register_on_generated(function(minp, maxp, seed) @@ -343,7 +344,7 @@ minetest.register_on_generated(function(minp, maxp, seed) if data[vi] == c.dirt_with_grass then -- replace other plants with dry shrubs data[vi] = c.dirt_with_snow - data[node] = c.dry_shrub + data[node] = known_plants[c_ground] or c.dry_shrub end end end @@ -361,7 +362,7 @@ minetest.register_on_generated(function(minp, maxp, seed) local wsz, wsx for _,i in pairs(snow_tab) do local y,z,x,test = unpack(i) - test = (test-0.73)/0.27 -- /(1-0.73) + test = (test-0.53)/0.47 -- /(1-0.53) if test > 0 then local maxh = math.floor(test*10)%10+1 if maxh ~= 1 then @@ -377,7 +378,7 @@ minetest.register_on_generated(function(minp, maxp, seed) for _,cord in pairs({{x+i,z}, {x,z+i}}) do local nd = data[area:index(cord[1], y, cord[2])] if nd == c.air - or nd == c.dry_shrub then + or is_plantlike(nd) then h = h/2 end end diff --git a/src/nodes.lua b/src/nodes.lua index 082d0e4..75d22fe 100644 --- a/src/nodes.lua +++ b/src/nodes.lua @@ -158,6 +158,29 @@ minetest.register_node("snow:moss", { }) +if rawget(_G, "flowers") then + -- broken flowers + snow.known_plants = {} + for _,name in pairs({"dandelion_yellow", "geranium", "rose", "tulip", "dandelion_white", "viola"}) do + local flowername = "flowers:"..name + local newname = "snow:flower_"..name + local flower = minetest.registered_nodes[flowername] + minetest.register_node(newname, { + drawtype = "plantlike", + tiles = { "snow_" .. name .. ".png" }, + sunlight_propagates = true, + paramtype = "light", + walkable = false, + drop = "", + groups = {snappy=3, attached_node = 1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = flower.selection_box + }) + snow.known_plants[minetest.get_content_id(flowername)] = minetest.get_content_id(newname) + end +end + + local function snow_onto_dirt(pos) pos.y = pos.y - 1 diff --git a/textures/snow_dandelion_white.png b/textures/snow_dandelion_white.png new file mode 100644 index 0000000..336e893 Binary files /dev/null and b/textures/snow_dandelion_white.png differ diff --git a/textures/snow_dandelion_yellow.png b/textures/snow_dandelion_yellow.png new file mode 100644 index 0000000..3ebb9e6 Binary files /dev/null and b/textures/snow_dandelion_yellow.png differ diff --git a/textures/snow_geranium.png b/textures/snow_geranium.png new file mode 100644 index 0000000..33b809d Binary files /dev/null and b/textures/snow_geranium.png differ diff --git a/textures/snow_rose.png b/textures/snow_rose.png new file mode 100644 index 0000000..7e32736 Binary files /dev/null and b/textures/snow_rose.png differ diff --git a/textures/snow_tulip.png b/textures/snow_tulip.png new file mode 100644 index 0000000..321429d Binary files /dev/null and b/textures/snow_tulip.png differ diff --git a/textures/snow_viola.png b/textures/snow_viola.png new file mode 100644 index 0000000..95d2871 Binary files /dev/null and b/textures/snow_viola.png differ