{"action":"created","comment":{"url":"https://api.github.com/repos/minetest/minetest_game/pulls/comments/78401227","id":78401227,"diff_hunk":"@@ -344,56 +344,57 @@ minetest.register_abm({\n -- Convert dirt to something that fits the environment\n --\n \n+default.dirt_types = {\n+\t\"default:dirt_with_grass\",\n+\t\"default:dirt_with_dry_grass\",\n+\t\"default:dirt_with_snow\"\n+}\n+\n minetest.register_abm({\n \tlabel = \"Grass spread\",\n \tnodenames = {\"default:dirt\"},\n-\tneighbors = {\n-\t\t\"default:dirt_with_grass\",\n-\t\t\"default:dirt_with_dry_grass\",\n-\t\t\"default:dirt_with_snow\",\n-\t\t\"group:grass\",\n-\t\t\"group:dry_grass\",\n-\t\t\"default:snow\",\n-\t},\n+\tneighbors = {\"air\"},\n \tinterval = 6,\n \tchance = 67,\n \tcatch_up = false,\n \taction = function(pos, node)\n-\t\t-- Most likely case, half the time it's too dark for this.\n+\t\t-- not enough light\n \t\tlocal above = {x = pos.x, y = pos.y + 1, z = pos.z}\n \t\tif (minetest.get_node_light(above) or 0) < 13 then\n \t\t\treturn\n \t\tend\n \n-\t\t-- Look for likely neighbors.\n-\t\tlocal p2 = minetest.find_node_near(pos, 1, {\"default:dirt_with_grass\",\n-\t\t\t\t\"default:dirt_with_dry_grass\", \"default:dirt_with_snow\"})\n-\t\tif p2 then\n-\t\t\t-- But the node needs to be under air in this case.\n-\t\t\tlocal n2 = minetest.get_node(above)\n-\t\t\tif n2 and n2.name == \"air\" then\n-\t\t\t\tlocal n3 = minetest.get_node(p2)\n-\t\t\t\tminetest.set_node(pos, {name = n3.name})\n-\t\t\t\treturn\n+\t\t-- water above grass\n+\t\tlocal name = minetest.get_node(above).name\n+\t\tlocal def = minetest.registered_nodes[name]\n+\n+\t\tif name == \"ignore\" or not def or def.liquidtype ~= \"none\" then\n+\t\t\treturn\n+\t\tend\n+\n+\t\tlocal curr_max, curr_type, num  = 0, \"\"","path":"mods/default/functions.lua","position":51,"original_position":51,"commit_id":"2ea78aac1a14e7c686aa0d252fab61c935e8b02c","original_commit_id":"2ea78aac1a14e7c686aa0d252fab61c935e8b02c","user":{"login":"rubenwardy","id":2122943,"avatar_url":"https://avatars.githubusercontent.com/u/2122943?v=3","gravatar_id":"","url":"https://api.github.com/users/rubenwardy","html_url":"https://github.com/rubenwardy","followers_url":"https://api.github.com/users/rubenwardy/followers","following_url":"https://api.github.com/users/rubenwardy/following{/other_user}","gists_url":"https://api.github.com/users/rubenwardy/gists{/gist_id}","starred_url":"https://api.github.com/users/rubenwardy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubenwardy/subscriptions","organizations_url":"https://api.github.com/users/rubenwardy/orgs","repos_url":"https://api.github.com/users/rubenwardy/repos","events_url":"https://api.github.com/users/rubenwardy/events{/privacy}","received_events_url":"https://api.github.com/users/rubenwardy/received_events","type":"User","site_admin":false},"body":"this is confusing to me, is it:\r\n\r\n```lua\r\nlocal curr_max, curr_type, num = 0, \"\", nil\r\n```\r\n\r\nI'd much prefer to split this up and put it directly above the for loop (L382) but that's just personal preference. At least add the `, nil`","created_at":"2016-09-12T16:01:39Z","updated_at":"2016-09-12T16:01:39Z","html_url":"https://github.com/minetest/minetest_game/pull/1286#discussion_r78401227","pull_request_url":"https://api.github.com/repos/minetest/minetest_game/pulls/1286","_links":{"self":{"href":"https://api.github.com/repos/minetest/minetest_game/pulls/comments/78401227"},"html":{"href":"https://github.com/minetest/minetest_game/pull/1286#discussion_r78401227"},"pull_request":{"href":"https://api.github.com/repos/minetest/minetest_game/pulls/1286"}}},"pull_request":{"url":"https://api.github.com/repos/minetest/minetest_game/pulls/1286","id":84880664,"html_url":"https://github.com/minetest/minetest_game/pull/1286","diff_url":"https://github.com/minetest/minetest_game/pull/1286.diff","patch_url":"https://github.com/minetest/minetest_game/pull/1286.patch","issue_url":"https://api.github.com/repos/minetest/minetest_game/issues/1286","number":1286,"state":"open","locked":false,"title":"Dynamic Dirt to Grass changes","user":{"login":"tenplus1","id":8145060,"avatar_url":"https://avatars.githubusercontent.com/u/8145060?v=3","gravatar_id":"","url":"https://api.github.com/users/tenplus1","html_url":"https://github.com/tenplus1","followers_url":"https://api.github.com/users/tenplus1/followers","following_url":"https://api.github.com/users/tenplus1/following{/other_user}","gists_url":"https://api.github.com/users/tenplus1/gists{/gist_id}","starred_url":"https://api.github.com/users/tenplus1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tenplus1/subscriptions","organizations_url":"https://api.github.com/users/tenplus1/orgs","repos_url":"https://api.github.com/users/tenplus1/repos","events_url":"https://api.github.com/users/tenplus1/events{/privacy}","received_events_url":"https://api.github.com/users/tenplus1/received_events","type":"User","site_admin":false},"body":"This new function allows for grass spreading to occur for any type of a grass and can be easily amended by changing the default.dirt_types global to cater for 3rd party mod grasses.\r\n\r\nDirt will only change into grass if it is beside either green, snowy or dry grass and has enough light to change, failing that it remains normal dirt.","created_at":"2016-09-12T14:25:16Z","updated_at":"2016-09-12T16:01:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e12a33fa5359d620c5ae5bc7f203c3aca8c6e522","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/minetest/minetest_game/pulls/1286/commits","review_comments_url":"https://api.github.com/repos/minetest/minetest_game/pulls/1286/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/1286/comments","statuses_url":"https://api.github.com/repos/minetest/minetest_game/statuses/2ea78aac1a14e7c686aa0d252fab61c935e8b02c","head":{"label":"tenplus1:patch-70","ref":"patch-70","sha":"2ea78aac1a14e7c686aa0d252fab61c935e8b02c","user":{"login":"tenplus1","id":8145060,"avatar_url":"https://avatars.githubusercontent.com/u/8145060?v=3","gravatar_id":"","url":"https://api.github.com/users/tenplus1","html_url":"https://github.com/tenplus1","followers_url":"https://api.github.com/users/tenplus1/followers","following_url":"https://api.github.com/users/tenplus1/following{/other_user}","gists_url":"https://api.github.com/users/tenplus1/gists{/gist_id}","starred_url":"https://api.github.com/users/tenplus1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tenplus1/subscriptions","organizations_url":"https://api.github.com/users/tenplus1/orgs","repos_url":"https://api.github.com/users/tenplus1/repos","events_url":"https://api.github.com/users/tenplus1/events{/privacy}","received_events_url":"https://api.github.com/users/tenplus1/received_events","type":"User","site_admin":false},"repo":{"id":31034998,"name":"minetest_game","full_name":"tenplus1/minetest_game","owner":{"login":"tenplus1","id":8145060,"avatar_url":"https://avatars.githubusercontent.com/u/8145060?v=3","gravatar_id":"","url":"https://api.github.com/users/tenplus1","html_url":"https://github.com/tenplus1","followers_url":"https://api.github.com/users/tenplus1/followers","following_url":"https://api.github.com/users/tenplus1/following{/other_user}","gists_url":"https://api.github.com/users/tenplus1/gists{/gist_id}","starred_url":"https://api.github.com/users/tenplus1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tenplus1/subscriptions","organizations_url":"https://api.github.com/users/tenplus1/orgs","repos_url":"https://api.github.com/users/tenplus1/repos","events_url":"https://api.github.com/users/tenplus1/events{/privacy}","received_events_url":"https://api.github.com/users/tenplus1/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tenplus1/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/tenplus1/minetest_game","forks_url":"https://api.github.com/repos/tenplus1/minetest_game/forks","keys_url":"https://api.github.com/repos/tenplus1/minetest_game/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tenplus1/minetest_game/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tenplus1/minetest_game/teams","hooks_url":"https://api.github.com/repos/tenplus1/minetest_game/hooks","issue_events_url":"https://api.github.com/repos/tenplus1/minetest_game/issues/events{/number}","events_url":"https://api.github.com/repos/tenplus1/minetest_game/events","assignees_url":"https://api.github.com/repos/tenplus1/minetest_game/assignees{/user}","branches_url":"https://api.github.com/repos/tenplus1/minetest_game/branches{/branch}","tags_url":"https://api.github.com/repos/tenplus1/minetest_game/tags","blobs_url":"https://api.github.com/repos/tenplus1/minetest_game/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tenplus1/minetest_game/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tenplus1/minetest_game/git/refs{/sha}","trees_url":"https://api.github.com/repos/tenplus1/minetest_game/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tenplus1/minetest_game/statuses/{sha}","languages_url":"https://api.github.com/repos/tenplus1/minetest_game/languages","stargazers_url":"https://api.github.com/repos/tenplus1/minetest_game/stargazers","contributors_url":"https://api.github.com/repos/tenplus1/minetest_game/contributors","subscribers_url":"https://api.github.com/repos/tenplus1/minetest_game/subscribers","subscription_url":"https://api.github.com/repos/tenplus1/minetest_game/subscription","commits_url":"https://api.github.com/repos/tenplus1/minetest_game/commits{/sha}","git_commits_url":"https://api.github.com/repos/tenplus1/minetest_game/git/commits{/sha}","comments_url":"https://api.github.com/repos/tenplus1/minetest_game/comments{/number}","issue_comment_url":"https://api.github.com/repos/tenplus1/minetest_game/issues/comments{/number}","contents_url":"https://api.github.com/repos/tenplus1/minetest_game/contents/{+path}","compare_url":"https://api.github.com/repos/tenplus1/minetest_game/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tenplus1/minetest_game/merges","archive_url":"https://api.github.com/repos/tenplus1/minetest_game/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tenplus1/minetest_game/downloads","issues_url":"https://api.github.com/repos/tenplus1/minetest_game/issues{/number}","pulls_url":"https://api.github.com/repos/tenplus1/minetest_game/pulls{/number}","milestones_url":"https://api.github.com/repos/tenplus1/minetest_game/milestones{/number}","notifications_url":"https://api.github.com/repos/tenplus1/minetest_game/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tenplus1/minetest_game/labels{/name}","releases_url":"https://api.github.com/repos/tenplus1/minetest_game/releases{/id}","deployments_url":"https://api.github.com/repos/tenplus1/minetest_game/deployments","created_at":"2015-02-19T20:24:12Z","updated_at":"2015-02-19T20:24:13Z","pushed_at":"2016-09-12T14:25:05Z","git_url":"git://github.com/tenplus1/minetest_game.git","ssh_url":"git@github.com:tenplus1/minetest_game.git","clone_url":"https://github.com/tenplus1/minetest_game.git","svn_url":"https://github.com/tenplus1/minetest_game","homepage":"http://minetest.net/","size":4936,"stargazers_count":0,"watchers_count":0,"language":"Logos","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"minetest:master","ref":"master","sha":"0cbb516ae2a8ec7acf6aa968715f3c1aa32a8f5b","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-09-04T02:05:34Z","pushed_at":"2016-09-12T14:25:16Z","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":14045,"stargazers_count":456,"watchers_count":456,"language":"Lua","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":262,"mirror_url":null,"open_issues_count":70,"forks":262,"open_issues":70,"watchers":456,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/minetest/minetest_game/pulls/1286"},"html":{"href":"https://github.com/minetest/minetest_game/pull/1286"},"issue":{"href":"https://api.github.com/repos/minetest/minetest_game/issues/1286"},"comments":{"href":"https://api.github.com/repos/minetest/minetest_game/issues/1286/comments"},"review_comments":{"href":"https://api.github.com/repos/minetest/minetest_game/pulls/1286/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/1286/commits"},"statuses":{"href":"https://api.github.com/repos/minetest/minetest_game/statuses/2ea78aac1a14e7c686aa0d252fab61c935e8b02c"}}}}
{"actor":{"display_login":"rubenwardy"}}