1
0
mirror of https://github.com/Splizard/minetest-mod-snow.git synced 2024-12-29 16:00:16 +01:00

add snow shrub

This commit is contained in:
HybridDog 2015-06-17 18:57:11 +02:00
parent 60f3ac4dea
commit f82c525222
5 changed files with 34 additions and 12 deletions

View File

@ -92,6 +92,7 @@ local function define_contents()
ignore = minetest.get_content_id("ignore"), ignore = minetest.get_content_id("ignore"),
stone = minetest.get_content_id("default:stone"), stone = minetest.get_content_id("default:stone"),
dry_shrub = minetest.get_content_id("default:dry_shrub"), dry_shrub = minetest.get_content_id("default:dry_shrub"),
snow_shrub = minetest.get_content_id("snow:shrub"),
leaves = minetest.get_content_id("default:leaves"), leaves = minetest.get_content_id("default:leaves"),
jungleleaves = minetest.get_content_id("default:jungleleaves"), jungleleaves = minetest.get_content_id("default:jungleleaves"),
junglegrass = minetest.get_content_id("default:junglegrass"), junglegrass = minetest.get_content_id("default:junglegrass"),
@ -227,14 +228,14 @@ minetest.register_on_generated(function(minp, maxp, seed)
end end
data[vi] = c.stone data[vi] = c.stone
end end
elseif shrubs
and pr:next(1,28) == 1 then
data[node] = c.dirt_with_snow
data[area:index(x, ground_y+1, z)] = c.dry_shrub
elseif pines elseif pines
and pr:next(1,36) == 1 then and pr:next(1,36) == 1 then
data[node] = c.dirt_with_snow data[node] = c.dirt_with_snow
spawn_pine({x=x, y=ground_y+1, z=z}, area, data) spawn_pine({x=x, y=ground_y+1, z=z}, area, data)
elseif shrubs
and pr:next(1,928) == 1 then
data[node] = c.dirt_with_snow
data[area:index(x, ground_y+1, z)] = c.dry_shrub
else else
data[node] = c.dirt_with_snow data[node] = c.dirt_with_snow
snow_tab[num] = {ground_y, z, x, test} snow_tab[num] = {ground_y, z, x, test}
@ -304,8 +305,6 @@ minetest.register_on_generated(function(minp, maxp, seed)
or c_ground == c.jungleleaves or c_ground == c.jungleleaves
or c_ground == c.apple then or c_ground == c.apple then
if alpine then if alpine then
snow_tab[num] = {ground_y, z, x, test}
num = num+1
-- make stone pillars out of trees -- make stone pillars out of trees
for y = ground_y, math.max(-6, minp.y-6), -1 do for y = ground_y, math.max(-6, minp.y-6), -1 do
local stone = area:index(x, y, z) local stone = area:index(x, y, z)
@ -314,11 +313,10 @@ minetest.register_on_generated(function(minp, maxp, seed)
end end
data[stone] = c.stone data[stone] = c.stone
end end
else end
-- put snow onto leaves -- put snow onto it
snow_tab[num] = {ground_y, z, x, test} snow_tab[num] = {ground_y, z, x, test}
num = num+1 num = num+1
end
elseif c_ground == c.sand then elseif c_ground == c.sand then
if icy then if icy then
data[node] = c.ice data[node] = c.ice
@ -342,9 +340,9 @@ minetest.register_on_generated(function(minp, maxp, seed)
elseif is_plantlike(c_ground) then elseif is_plantlike(c_ground) then
local vi = area:index(x, ground_y-1, z) local vi = area:index(x, ground_y-1, z)
if data[vi] == c.dirt_with_grass then if data[vi] == c.dirt_with_grass then
-- replace other plants with dry shrubs -- replace other plants with shrubs
data[vi] = c.dirt_with_snow data[vi] = c.dirt_with_snow
data[node] = known_plants[c_ground] or c.dry_shrub data[node] = known_plants[c_ground] or c.snow_shrub
end end
end end
end end

View File

@ -141,6 +141,8 @@ minetest.register_node("snow:star_lit", nodedef)
-- Plants
-- Moss -- Moss
minetest.register_node("snow:moss", { minetest.register_node("snow:moss", {
description = "Moss", description = "Moss",
@ -157,6 +159,28 @@ minetest.register_node("snow:moss", {
groups = {crumbly=3, attached_node=1}, groups = {crumbly=3, attached_node=1},
}) })
-- Shrub
minetest.register_node("snow:shrub", {
description = "Snow Shrub",
tiles = {"snow_shrub.png"},
inventory_image = "snow_shrub.png",
wield_image = "snow_shrub.png",
drawtype = "plantlike",
paramtype = "light",
waving = 1,
sunlight_propagates = true,
walkable = false,
is_ground_content = true,
buildable_to = true,
groups = {snappy=3,flammable=3,attached_node=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, -5/16, 0.3},
},
})
if rawget(_G, "flowers") then if rawget(_G, "flowers") then
-- broken flowers -- broken flowers

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
textures/snow_shrub.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B