{"action":"created","comment":{"url":"https://api.github.com/repos/minetest/minetest_game/pulls/comments/51679166","id":51679166,"diff_hunk":"@@ -210,6 +210,61 @@ end\n \n \n --\n+-- fence registration helper\n+--\n+function default.register_fence(name, def)\n+\tlocal fence_texture = \"default_fence_overlay.png^\" .. def.texture ..\n+\t\t\t\"^default_fence_overlay.png^[makealpha:255,126,126\"\n+\tdef.drawtype = \"fencelike\"\n+\t-- allow almost everything to be overridden\n+\tif not def.inventory_image then\n+\t\tdef.inventory_image = fence_texture\n+\tend\n+\tif not def.wield_image then\n+\t\tdef.wield_image = fence_texture\n+\tend\n+\tif def.texture then\n+\t\tdef.tiles = { def.texture }\n+\t\tdef.texture = nil\n+\tend\n+\tif not def.paramtype then\n+\t\tdef.paramtype = \"light\"\n+\tend\n+\tif not def.sunlight_propagates then\n+\t\tdef.sunlight_propagates = true\n+\tend\n+\tif not def.is_ground_content then\n+\t\tdef.is_ground_content = false\n+\tend\n+\tif not def.selection_box then\n+\t\tdef.selection_box = {\n+\t\t\ttype = \"fixed\",\n+\t\t\tfixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},\n+\t\t}\n+\tend\n+\t-- always add to the fence group, even if no group provided\n+\tif not def.groups then\n+\t\tdef.groups = {}\n+\tend\n+\tif def.groups then","path":"mods/default/functions.lua","position":40,"original_position":40,"commit_id":"75e9f7e0229d5a2cf57803a05eaa697955d88334","original_commit_id":"75e9f7e0229d5a2cf57803a05eaa697955d88334","user":{"login":"ShadowNinja","id":3399154,"avatar_url":"https://avatars.githubusercontent.com/u/3399154?v=3","gravatar_id":"","url":"https://api.github.com/users/ShadowNinja","html_url":"https://github.com/ShadowNinja","followers_url":"https://api.github.com/users/ShadowNinja/followers","following_url":"https://api.github.com/users/ShadowNinja/following{/other_user}","gists_url":"https://api.github.com/users/ShadowNinja/gists{/gist_id}","starred_url":"https://api.github.com/users/ShadowNinja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShadowNinja/subscriptions","organizations_url":"https://api.github.com/users/ShadowNinja/orgs","repos_url":"https://api.github.com/users/ShadowNinja/repos","events_url":"https://api.github.com/users/ShadowNinja/events{/privacy}","received_events_url":"https://api.github.com/users/ShadowNinja/received_events","type":"User","site_admin":false},"body":"This is necessarily true, because of the previous block (unless you're doing something screwy like overriding the `def` metatable's `__newindex` of course, which we don't support).","created_at":"2016-02-03T05:07:43Z","updated_at":"2016-02-03T05:07:43Z","html_url":"https://github.com/minetest/minetest_game/pull/743#discussion_r51679166","pull_request_url":"https://api.github.com/repos/minetest/minetest_game/pulls/743","_links":{"self":{"href":"https://api.github.com/repos/minetest/minetest_game/pulls/comments/51679166"},"html":{"href":"https://github.com/minetest/minetest_game/pull/743#discussion_r51679166"},"pull_request":{"href":"https://api.github.com/repos/minetest/minetest_game/pulls/743"}}},"pull_request":{"url":"https://api.github.com/repos/minetest/minetest_game/pulls/743","id":53668202,"html_url":"https://github.com/minetest/minetest_game/pull/743","diff_url":"https://github.com/minetest/minetest_game/pull/743.diff","patch_url":"https://github.com/minetest/minetest_game/pull/743.patch","issue_url":"https://api.github.com/repos/minetest/minetest_game/issues/743","number":743,"state":"open","locked":false,"title":"Create API for fence.register, and use it.","user":{"login":"sofar","id":1880041,"avatar_url":"https://avatars.githubusercontent.com/u/1880041?v=3","gravatar_id":"","url":"https://api.github.com/users/sofar","html_url":"https://github.com/sofar","followers_url":"https://api.github.com/users/sofar/followers","following_url":"https://api.github.com/users/sofar/following{/other_user}","gists_url":"https://api.github.com/users/sofar/gists{/gist_id}","starred_url":"https://api.github.com/users/sofar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sofar/subscriptions","organizations_url":"https://api.github.com/users/sofar/orgs","repos_url":"https://api.github.com/users/sofar/repos","events_url":"https://api.github.com/users/sofar/events{/privacy}","received_events_url":"https://api.github.com/users/sofar/received_events","type":"User","site_admin":false},"body":"This converts the call to minetest.register() for the default\r\nfence node, so it can be called by other mods to quickly\r\nsetup other fences.\r\n\r\nSince this creates an API, insert it into the game_api.txt.\r\n\r\nThe api looks like minetest.register(name, {def}), and has two\r\nuncommon fields: \"texture\" and \"material\".\r\n\r\nI'm not modifying the default fence recipe. Instead, this version\r\nadds acacia sticks, pine sticks, junglewood sticks. This simplifies\r\nthe API and simplifies crafting, and is easier to remember, and\r\ndoesn't invent a new craft recipe that is hard to guess.\r\n\r\nLastly, adds pine, junglewood and acacia fences.\r\n\r\nTextures for the new sticks. I verified all of minetest_game only\r\never looks at group:stick for other material, so this prevents no\r\nsurprise to any player.\r\n\r\nThis is a from-scratch implementation, written by heart but inspired\r\nby (#665 - Add many wooden fences).\r\n\r\nThe visual that fences connect strangely needs to be fixed in\r\ncontent_mapblock.cpp, something that can easily be done.","created_at":"2015-12-15T07:16:31Z","updated_at":"2016-02-03T05:07:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1ee12daa17b2648d04a4c66f1d4f9b47bad93c0f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/minetest/minetest_game/pulls/743/commits","review_comments_url":"https://api.github.com/repos/minetest/minetest_game/pulls/743/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/743/comments","statuses_url":"https://api.github.com/repos/minetest/minetest_game/statuses/75e9f7e0229d5a2cf57803a05eaa697955d88334","head":{"label":"sofar:fences","ref":"fences","sha":"75e9f7e0229d5a2cf57803a05eaa697955d88334","user":{"login":"sofar","id":1880041,"avatar_url":"https://avatars.githubusercontent.com/u/1880041?v=3","gravatar_id":"","url":"https://api.github.com/users/sofar","html_url":"https://github.com/sofar","followers_url":"https://api.github.com/users/sofar/followers","following_url":"https://api.github.com/users/sofar/following{/other_user}","gists_url":"https://api.github.com/users/sofar/gists{/gist_id}","starred_url":"https://api.github.com/users/sofar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sofar/subscriptions","organizations_url":"https://api.github.com/users/sofar/orgs","repos_url":"https://api.github.com/users/sofar/repos","events_url":"https://api.github.com/users/sofar/events{/privacy}","received_events_url":"https://api.github.com/users/sofar/received_events","type":"User","site_admin":false},"repo":{"id":47588416,"name":"minetest_game","full_name":"sofar/minetest_game","owner":{"login":"sofar","id":1880041,"avatar_url":"https://avatars.githubusercontent.com/u/1880041?v=3","gravatar_id":"","url":"https://api.github.com/users/sofar","html_url":"https://github.com/sofar","followers_url":"https://api.github.com/users/sofar/followers","following_url":"https://api.github.com/users/sofar/following{/other_user}","gists_url":"https://api.github.com/users/sofar/gists{/gist_id}","starred_url":"https://api.github.com/users/sofar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sofar/subscriptions","organizations_url":"https://api.github.com/users/sofar/orgs","repos_url":"https://api.github.com/users/sofar/repos","events_url":"https://api.github.com/users/sofar/events{/privacy}","received_events_url":"https://api.github.com/users/sofar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sofar/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/sofar/minetest_game","forks_url":"https://api.github.com/repos/sofar/minetest_game/forks","keys_url":"https://api.github.com/repos/sofar/minetest_game/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sofar/minetest_game/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sofar/minetest_game/teams","hooks_url":"https://api.github.com/repos/sofar/minetest_game/hooks","issue_events_url":"https://api.github.com/repos/sofar/minetest_game/issues/events{/number}","events_url":"https://api.github.com/repos/sofar/minetest_game/events","assignees_url":"https://api.github.com/repos/sofar/minetest_game/assignees{/user}","branches_url":"https://api.github.com/repos/sofar/minetest_game/branches{/branch}","tags_url":"https://api.github.com/repos/sofar/minetest_game/tags","blobs_url":"https://api.github.com/repos/sofar/minetest_game/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sofar/minetest_game/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sofar/minetest_game/git/refs{/sha}","trees_url":"https://api.github.com/repos/sofar/minetest_game/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sofar/minetest_game/statuses/{sha}","languages_url":"https://api.github.com/repos/sofar/minetest_game/languages","stargazers_url":"https://api.github.com/repos/sofar/minetest_game/stargazers","contributors_url":"https://api.github.com/repos/sofar/minetest_game/contributors","subscribers_url":"https://api.github.com/repos/sofar/minetest_game/subscribers","subscription_url":"https://api.github.com/repos/sofar/minetest_game/subscription","commits_url":"https://api.github.com/repos/sofar/minetest_game/commits{/sha}","git_commits_url":"https://api.github.com/repos/sofar/minetest_game/git/commits{/sha}","comments_url":"https://api.github.com/repos/sofar/minetest_game/comments{/number}","issue_comment_url":"https://api.github.com/repos/sofar/minetest_game/issues/comments{/number}","contents_url":"https://api.github.com/repos/sofar/minetest_game/contents/{+path}","compare_url":"https://api.github.com/repos/sofar/minetest_game/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sofar/minetest_game/merges","archive_url":"https://api.github.com/repos/sofar/minetest_game/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sofar/minetest_game/downloads","issues_url":"https://api.github.com/repos/sofar/minetest_game/issues{/number}","pulls_url":"https://api.github.com/repos/sofar/minetest_game/pulls{/number}","milestones_url":"https://api.github.com/repos/sofar/minetest_game/milestones{/number}","notifications_url":"https://api.github.com/repos/sofar/minetest_game/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sofar/minetest_game/labels{/name}","releases_url":"https://api.github.com/repos/sofar/minetest_game/releases{/id}","deployments_url":"https://api.github.com/repos/sofar/minetest_game/deployments","created_at":"2015-12-08T00:37:22Z","updated_at":"2015-12-08T00:37:24Z","pushed_at":"2016-02-01T06:39:51Z","git_url":"git://github.com/sofar/minetest_game.git","ssh_url":"git@github.com:sofar/minetest_game.git","clone_url":"https://github.com/sofar/minetest_game.git","svn_url":"https://github.com/sofar/minetest_game","homepage":"http://minetest.net/","size":4199,"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":"a4e144e4c8527f9c60a124b5f5eafed010afc699","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":"The main game for the Minetest game engine [minetest_game] [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-02-02T23:18:13Z","pushed_at":"2016-02-02T19:08: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":12584,"stargazers_count":363,"watchers_count":363,"language":"Lua","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":227,"mirror_url":null,"open_issues_count":82,"forks":227,"open_issues":82,"watchers":363,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/minetest/minetest_game/pulls/743"},"html":{"href":"https://github.com/minetest/minetest_game/pull/743"},"issue":{"href":"https://api.github.com/repos/minetest/minetest_game/issues/743"},"comments":{"href":"https://api.github.com/repos/minetest/minetest_game/issues/743/comments"},"review_comments":{"href":"https://api.github.com/repos/minetest/minetest_game/pulls/743/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/743/commits"},"statuses":{"href":"https://api.github.com/repos/minetest/minetest_game/statuses/75e9f7e0229d5a2cf57803a05eaa697955d88334"}}}}