forked from minetest/minetest_game
Trees: Add 'snowy' group for pine sapling snow detection
Use the 'snowy' group in the 'is snow nearby' function instead of default nodes. Often snow nodes are not from the default mod.
This commit is contained in:
parent
e86955afae
commit
2b215848d8
|
@ -378,7 +378,7 @@ minetest.register_node("default:dirt_with_snow", {
|
||||||
tiles = {"default_snow.png", "default_dirt.png",
|
tiles = {"default_snow.png", "default_dirt.png",
|
||||||
{name = "default_dirt.png^default_snow_side.png",
|
{name = "default_dirt.png^default_snow_side.png",
|
||||||
tileable_vertical = false}},
|
tileable_vertical = false}},
|
||||||
groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
|
groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1, snowy = 1},
|
||||||
drop = 'default:dirt',
|
drop = 'default:dirt',
|
||||||
sounds = default.node_sound_dirt_defaults({
|
sounds = default.node_sound_dirt_defaults({
|
||||||
footstep = {name = "default_snow_footstep", gain = 0.15},
|
footstep = {name = "default_snow_footstep", gain = 0.15},
|
||||||
|
@ -445,7 +445,7 @@ minetest.register_node("default:snow", {
|
||||||
{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
|
{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
groups = {crumbly = 3, falling_node = 1, puts_out_fire = 1},
|
groups = {crumbly = 3, falling_node = 1, puts_out_fire = 1, snowy = 1},
|
||||||
sounds = default.node_sound_dirt_defaults({
|
sounds = default.node_sound_dirt_defaults({
|
||||||
footstep = {name = "default_snow_footstep", gain = 0.15},
|
footstep = {name = "default_snow_footstep", gain = 0.15},
|
||||||
dug = {name = "default_snow_footstep", gain = 0.2},
|
dug = {name = "default_snow_footstep", gain = 0.2},
|
||||||
|
@ -463,7 +463,7 @@ minetest.register_node("default:snow", {
|
||||||
minetest.register_node("default:snowblock", {
|
minetest.register_node("default:snowblock", {
|
||||||
description = "Snow Block",
|
description = "Snow Block",
|
||||||
tiles = {"default_snow.png"},
|
tiles = {"default_snow.png"},
|
||||||
groups = {crumbly = 3, puts_out_fire = 1, cools_lava = 1},
|
groups = {crumbly = 3, puts_out_fire = 1, cools_lava = 1, snowy = 1},
|
||||||
sounds = default.node_sound_dirt_defaults({
|
sounds = default.node_sound_dirt_defaults({
|
||||||
footstep = {name = "default_snow_footstep", gain = 0.15},
|
footstep = {name = "default_snow_footstep", gain = 0.15},
|
||||||
dug = {name = "default_snow_footstep", gain = 0.2},
|
dug = {name = "default_snow_footstep", gain = 0.2},
|
||||||
|
|
|
@ -27,8 +27,7 @@ end
|
||||||
-- 'is snow nearby' function
|
-- 'is snow nearby' function
|
||||||
|
|
||||||
local function is_snow_nearby(pos)
|
local function is_snow_nearby(pos)
|
||||||
return minetest.find_node_near(pos, 1,
|
return minetest.find_node_near(pos, 1, {"group:snowy"})
|
||||||
{"default:snow", "default:snowblock", "default:dirt_with_snow"})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user