Add default.get_distance function
This commit is contained in:
parent
382f280858
commit
800bddff50
@ -440,4 +440,12 @@ function default.drop_item(pos,itemstack,vel,acc)
|
||||
obj:get_luaentity().object:setacceleration(acc)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function default.get_distance(pos1,pos2)
|
||||
if ( pos1 ~= nil and pos2 ~= nil ) then
|
||||
return math.abs(math.floor(math.sqrt( (pos1.x - pos2.x)^2 + (pos1.z - pos2.z)^2 )))
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
@ -117,7 +117,7 @@ minetest.register_node("default:dirt_with_snow", {
|
||||
description = "Dirt with Snow",
|
||||
tiles = {"default_snow.png", "default_dirt.png", "default_dirt.png^default_snow_side.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3},
|
||||
groups = {crumbly=3,puts_out_fire=1},
|
||||
drop = 'default:dirt',
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_snow_footstep", gain=0.25},
|
||||
@ -1526,7 +1526,7 @@ minetest.register_node("default:snow", {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.5+2/16, 0.5},
|
||||
},
|
||||
},
|
||||
groups = {crumbly=3,falling_node=1, melts=1, float=1},
|
||||
groups = {crumbly=3,falling_node=1, melts=1, float=1,puts_out_fire=1},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_snow_footstep", gain=0.25},
|
||||
dug = {name="default_snow_footstep", gain=0.75},
|
||||
@ -1545,7 +1545,7 @@ minetest.register_node("default:snowblock", {
|
||||
tiles = {"default_snow.png"},
|
||||
is_ground_content = true,
|
||||
freezemelt = "default:water_source",
|
||||
groups = {crumbly=3, melts=1},
|
||||
groups = {crumbly=3, melts=1, puts_out_fire=1},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_snow_footstep", gain=0.25},
|
||||
dug = {name="default_snow_footstep", gain=0.75},
|
||||
|
Loading…
x
Reference in New Issue
Block a user