{"action":"created","comment":{"url":"https://api.github.com/repos/minetest/minetest_game/pulls/comments/72302984","id":72302984,"diff_hunk":"@@ -426,3 +427,48 @@ function default.grow_new_aspen_tree(pos)\n \tminetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},\n \t\tpath, \"0\", nil, false)\n end\n+\n+\n+--\n+-- Sapling 'on place' function to check protection of node and resulting tree volume\n+--\n+\n+function default.sapling_on_place(itemstack, placer, pointed_thing,\n+\t\tsapling_name, minp_relative, maxp_relative, interval)\n+\t-- Position of sapling\n+\tlocal pos = pointed_thing.under\n+\tlocal node = minetest.get_node(pos)\n+\tlocal pdef = minetest.registered_nodes[node.name]\n+\tif not pdef or not pdef.buildable_to then\n+\t\tpos = pointed_thing.above\n+\t\tnode = minetest.get_node(pos)\n+\t\tpdef = minetest.registered_nodes[node.name]\n+\t\tif not pdef or not pdef.buildable_to then\n+\t\t\treturn itemstack\n+\t\tend\n+\tend\n+\n+\tlocal player_name = placer:get_player_name()\n+\t-- Check sapling position for protection\n+\tif minetest.is_protected(pos, player_name) then\n+\t\tminetest.chat_send_player(player_name, \"Node is protected\")","path":"mods/default/trees.lua","position":36,"original_position":36,"commit_id":"1104904f8aec36c42e4950342e046360d178be29","original_commit_id":"1104904f8aec36c42e4950342e046360d178be29","user":{"login":"paramat","id":3686677,"avatar_url":"https://avatars.githubusercontent.com/u/3686677?v=3","gravatar_id":"","url":"https://api.github.com/users/paramat","html_url":"https://github.com/paramat","followers_url":"https://api.github.com/users/paramat/followers","following_url":"https://api.github.com/users/paramat/following{/other_user}","gists_url":"https://api.github.com/users/paramat/gists{/gist_id}","starred_url":"https://api.github.com/users/paramat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paramat/subscriptions","organizations_url":"https://api.github.com/users/paramat/orgs","repos_url":"https://api.github.com/users/paramat/repos","events_url":"https://api.github.com/users/paramat/events{/privacy}","received_events_url":"https://api.github.com/users/paramat/received_events","type":"User","site_admin":false},"body":"Yeah i noticed, but teh extra information is useful to know whether the node is protected or the resulting tree will intersect protection.","created_at":"2016-07-26T17:57:47Z","updated_at":"2016-07-26T17:57:47Z","html_url":"https://github.com/minetest/minetest_game/pull/1208#discussion_r72302984","pull_request_url":"https://api.github.com/repos/minetest/minetest_game/pulls/1208","_links":{"self":{"href":"https://api.github.com/repos/minetest/minetest_game/pulls/comments/72302984"},"html":{"href":"https://github.com/minetest/minetest_game/pull/1208#discussion_r72302984"},"pull_request":{"href":"https://api.github.com/repos/minetest/minetest_game/pulls/1208"}}},"pull_request":{"url":"https://api.github.com/repos/minetest/minetest_game/pulls/1208","id":77899678,"html_url":"https://github.com/minetest/minetest_game/pull/1208","diff_url":"https://github.com/minetest/minetest_game/pull/1208.diff","patch_url":"https://github.com/minetest/minetest_game/pull/1208.patch","issue_url":"https://api.github.com/repos/minetest/minetest_game/issues/1208","number":1208,"state":"open","locked":false,"title":"Default: Prevent placing sapling if grown tree intersects protection ","user":{"login":"paramat","id":3686677,"avatar_url":"https://avatars.githubusercontent.com/u/3686677?v=3","gravatar_id":"","url":"https://api.github.com/users/paramat","html_url":"https://github.com/paramat","followers_url":"https://api.github.com/users/paramat/followers","following_url":"https://api.github.com/users/paramat/following{/other_user}","gists_url":"https://api.github.com/users/paramat/gists{/gist_id}","starred_url":"https://api.github.com/users/paramat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paramat/subscriptions","organizations_url":"https://api.github.com/users/paramat/orgs","repos_url":"https://api.github.com/users/paramat/repos","events_url":"https://api.github.com/users/paramat/events{/privacy}","received_events_url":"https://api.github.com/users/paramat/received_events","type":"User","site_admin":false},"body":"Add a global 'intersects protection' function to functions.lua for\r\nchecking if a specified volume intersects with a protected volume.\r\nA 3D lattice of points are checked with an adjustable interval.\r\nAdd a global 'sapling on place' function to avoid duplicated code in\r\nnodes.lua.\r\n/////////////////////////////////////////////////////\r\n\r\nAction for issue #1192 ","created_at":"2016-07-19T00:08:36Z","updated_at":"2016-07-26T17:57:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2730b045f88ebaade4fa9d90bb9e4657e4307b72","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/minetest/minetest_game/pulls/1208/commits","review_comments_url":"https://api.github.com/repos/minetest/minetest_game/pulls/1208/comments","review_comment_url":"https://api.github.com/repos/minetest/minetest_game/pulls/comments{/number}","comments_url":"https://api.github.com/repos/minetest/minetest_game/issues/1208/comments","statuses_url":"https://api.github.com/repos/minetest/minetest_game/statuses/1104904f8aec36c42e4950342e046360d178be29","head":{"label":"paramat:treegrief","ref":"treegrief","sha":"1104904f8aec36c42e4950342e046360d178be29","user":{"login":"paramat","id":3686677,"avatar_url":"https://avatars.githubusercontent.com/u/3686677?v=3","gravatar_id":"","url":"https://api.github.com/users/paramat","html_url":"https://github.com/paramat","followers_url":"https://api.github.com/users/paramat/followers","following_url":"https://api.github.com/users/paramat/following{/other_user}","gists_url":"https://api.github.com/users/paramat/gists{/gist_id}","starred_url":"https://api.github.com/users/paramat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paramat/subscriptions","organizations_url":"https://api.github.com/users/paramat/orgs","repos_url":"https://api.github.com/users/paramat/repos","events_url":"https://api.github.com/users/paramat/events{/privacy}","received_events_url":"https://api.github.com/users/paramat/received_events","type":"User","site_admin":false},"repo":{"id":24438613,"name":"minetest_game","full_name":"paramat/minetest_game","owner":{"login":"paramat","id":3686677,"avatar_url":"https://avatars.githubusercontent.com/u/3686677?v=3","gravatar_id":"","url":"https://api.github.com/users/paramat","html_url":"https://github.com/paramat","followers_url":"https://api.github.com/users/paramat/followers","following_url":"https://api.github.com/users/paramat/following{/other_user}","gists_url":"https://api.github.com/users/paramat/gists{/gist_id}","starred_url":"https://api.github.com/users/paramat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paramat/subscriptions","organizations_url":"https://api.github.com/users/paramat/orgs","repos_url":"https://api.github.com/users/paramat/repos","events_url":"https://api.github.com/users/paramat/events{/privacy}","received_events_url":"https://api.github.com/users/paramat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/paramat/minetest_game","description":"The main game for the Minetest game engine [minetest_game] [https://github.com/minetest/minetest/]","fork":true,"url":"https://api.github.com/repos/paramat/minetest_game","forks_url":"https://api.github.com/repos/paramat/minetest_game/forks","keys_url":"https://api.github.com/repos/paramat/minetest_game/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paramat/minetest_game/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paramat/minetest_game/teams","hooks_url":"https://api.github.com/repos/paramat/minetest_game/hooks","issue_events_url":"https://api.github.com/repos/paramat/minetest_game/issues/events{/number}","events_url":"https://api.github.com/repos/paramat/minetest_game/events","assignees_url":"https://api.github.com/repos/paramat/minetest_game/assignees{/user}","branches_url":"https://api.github.com/repos/paramat/minetest_game/branches{/branch}","tags_url":"https://api.github.com/repos/paramat/minetest_game/tags","blobs_url":"https://api.github.com/repos/paramat/minetest_game/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paramat/minetest_game/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paramat/minetest_game/git/refs{/sha}","trees_url":"https://api.github.com/repos/paramat/minetest_game/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paramat/minetest_game/statuses/{sha}","languages_url":"https://api.github.com/repos/paramat/minetest_game/languages","stargazers_url":"https://api.github.com/repos/paramat/minetest_game/stargazers","contributors_url":"https://api.github.com/repos/paramat/minetest_game/contributors","subscribers_url":"https://api.github.com/repos/paramat/minetest_game/subscribers","subscription_url":"https://api.github.com/repos/paramat/minetest_game/subscription","commits_url":"https://api.github.com/repos/paramat/minetest_game/commits{/sha}","git_commits_url":"https://api.github.com/repos/paramat/minetest_game/git/commits{/sha}","comments_url":"https://api.github.com/repos/paramat/minetest_game/comments{/number}","issue_comment_url":"https://api.github.com/repos/paramat/minetest_game/issues/comments{/number}","contents_url":"https://api.github.com/repos/paramat/minetest_game/contents/{+path}","compare_url":"https://api.github.com/repos/paramat/minetest_game/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paramat/minetest_game/merges","archive_url":"https://api.github.com/repos/paramat/minetest_game/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paramat/minetest_game/downloads","issues_url":"https://api.github.com/repos/paramat/minetest_game/issues{/number}","pulls_url":"https://api.github.com/repos/paramat/minetest_game/pulls{/number}","milestones_url":"https://api.github.com/repos/paramat/minetest_game/milestones{/number}","notifications_url":"https://api.github.com/repos/paramat/minetest_game/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paramat/minetest_game/labels{/name}","releases_url":"https://api.github.com/repos/paramat/minetest_game/releases{/id}","deployments_url":"https://api.github.com/repos/paramat/minetest_game/deployments","created_at":"2014-09-25T01:15:16Z","updated_at":"2016-01-14T05:54:08Z","pushed_at":"2016-07-24T23:08:21Z","git_url":"git://github.com/paramat/minetest_game.git","ssh_url":"git@github.com:paramat/minetest_game.git","clone_url":"https://github.com/paramat/minetest_game.git","svn_url":"https://github.com/paramat/minetest_game","homepage":"http://minetest.net/","size":4755,"stargazers_count":0,"watchers_count":0,"language":"Lua","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"minetest:master","ref":"master","sha":"db129f4ca077f5b3dbdb524511bedd13bc9207f3","user":{"login":"minetest","id":2624745,"avatar_url":"https://avatars.githubusercontent.com/u/2624745?v=3","gravatar_id":"","url":"https://api.github.com/users/minetest","html_url":"https://github.com/minetest","followers_url":"https://api.github.com/users/minetest/followers","following_url":"https://api.github.com/users/minetest/following{/other_user}","gists_url":"https://api.github.com/users/minetest/gists{/gist_id}","starred_url":"https://api.github.com/users/minetest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minetest/subscriptions","organizations_url":"https://api.github.com/users/minetest/orgs","repos_url":"https://api.github.com/users/minetest/repos","events_url":"https://api.github.com/users/minetest/events{/privacy}","received_events_url":"https://api.github.com/users/minetest/received_events","type":"Organization","site_admin":false},"repo":{"id":3834571,"name":"minetest_game","full_name":"minetest/minetest_game","owner":{"login":"minetest","id":2624745,"avatar_url":"https://avatars.githubusercontent.com/u/2624745?v=3","gravatar_id":"","url":"https://api.github.com/users/minetest","html_url":"https://github.com/minetest","followers_url":"https://api.github.com/users/minetest/followers","following_url":"https://api.github.com/users/minetest/following{/other_user}","gists_url":"https://api.github.com/users/minetest/gists{/gist_id}","starred_url":"https://api.github.com/users/minetest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minetest/subscriptions","organizations_url":"https://api.github.com/users/minetest/orgs","repos_url":"https://api.github.com/users/minetest/repos","events_url":"https://api.github.com/users/minetest/events{/privacy}","received_events_url":"https://api.github.com/users/minetest/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/minetest/minetest_game","description":"Minetest Game - The default game for the Minetest engine [https://github.com/minetest/minetest/]","fork":false,"url":"https://api.github.com/repos/minetest/minetest_game","forks_url":"https://api.github.com/repos/minetest/minetest_game/forks","keys_url":"https://api.github.com/repos/minetest/minetest_game/keys{/key_id}","collaborators_url":"https://api.github.com/repos/minetest/minetest_game/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/minetest/minetest_game/teams","hooks_url":"https://api.github.com/repos/minetest/minetest_game/hooks","issue_events_url":"https://api.github.com/repos/minetest/minetest_game/issues/events{/number}","events_url":"https://api.github.com/repos/minetest/minetest_game/events","assignees_url":"https://api.github.com/repos/minetest/minetest_game/assignees{/user}","branches_url":"https://api.github.com/repos/minetest/minetest_game/branches{/branch}","tags_url":"https://api.github.com/repos/minetest/minetest_game/tags","blobs_url":"https://api.github.com/repos/minetest/minetest_game/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/minetest/minetest_game/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/minetest/minetest_game/git/refs{/sha}","trees_url":"https://api.github.com/repos/minetest/minetest_game/git/trees{/sha}","statuses_url":"https://api.github.com/repos/minetest/minetest_game/statuses/{sha}","languages_url":"https://api.github.com/repos/minetest/minetest_game/languages","stargazers_url":"https://api.github.com/repos/minetest/minetest_game/stargazers","contributors_url":"https://api.github.com/repos/minetest/minetest_game/contributors","subscribers_url":"https://api.github.com/repos/minetest/minetest_game/subscribers","subscription_url":"https://api.github.com/repos/minetest/minetest_game/subscription","commits_url":"https://api.github.com/repos/minetest/minetest_game/commits{/sha}","git_commits_url":"https://api.github.com/repos/minetest/minetest_game/git/commits{/sha}","comments_url":"https://api.github.com/repos/minetest/minetest_game/comments{/number}","issue_comment_url":"https://api.github.com/repos/minetest/minetest_game/issues/comments{/number}","contents_url":"https://api.github.com/repos/minetest/minetest_game/contents/{+path}","compare_url":"https://api.github.com/repos/minetest/minetest_game/compare/{base}...{head}","merges_url":"https://api.github.com/repos/minetest/minetest_game/merges","archive_url":"https://api.github.com/repos/minetest/minetest_game/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/minetest/minetest_game/downloads","issues_url":"https://api.github.com/repos/minetest/minetest_game/issues{/number}","pulls_url":"https://api.github.com/repos/minetest/minetest_game/pulls{/number}","milestones_url":"https://api.github.com/repos/minetest/minetest_game/milestones{/number}","notifications_url":"https://api.github.com/repos/minetest/minetest_game/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/minetest/minetest_game/labels{/name}","releases_url":"https://api.github.com/repos/minetest/minetest_game/releases{/id}","deployments_url":"https://api.github.com/repos/minetest/minetest_game/deployments","created_at":"2012-03-26T16:03:29Z","updated_at":"2016-07-22T11:27:03Z","pushed_at":"2016-07-26T17:35:58Z","git_url":"git://github.com/minetest/minetest_game.git","ssh_url":"git@github.com:minetest/minetest_game.git","clone_url":"https://github.com/minetest/minetest_game.git","svn_url":"https://github.com/minetest/minetest_game","homepage":"http://minetest.net/","size":13855,"stargazers_count":440,"watchers_count":440,"language":"Lua","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":250,"mirror_url":null,"open_issues_count":71,"forks":250,"open_issues":71,"watchers":440,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/minetest/minetest_game/pulls/1208"},"html":{"href":"https://github.com/minetest/minetest_game/pull/1208"},"issue":{"href":"https://api.github.com/repos/minetest/minetest_game/issues/1208"},"comments":{"href":"https://api.github.com/repos/minetest/minetest_game/issues/1208/comments"},"review_comments":{"href":"https://api.github.com/repos/minetest/minetest_game/pulls/1208/comments"},"review_comment":{"href":"https://api.github.com/repos/minetest/minetest_game/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/minetest/minetest_game/pulls/1208/commits"},"statuses":{"href":"https://api.github.com/repos/minetest/minetest_game/statuses/1104904f8aec36c42e4950342e046360d178be29"}}}}
{"actor":{"display_login":"paramat"}}