1
0
mirror of https://github.com/mt-mods/plantlife_modpack.git synced 2024-12-26 18:40:18 +01:00

add ownership check when placing juncus grass

This commit is contained in:
Vanessa Ezekowitz 2015-10-21 04:01:03 -04:00
parent 4e54d23c4d
commit 2349447ba8

View File

@ -44,6 +44,12 @@ minetest.register_node("dryplants:juncus", {
fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16},
},
on_place = function(itemstack, placer, pointed_thing)
local playername = placer:get_player_name()
if minetest.is_protected(pointed_thing.above, playername) or
minetest.is_protected(pointed_thing.under, playername) then
minetest.chat_send_player(playername, "Someone else owns that spot.")
return
end
local pos = pointed_thing.under
local juncus_type = math.random(2,3)
local right_here = {x=pos.x, y=pos.y+1, z=pos.z}