1
0
mirror of https://github.com/mt-mods/plantlife_modpack.git synced 2025-07-16 23:01:07 +02:00

use set_node(), not add_node()

don't use minetest.env:* method (deprecated), use minetest.* instead
This commit is contained in:
Vanessa Ezekowitz
2014-08-15 19:34:15 -04:00
parent 985111d17c
commit b914e5395b
22 changed files with 261 additions and 261 deletions

View File

@ -94,17 +94,17 @@ if AUTO_ROOF_CORNER == true then
chance = 1,
action = function(pos)
local node_east = minetest.env:get_node({x=pos.x+1, y=pos.y, z=pos.z })
local node_west = minetest.env:get_node({x=pos.x-1, y=pos.y, z=pos.z })
local node_north = minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z+1})
local node_south = minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z-1})
local node_east = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z })
local node_west = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z })
local node_north = minetest.get_node({x=pos.x, y=pos.y, z=pos.z+1})
local node_south = minetest.get_node({x=pos.x, y=pos.y, z=pos.z-1})
-- corner 1
if ((node_west.name == roof and node_west.param2 == 0)
or (node_west.name == corner and node_west.param2 == 1))
and ((node_north.name == roof and node_north.param2 == 3)
or (node_north.name == corner and node_north.param2 == 3))
then
minetest.env:add_node(pos, {name=corner, param2=0})
minetest.set_node(pos, {name=corner, param2=0})
end
if ((node_north.name == roof and node_north.param2 == 1)
@ -112,7 +112,7 @@ if AUTO_ROOF_CORNER == true then
and ((node_east.name == roof and node_east.param2 == 0)
or (node_east.name == corner and node_east.param2 == 0))
then
minetest.env:add_node(pos, {name=corner, param2=1})
minetest.set_node(pos, {name=corner, param2=1})
end
if ((node_east.name == roof and node_east.param2 == 2)
@ -120,7 +120,7 @@ if AUTO_ROOF_CORNER == true then
and ((node_south.name == roof and node_south.param2 == 1)
or (node_south.name == corner and node_south.param2 == 1))
then
minetest.env:add_node(pos, {name=corner, param2=2})
minetest.set_node(pos, {name=corner, param2=2})
end
if ((node_south.name == roof and node_south.param2 == 3)
@ -128,7 +128,7 @@ if AUTO_ROOF_CORNER == true then
and ((node_west.name == roof and node_west.param2 == 2)
or (node_west.name == corner and node_west.param2 == 2))
then
minetest.env:add_node(pos, {name=corner, param2=3})
minetest.set_node(pos, {name=corner, param2=3})
end
-- corner 2
if ((node_west.name == roof and node_west.param2 == 2)
@ -136,7 +136,7 @@ if AUTO_ROOF_CORNER == true then
and ((node_north.name == roof and node_north.param2 == 1)
or (node_north.name == corner_2 and node_north.param2 == 3))
then
minetest.env:add_node(pos, {name=corner_2, param2=0})
minetest.set_node(pos, {name=corner_2, param2=0})
end
if ((node_north.name == roof and node_north.param2 == 3)
@ -144,7 +144,7 @@ if AUTO_ROOF_CORNER == true then
and ((node_east.name == roof and node_east.param2 == 2)
or (node_east.name == corner_2 and node_east.param2 == 0))
then
minetest.env:add_node(pos, {name=corner_2, param2=1})
minetest.set_node(pos, {name=corner_2, param2=1})
end
if ((node_east.name == roof and node_east.param2 == 0)
@ -152,7 +152,7 @@ if AUTO_ROOF_CORNER == true then
and ((node_south.name == roof and node_south.param2 == 3)
or (node_south.name == corner_2 and node_south.param2 == 1))
then
minetest.env:add_node(pos, {name=corner_2, param2=2})
minetest.set_node(pos, {name=corner_2, param2=2})
end
if ((node_south.name == roof and node_south.param2 == 1)
@ -160,7 +160,7 @@ if AUTO_ROOF_CORNER == true then
and ((node_west.name == roof and node_west.param2 == 0)
or (node_west.name == corner_2 and node_west.param2 == 2))
then
minetest.env:add_node(pos, {name=corner_2, param2=3})
minetest.set_node(pos, {name=corner_2, param2=3})
end
end,
@ -252,7 +252,7 @@ if REED_WILL_DRY == true then
chance = 1,
action = function(pos)
local direction = minetest.get_node(pos).param2
minetest.env:add_node(pos, {name=DRy, param2=direction})
minetest.set_node(pos, {name=DRy, param2=direction})
end,
})
end
@ -377,4 +377,4 @@ minetest.register_node("dryplants:reed_roof_corner_2", {
},
groups = {snappy=3, flammable=2},
sounds = default.node_sound_leaves_defaults(),
})
})