Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.register_on_placenode(function(pos, newnode, placer)
o = GetNodeOwner(pos)
if o ~= nil then
if o ~= placer:get_player_name() then
minetest.chat_send_player(placer:get_player_name(), "Node owned by " .. o)
minetest.env:remove_node(pos)
--TODO: add node back into placer's inv
end
end
end)
And I can't seem to work out the InvRef and ItemStack functions to put 'newnode' back into 'placer' inventory.