1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-25 18:20:36 +01:00

readd fix and comment

This commit is contained in:
crabman77 2016-06-18 15:04:52 +02:00
parent b698f85c0f
commit 5977a4962f
2 changed files with 17 additions and 19 deletions

View File

@ -73,23 +73,22 @@ minetest.register_node("farming:beanpole", {
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
if minetest.is_protected(pointed_thing.under, placer:get_player_name()) then
return
end
local nodename = minetest.get_node(pointed_thing.under).name
if minetest.get_item_group(nodename, "soil") < 2 then
return
end
local top = { local top = {
x = pointed_thing.above.x, x = pointed_thing.above.x,
y = pointed_thing.above.y + 1, y = pointed_thing.above.y + 1,
z = pointed_thing.above.z z = pointed_thing.above.z
} }
if minetest.is_protected(pointed_thing.above, placer:get_player_name())
or minetest.is_protected(top, placer:get_player_name()) then -- MFF crabman(18/06/2015)
return
end
local nodename = minetest.get_node(pointed_thing.under).name
if minetest.get_item_group(nodename, "soil") < 2 then
return
end
nodename = minetest.get_node(top).name nodename = minetest.get_node(top).name
if nodename ~= "air" then if nodename ~= "air" then

View File

@ -68,8 +68,13 @@ minetest.register_node("farming:trellis", {
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
local top = {
if minetest.is_protected(pointed_thing.under, placer:get_player_name()) then x = pointed_thing.above.x,
y = pointed_thing.above.y + 1,
z = pointed_thing.above.z
}
if minetest.is_protected(pointed_thing.above, placer:get_player_name())
or minetest.is_protected(top, placer:get_player_name()) then -- MFF crabman(18/06/2015)
return return
end end
@ -79,12 +84,6 @@ minetest.register_node("farming:trellis", {
return return
end end
local top = {
x = pointed_thing.above.x,
y = pointed_thing.above.y + 1,
z = pointed_thing.above.z
}
nodename = minetest.get_node(top).name nodename = minetest.get_node(top).name
if nodename ~= "air" then if nodename ~= "air" then