mirror of
https://github.com/Splizard/minetest-mod-snow.git
synced 2024-12-29 16:00:16 +01:00
add snow apple and make snowy more snowy
This commit is contained in:
parent
4a2c869407
commit
06e74418e9
@ -117,6 +117,7 @@ local function define_contents()
|
|||||||
water = minetest.get_content_id("default:water_source"),
|
water = minetest.get_content_id("default:water_source"),
|
||||||
papyrus = minetest.get_content_id("default:papyrus"),
|
papyrus = minetest.get_content_id("default:papyrus"),
|
||||||
sand = minetest.get_content_id("default:sand"),
|
sand = minetest.get_content_id("default:sand"),
|
||||||
|
desert_sand = minetest.get_content_id("default:desert_sand"),
|
||||||
}
|
}
|
||||||
replacements = snow.known_plants or {}
|
replacements = snow.known_plants or {}
|
||||||
end
|
end
|
||||||
@ -167,8 +168,8 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
for z = z0, z1 do
|
for z = z0, z1 do
|
||||||
for x = x0, x1 do
|
for x = x0, x1 do
|
||||||
local in_biome = false
|
local in_biome = false
|
||||||
local test = nvals_default[ni]
|
local test
|
||||||
if test < 0.35 then
|
if nvals_default[ni] < 0.35 then
|
||||||
if not nvals_cold then
|
if not nvals_cold then
|
||||||
nvals_cold = minetest.get_perlin_map(np_cold, chulens):get2dMap_flat({x=x0, y=z0})
|
nvals_cold = minetest.get_perlin_map(np_cold, chulens):get2dMap_flat({x=x0, y=z0})
|
||||||
end
|
end
|
||||||
@ -184,7 +185,9 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if not in_biome then
|
if not in_biome then
|
||||||
if alpine and test > 0.43 then
|
if alpine
|
||||||
|
and test
|
||||||
|
and test > 0.43 then
|
||||||
-- remove trees near alpine
|
-- remove trees near alpine
|
||||||
local ground_y = nil
|
local ground_y = nil
|
||||||
for y = maxp.y, minp.y, -1 do
|
for y = maxp.y, minp.y, -1 do
|
||||||
@ -264,7 +267,13 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
data[node] = c.dirt_with_snow
|
data[node] = c.dirt_with_snow
|
||||||
data[area:index(x, ground_y+1, z)] = c.dry_shrub
|
data[area:index(x, ground_y+1, z)] = c.dry_shrub
|
||||||
else
|
else
|
||||||
data[node] = c.dirt_with_snow
|
if snowy
|
||||||
|
or test > 0.8 then
|
||||||
|
-- more, deeper snow
|
||||||
|
data[node] = c.snow_block
|
||||||
|
else
|
||||||
|
data[node] = c.dirt_with_snow
|
||||||
|
end
|
||||||
snow_tab[num] = {ground_y, z, x, test}
|
snow_tab[num] = {ground_y, z, x, test}
|
||||||
num = num+1
|
num = num+1
|
||||||
end
|
end
|
||||||
@ -360,7 +369,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
-- put snow onto it
|
-- 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
|
||||||
else
|
elseif c_ground ~= c.desert_sand then
|
||||||
if is_snowable(c_ground) then
|
if is_snowable(c_ground) then
|
||||||
-- put snow onto it
|
-- put snow onto it
|
||||||
snow_tab[num] = {ground_y, z, x, test}
|
snow_tab[num] = {ground_y, z, x, test}
|
||||||
|
@ -231,8 +231,25 @@ nodedef.groups.flammable = 1
|
|||||||
minetest.register_node("snow:leaves", nodedef)
|
minetest.register_node("snow:leaves", nodedef)
|
||||||
snow.known_plants[minetest.get_content_id("default:leaves")] = minetest.get_content_id("snow:leaves")
|
snow.known_plants[minetest.get_content_id("default:leaves")] = minetest.get_content_id("snow:leaves")
|
||||||
|
|
||||||
|
local apple = minetest.registered_nodes["default:apple"]
|
||||||
|
nodedef = {
|
||||||
|
description = "Snow Apple",
|
||||||
|
drawtype = "plantlike",
|
||||||
|
tiles = {"snow_apple.png"},
|
||||||
|
paramtype = "light",
|
||||||
|
walkable = false,
|
||||||
|
sunlight_propagates = apple.sunlight_propagates,
|
||||||
|
selection_box = apple.selection_box,
|
||||||
|
groups = apple.groups,
|
||||||
|
sounds = apple.sounds,
|
||||||
|
drop = apple.drop,
|
||||||
|
}
|
||||||
|
nodedef.groups.flammable = 1
|
||||||
|
|
||||||
|
minetest.register_node("snow:apple", nodedef)
|
||||||
|
snow.known_plants[minetest.get_content_id("default:apple")] = minetest.get_content_id("snow:apple")
|
||||||
|
|
||||||
-- TODO
|
-- TODO
|
||||||
snow.known_plants[minetest.get_content_id("default:apple")] = minetest.get_content_id("default:apple")
|
|
||||||
snow.known_plants[minetest.get_content_id("default:jungleleaves")] = minetest.get_content_id("default:jungleleaves")
|
snow.known_plants[minetest.get_content_id("default:jungleleaves")] = minetest.get_content_id("default:jungleleaves")
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user