1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-09-28 07:20:33 +02:00

fixed papryrus grow on default:sand and default:desert_sand, remove papyrus abm neighbors "dirt_with_snow"

remove deplicated fonction minetest.remove_node() (minetest.remove_node==minetest.set_node) in on_placenode() callback for torch
This commit is contained in:
crabman77 2015-07-18 18:50:57 +02:00
parent 0f562cd59e
commit 523251abf1

View File

@ -248,7 +248,7 @@ end
function default.grow_papyrus(pos, node) function default.grow_papyrus(pos, node)
pos.y = pos.y - 1 pos.y = pos.y - 1
local name = minetest.get_node(pos).name local name = minetest.get_node(pos).name
if name ~= "default:dirt_with_grass" and name ~= "default:dirt" then if name ~= "default:dirt_with_grass" and name ~= "default:dirt" and name ~= "default:sand" and name ~= "default:desert_sand" then
return return
end end
if not minetest.find_node_near(pos, 3, {"group:water"}) then if not minetest.find_node_near(pos, 3, {"group:water"}) then
@ -280,7 +280,7 @@ minetest.register_abm({
minetest.register_abm({ minetest.register_abm({
nodenames = {"default:papyrus"}, nodenames = {"default:papyrus"},
neighbors = {"default:dirt", "default:dirt_with_grass", "default:dirt_with_snow", "default:sand", "default:desert_sand"}, neighbors = {"default:dirt", "default:dirt_with_grass", "default:sand", "default:desert_sand"},
interval = 60, interval = 60,
chance = 25, chance = 25,
action = function(...) action = function(...)
@ -405,7 +405,6 @@ minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack
if newnode.name ~= "default:torch" or minetest.get_item_group(oldnode.name, "water") == 0 then if newnode.name ~= "default:torch" or minetest.get_item_group(oldnode.name, "water") == 0 then
return return
end end
minetest.remove_node(pos, newnode)
minetest.set_node(pos, oldnode) minetest.set_node(pos, oldnode)
minetest.add_item(pos, "default:torch") minetest.add_item(pos, "default:torch")
end) end)