{"action":"created","comment":{"url":"https://api.github.com/repos/cuberite/cuberite/pulls/comments/155225262","pull_request_review_id":81507797,"id":155225262,"diff_hunk":"@@ -2787,7 +2787,7 @@ void cProtocol_1_9_0::HandlePacketUseItem(cByteBuffer & a_ByteBuffer)\n \tHANDLE_READ(a_ByteBuffer, ReadVarInt, UInt64, Hand);","path":"src/Protocol/Protocol_1_9.cpp","position":10,"original_position":10,"commit_id":"aa30eb8554639829434a587c164e142f7fd2374a","original_commit_id":"aa30eb8554639829434a587c164e142f7fd2374a","user":{"login":"9caihezi","id":20877180,"avatar_url":"https://avatars2.githubusercontent.com/u/20877180?v=4","gravatar_id":"","url":"https://api.github.com/users/9caihezi","html_url":"https://github.com/9caihezi","followers_url":"https://api.github.com/users/9caihezi/followers","following_url":"https://api.github.com/users/9caihezi/following{/other_user}","gists_url":"https://api.github.com/users/9caihezi/gists{/gist_id}","starred_url":"https://api.github.com/users/9caihezi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/9caihezi/subscriptions","organizations_url":"https://api.github.com/users/9caihezi/orgs","repos_url":"https://api.github.com/users/9caihezi/repos","events_url":"https://api.github.com/users/9caihezi/events{/privacy}","received_events_url":"https://api.github.com/users/9caihezi/received_events","type":"User","site_admin":false},"body":"Changed. I didn't know why it's UInt64 in the first place.","created_at":"2017-12-06T12:42:21Z","updated_at":"2017-12-06T12:42:21Z","html_url":"https://github.com/cuberite/cuberite/pull/4089#discussion_r155225262","pull_request_url":"https://api.github.com/repos/cuberite/cuberite/pulls/4089","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/cuberite/cuberite/pulls/comments/155225262"},"html":{"href":"https://github.com/cuberite/cuberite/pull/4089#discussion_r155225262"},"pull_request":{"href":"https://api.github.com/repos/cuberite/cuberite/pulls/4089"}},"in_reply_to_id":155054203},"pull_request":{"url":"https://api.github.com/repos/cuberite/cuberite/pulls/4089","id":156509701,"html_url":"https://github.com/cuberite/cuberite/pull/4089","diff_url":"https://github.com/cuberite/cuberite/pull/4089.diff","patch_url":"https://github.com/cuberite/cuberite/pull/4089.patch","issue_url":"https://api.github.com/repos/cuberite/cuberite/issues/4089","number":4089,"state":"open","locked":false,"title":"Rewrite cClientHandle::HandleRightClick","user":{"login":"9caihezi","id":20877180,"avatar_url":"https://avatars2.githubusercontent.com/u/20877180?v=4","gravatar_id":"","url":"https://api.github.com/users/9caihezi","html_url":"https://github.com/9caihezi","followers_url":"https://api.github.com/users/9caihezi/followers","following_url":"https://api.github.com/users/9caihezi/following{/other_user}","gists_url":"https://api.github.com/users/9caihezi/gists{/gist_id}","starred_url":"https://api.github.com/users/9caihezi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/9caihezi/subscriptions","organizations_url":"https://api.github.com/users/9caihezi/orgs","repos_url":"https://api.github.com/users/9caihezi/repos","events_url":"https://api.github.com/users/9caihezi/events{/privacy}","received_events_url":"https://api.github.com/users/9caihezi/received_events","type":"User","site_admin":false},"body":"This commit changes the last parameter of cClientHandle::HandleRightClick from item to an integer indicating main/off hand.\r\nAlong with a completely rewrite of this function.\r\nOther than making the logic clearer, there are changes that will behave differently in some cases:\r\n1) We always actively update the status of a block if the placement fails\r\n   (by out of reach or rejected by plugin). There's no good reason to keep\r\n   exactly as what it was implemented.\r\n2) Do not call plugin callback CallHookPlayerRightClick(-1, 255, -1, -1, 0, 0, 0)\r\n   when using item. The CallHookPlayerUsingItem will still be called.\r\n   The only difference is that a plugin cannot stop using item by returning\r\n   true. At least, if we want that functionaliity, we should let\r\n   CallHookPlayerUsingItem return the stop flag.\r\n   Now at most one of CallHookPlayerRightClick, CallHookPlayerUsingBlock,\r\n   CallHookPlayerUsingItem and CallHookPlayerEating will be called based on\r\n   the type of action (not including the used version of callbacks).\r\n3) Do not count using item as BlockInteractionsRate check (Using item takes time).\r\n   2) and 3) are both be done by move the flow of using item apart from placing blocks.\r\n   The original behavior doesn't make sense to me at all.\r\n4) Now we can open chests(etc.) when sneaking as long as no block can be placed.\r\n   This is what vanilla server does.\r\n\r\nTODOs:\r\n* consume items based on which hand we are using, then the off hand is fully functional for right clicks;\r\n* other trivial TODOs noted in the code.","created_at":"2017-12-05T16:26:13Z","updated_at":"2017-12-06T12:42:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d25fb9c21a32127d02eb2ad802a035b5f52779a8","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/cuberite/cuberite/pulls/4089/commits","review_comments_url":"https://api.github.com/repos/cuberite/cuberite/pulls/4089/comments","review_comment_url":"https://api.github.com/repos/cuberite/cuberite/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cuberite/cuberite/issues/4089/comments","statuses_url":"https://api.github.com/repos/cuberite/cuberite/statuses/aa30eb8554639829434a587c164e142f7fd2374a","head":{"label":"9caihezi:master","ref":"master","sha":"aa30eb8554639829434a587c164e142f7fd2374a","user":{"login":"9caihezi","id":20877180,"avatar_url":"https://avatars2.githubusercontent.com/u/20877180?v=4","gravatar_id":"","url":"https://api.github.com/users/9caihezi","html_url":"https://github.com/9caihezi","followers_url":"https://api.github.com/users/9caihezi/followers","following_url":"https://api.github.com/users/9caihezi/following{/other_user}","gists_url":"https://api.github.com/users/9caihezi/gists{/gist_id}","starred_url":"https://api.github.com/users/9caihezi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/9caihezi/subscriptions","organizations_url":"https://api.github.com/users/9caihezi/orgs","repos_url":"https://api.github.com/users/9caihezi/repos","events_url":"https://api.github.com/users/9caihezi/events{/privacy}","received_events_url":"https://api.github.com/users/9caihezi/received_events","type":"User","site_admin":false},"repo":{"id":112903582,"name":"cuberite","full_name":"9caihezi/cuberite","owner":{"login":"9caihezi","id":20877180,"avatar_url":"https://avatars2.githubusercontent.com/u/20877180?v=4","gravatar_id":"","url":"https://api.github.com/users/9caihezi","html_url":"https://github.com/9caihezi","followers_url":"https://api.github.com/users/9caihezi/followers","following_url":"https://api.github.com/users/9caihezi/following{/other_user}","gists_url":"https://api.github.com/users/9caihezi/gists{/gist_id}","starred_url":"https://api.github.com/users/9caihezi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/9caihezi/subscriptions","organizations_url":"https://api.github.com/users/9caihezi/orgs","repos_url":"https://api.github.com/users/9caihezi/repos","events_url":"https://api.github.com/users/9caihezi/events{/privacy}","received_events_url":"https://api.github.com/users/9caihezi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/9caihezi/cuberite","description":"A lightweight, fast and extensible game server for Minecraft","fork":true,"url":"https://api.github.com/repos/9caihezi/cuberite","forks_url":"https://api.github.com/repos/9caihezi/cuberite/forks","keys_url":"https://api.github.com/repos/9caihezi/cuberite/keys{/key_id}","collaborators_url":"https://api.github.com/repos/9caihezi/cuberite/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/9caihezi/cuberite/teams","hooks_url":"https://api.github.com/repos/9caihezi/cuberite/hooks","issue_events_url":"https://api.github.com/repos/9caihezi/cuberite/issues/events{/number}","events_url":"https://api.github.com/repos/9caihezi/cuberite/events","assignees_url":"https://api.github.com/repos/9caihezi/cuberite/assignees{/user}","branches_url":"https://api.github.com/repos/9caihezi/cuberite/branches{/branch}","tags_url":"https://api.github.com/repos/9caihezi/cuberite/tags","blobs_url":"https://api.github.com/repos/9caihezi/cuberite/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/9caihezi/cuberite/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/9caihezi/cuberite/git/refs{/sha}","trees_url":"https://api.github.com/repos/9caihezi/cuberite/git/trees{/sha}","statuses_url":"https://api.github.com/repos/9caihezi/cuberite/statuses/{sha}","languages_url":"https://api.github.com/repos/9caihezi/cuberite/languages","stargazers_url":"https://api.github.com/repos/9caihezi/cuberite/stargazers","contributors_url":"https://api.github.com/repos/9caihezi/cuberite/contributors","subscribers_url":"https://api.github.com/repos/9caihezi/cuberite/subscribers","subscription_url":"https://api.github.com/repos/9caihezi/cuberite/subscription","commits_url":"https://api.github.com/repos/9caihezi/cuberite/commits{/sha}","git_commits_url":"https://api.github.com/repos/9caihezi/cuberite/git/commits{/sha}","comments_url":"https://api.github.com/repos/9caihezi/cuberite/comments{/number}","issue_comment_url":"https://api.github.com/repos/9caihezi/cuberite/issues/comments{/number}","contents_url":"https://api.github.com/repos/9caihezi/cuberite/contents/{+path}","compare_url":"https://api.github.com/repos/9caihezi/cuberite/compare/{base}...{head}","merges_url":"https://api.github.com/repos/9caihezi/cuberite/merges","archive_url":"https://api.github.com/repos/9caihezi/cuberite/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/9caihezi/cuberite/downloads","issues_url":"https://api.github.com/repos/9caihezi/cuberite/issues{/number}","pulls_url":"https://api.github.com/repos/9caihezi/cuberite/pulls{/number}","milestones_url":"https://api.github.com/repos/9caihezi/cuberite/milestones{/number}","notifications_url":"https://api.github.com/repos/9caihezi/cuberite/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/9caihezi/cuberite/labels{/name}","releases_url":"https://api.github.com/repos/9caihezi/cuberite/releases{/id}","deployments_url":"https://api.github.com/repos/9caihezi/cuberite/deployments","created_at":"2017-12-03T05:45:23Z","updated_at":"2017-12-03T05:45:28Z","pushed_at":"2017-12-05T16:22:03Z","git_url":"git://github.com/9caihezi/cuberite.git","ssh_url":"git@github.com:9caihezi/cuberite.git","clone_url":"https://github.com/9caihezi/cuberite.git","svn_url":"https://github.com/9caihezi/cuberite","homepage":"http://cuberite.org","size":82250,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cuberite:master","ref":"master","sha":"0dd172b80ffc949cf87119ad2003589d7eb82c46","user":{"login":"cuberite","id":8973961,"avatar_url":"https://avatars0.githubusercontent.com/u/8973961?v=4","gravatar_id":"","url":"https://api.github.com/users/cuberite","html_url":"https://github.com/cuberite","followers_url":"https://api.github.com/users/cuberite/followers","following_url":"https://api.github.com/users/cuberite/following{/other_user}","gists_url":"https://api.github.com/users/cuberite/gists{/gist_id}","starred_url":"https://api.github.com/users/cuberite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cuberite/subscriptions","organizations_url":"https://api.github.com/users/cuberite/orgs","repos_url":"https://api.github.com/users/cuberite/repos","events_url":"https://api.github.com/users/cuberite/events{/privacy}","received_events_url":"https://api.github.com/users/cuberite/received_events","type":"Organization","site_admin":false},"repo":{"id":11693709,"name":"cuberite","full_name":"cuberite/cuberite","owner":{"login":"cuberite","id":8973961,"avatar_url":"https://avatars0.githubusercontent.com/u/8973961?v=4","gravatar_id":"","url":"https://api.github.com/users/cuberite","html_url":"https://github.com/cuberite","followers_url":"https://api.github.com/users/cuberite/followers","following_url":"https://api.github.com/users/cuberite/following{/other_user}","gists_url":"https://api.github.com/users/cuberite/gists{/gist_id}","starred_url":"https://api.github.com/users/cuberite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cuberite/subscriptions","organizations_url":"https://api.github.com/users/cuberite/orgs","repos_url":"https://api.github.com/users/cuberite/repos","events_url":"https://api.github.com/users/cuberite/events{/privacy}","received_events_url":"https://api.github.com/users/cuberite/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cuberite/cuberite","description":"A lightweight, fast and extensible game server for Minecraft","fork":false,"url":"https://api.github.com/repos/cuberite/cuberite","forks_url":"https://api.github.com/repos/cuberite/cuberite/forks","keys_url":"https://api.github.com/repos/cuberite/cuberite/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cuberite/cuberite/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cuberite/cuberite/teams","hooks_url":"https://api.github.com/repos/cuberite/cuberite/hooks","issue_events_url":"https://api.github.com/repos/cuberite/cuberite/issues/events{/number}","events_url":"https://api.github.com/repos/cuberite/cuberite/events","assignees_url":"https://api.github.com/repos/cuberite/cuberite/assignees{/user}","branches_url":"https://api.github.com/repos/cuberite/cuberite/branches{/branch}","tags_url":"https://api.github.com/repos/cuberite/cuberite/tags","blobs_url":"https://api.github.com/repos/cuberite/cuberite/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cuberite/cuberite/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cuberite/cuberite/git/refs{/sha}","trees_url":"https://api.github.com/repos/cuberite/cuberite/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cuberite/cuberite/statuses/{sha}","languages_url":"https://api.github.com/repos/cuberite/cuberite/languages","stargazers_url":"https://api.github.com/repos/cuberite/cuberite/stargazers","contributors_url":"https://api.github.com/repos/cuberite/cuberite/contributors","subscribers_url":"https://api.github.com/repos/cuberite/cuberite/subscribers","subscription_url":"https://api.github.com/repos/cuberite/cuberite/subscription","commits_url":"https://api.github.com/repos/cuberite/cuberite/commits{/sha}","git_commits_url":"https://api.github.com/repos/cuberite/cuberite/git/commits{/sha}","comments_url":"https://api.github.com/repos/cuberite/cuberite/comments{/number}","issue_comment_url":"https://api.github.com/repos/cuberite/cuberite/issues/comments{/number}","contents_url":"https://api.github.com/repos/cuberite/cuberite/contents/{+path}","compare_url":"https://api.github.com/repos/cuberite/cuberite/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cuberite/cuberite/merges","archive_url":"https://api.github.com/repos/cuberite/cuberite/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cuberite/cuberite/downloads","issues_url":"https://api.github.com/repos/cuberite/cuberite/issues{/number}","pulls_url":"https://api.github.com/repos/cuberite/cuberite/pulls{/number}","milestones_url":"https://api.github.com/repos/cuberite/cuberite/milestones{/number}","notifications_url":"https://api.github.com/repos/cuberite/cuberite/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cuberite/cuberite/labels{/name}","releases_url":"https://api.github.com/repos/cuberite/cuberite/releases{/id}","deployments_url":"https://api.github.com/repos/cuberite/cuberite/deployments","created_at":"2013-07-26T19:56:59Z","updated_at":"2017-12-04T15:37:13Z","pushed_at":"2017-12-05T20:09:56Z","git_url":"git://github.com/cuberite/cuberite.git","ssh_url":"git@github.com:cuberite/cuberite.git","clone_url":"https://github.com/cuberite/cuberite.git","svn_url":"https://github.com/cuberite/cuberite","homepage":"http://cuberite.org","size":82186,"stargazers_count":2124,"watchers_count":2124,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":428,"mirror_url":null,"archived":false,"open_issues_count":526,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":428,"open_issues":526,"watchers":2124,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cuberite/cuberite/pulls/4089"},"html":{"href":"https://github.com/cuberite/cuberite/pull/4089"},"issue":{"href":"https://api.github.com/repos/cuberite/cuberite/issues/4089"},"comments":{"href":"https://api.github.com/repos/cuberite/cuberite/issues/4089/comments"},"review_comments":{"href":"https://api.github.com/repos/cuberite/cuberite/pulls/4089/comments"},"review_comment":{"href":"https://api.github.com/repos/cuberite/cuberite/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cuberite/cuberite/pulls/4089/commits"},"statuses":{"href":"https://api.github.com/repos/cuberite/cuberite/statuses/aa30eb8554639829434a587c164e142f7fd2374a"}},"author_association":"NONE"}}
{"actor":{"display_login":"9caihezi"}}