{"action":"created","comment":{"url":"https://api.github.com/repos/Minecolonies/minecolonies/pulls/comments/165368000","pull_request_review_id":93295030,"id":165368000,"diff_hunk":"@@ -2007,6 +2079,46 @@ public void onWakeUp()\n         {\n             homeBuilding.onWakeUp();\n         }\n+\n+        setIsAsleep(false);\n+        dataManager.set(DATA_BED_POS, new BlockPos(0,0,0));\n+    }\n+\n+    public boolean isAsleep()\n+    {\n+        return dataManager.get(DATA_IS_ASLEEP);\n+    }\n+\n+    public void setIsAsleep(boolean isAsleep)","path":"src/main/java/com/minecolonies/coremod/entity/EntityCitizen.java","position":128,"original_position":128,"commit_id":"d4a5debd53768a261b8ff9392454aed1e877db4e","original_commit_id":"d4a5debd53768a261b8ff9392454aed1e877db4e","user":{"login":"codacy-bot","id":19940114,"avatar_url":"https://avatars1.githubusercontent.com/u/19940114?v=4","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://www.codacy.com/assets/images/favicon.png) Issue found: [Parameter 'isAsleep' is not assigned and could be declared final](https://www.codacy.com/app/Minecolonies/minecolonies/pullRequest?prid=1292149)","created_at":"2018-02-01T14:19:36Z","updated_at":"2018-02-01T14:19:37Z","html_url":"https://github.com/Minecolonies/minecolonies/pull/2130#discussion_r165368000","pull_request_url":"https://api.github.com/repos/Minecolonies/minecolonies/pulls/2130","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Minecolonies/minecolonies/pulls/comments/165368000"},"html":{"href":"https://github.com/Minecolonies/minecolonies/pull/2130#discussion_r165368000"},"pull_request":{"href":"https://api.github.com/repos/Minecolonies/minecolonies/pulls/2130"}}},"pull_request":{"url":"https://api.github.com/repos/Minecolonies/minecolonies/pulls/2130","id":166547840,"html_url":"https://github.com/Minecolonies/minecolonies/pull/2130","diff_url":"https://github.com/Minecolonies/minecolonies/pull/2130.diff","patch_url":"https://github.com/Minecolonies/minecolonies/pull/2130.patch","issue_url":"https://api.github.com/repos/Minecolonies/minecolonies/issues/2130","number":2130,"state":"open","locked":false,"title":"Sleeping Citizens.","user":{"login":"OrionDevelopment","id":5585406,"avatar_url":"https://avatars2.githubusercontent.com/u/5585406?v=4","gravatar_id":"","url":"https://api.github.com/users/OrionDevelopment","html_url":"https://github.com/OrionDevelopment","followers_url":"https://api.github.com/users/OrionDevelopment/followers","following_url":"https://api.github.com/users/OrionDevelopment/following{/other_user}","gists_url":"https://api.github.com/users/OrionDevelopment/gists{/gist_id}","starred_url":"https://api.github.com/users/OrionDevelopment/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OrionDevelopment/subscriptions","organizations_url":"https://api.github.com/users/OrionDevelopment/orgs","repos_url":"https://api.github.com/users/OrionDevelopment/repos","events_url":"https://api.github.com/users/OrionDevelopment/events{/privacy}","received_events_url":"https://api.github.com/users/OrionDevelopment/received_events","type":"User","site_admin":false},"body":"### Primary Feature\r\nThis makes citizens actually sleep in their respective beds. Or collect them at their respective home buildings block. To achieve this several changes have been made. Most notably:\r\n- The TownHall is now a BuildingHome. This ensures that its beds are actually used.\r\n- Block registration to a building is now done using a BlockState, the current implementation extracts the Block and passes it to the old methods.\r\n- Bed positions are now always saved with the head of the block\r\n- The placementhandler for the Bed now only performs his operations on the Head part of the Bed, and just noop accepts on the foot part instead of the other way around.\r\n- The EntityAISleep finds a proper bed and marks it occupied on the first tick\r\n- Once the citizen arrives at his bed his `trySleep(BlockPos)` method is called.\r\n- `trySleep(BlockPos)` will check if the given position is a bed (incase we do not have enough beds and the building block is passed). Store the data in the DataManager and teleport the citizen to the top of the bed.\r\n- During rendering the DataManager is queried if the citizen is sleeping. He is then rotated and translated properly to render him in bed.\r\n\r\n### Secondary Feature\r\nThis PR makes so that blocks get properly registered to their respective building when it gets placed using the creative paste option.\r\n\r\n### Images:\r\n#### Two citizens next to each works just fine:\r\n![image](https://user-images.githubusercontent.com/5585406/35682749-16300840-0762-11e8-92f9-68495bba7fc4.png)\r\n#### Higher levels if Citizen huts get used properly:\r\n![image](https://user-images.githubusercontent.com/5585406/35682830-58ccbc02-0762-11e8-895a-9e6251af33e5.png)\r\n","created_at":"2018-02-01T14:13:07Z","updated_at":"2018-02-01T14:19:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"76ad1b1ba0c9c9663f88cff55e6d7b5d1941065b","assignee":null,"assignees":[],"requested_reviewers":[{"login":"Kostronor","id":644950,"avatar_url":"https://avatars2.githubusercontent.com/u/644950?v=4","gravatar_id":"","url":"https://api.github.com/users/Kostronor","html_url":"https://github.com/Kostronor","followers_url":"https://api.github.com/users/Kostronor/followers","following_url":"https://api.github.com/users/Kostronor/following{/other_user}","gists_url":"https://api.github.com/users/Kostronor/gists{/gist_id}","starred_url":"https://api.github.com/users/Kostronor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kostronor/subscriptions","organizations_url":"https://api.github.com/users/Kostronor/orgs","repos_url":"https://api.github.com/users/Kostronor/repos","events_url":"https://api.github.com/users/Kostronor/events{/privacy}","received_events_url":"https://api.github.com/users/Kostronor/received_events","type":"User","site_admin":false},{"login":"Raycoms","id":6438347,"avatar_url":"https://avatars1.githubusercontent.com/u/6438347?v=4","gravatar_id":"","url":"https://api.github.com/users/Raycoms","html_url":"https://github.com/Raycoms","followers_url":"https://api.github.com/users/Raycoms/followers","following_url":"https://api.github.com/users/Raycoms/following{/other_user}","gists_url":"https://api.github.com/users/Raycoms/gists{/gist_id}","starred_url":"https://api.github.com/users/Raycoms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Raycoms/subscriptions","organizations_url":"https://api.github.com/users/Raycoms/orgs","repos_url":"https://api.github.com/users/Raycoms/repos","events_url":"https://api.github.com/users/Raycoms/events{/privacy}","received_events_url":"https://api.github.com/users/Raycoms/received_events","type":"User","site_admin":false}],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/Minecolonies/minecolonies/pulls/2130/commits","review_comments_url":"https://api.github.com/repos/Minecolonies/minecolonies/pulls/2130/comments","review_comment_url":"https://api.github.com/repos/Minecolonies/minecolonies/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Minecolonies/minecolonies/issues/2130/comments","statuses_url":"https://api.github.com/repos/Minecolonies/minecolonies/statuses/d4a5debd53768a261b8ff9392454aed1e877db4e","head":{"label":"Minecolonies:feature/sleeping-citizens","ref":"feature/sleeping-citizens","sha":"d4a5debd53768a261b8ff9392454aed1e877db4e","user":{"login":"Minecolonies","id":5167336,"avatar_url":"https://avatars3.githubusercontent.com/u/5167336?v=4","gravatar_id":"","url":"https://api.github.com/users/Minecolonies","html_url":"https://github.com/Minecolonies","followers_url":"https://api.github.com/users/Minecolonies/followers","following_url":"https://api.github.com/users/Minecolonies/following{/other_user}","gists_url":"https://api.github.com/users/Minecolonies/gists{/gist_id}","starred_url":"https://api.github.com/users/Minecolonies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Minecolonies/subscriptions","organizations_url":"https://api.github.com/users/Minecolonies/orgs","repos_url":"https://api.github.com/users/Minecolonies/repos","events_url":"https://api.github.com/users/Minecolonies/events{/privacy}","received_events_url":"https://api.github.com/users/Minecolonies/received_events","type":"Organization","site_admin":false},"repo":{"id":65616760,"name":"minecolonies","full_name":"Minecolonies/minecolonies","owner":{"login":"Minecolonies","id":5167336,"avatar_url":"https://avatars3.githubusercontent.com/u/5167336?v=4","gravatar_id":"","url":"https://api.github.com/users/Minecolonies","html_url":"https://github.com/Minecolonies","followers_url":"https://api.github.com/users/Minecolonies/followers","following_url":"https://api.github.com/users/Minecolonies/following{/other_user}","gists_url":"https://api.github.com/users/Minecolonies/gists{/gist_id}","starred_url":"https://api.github.com/users/Minecolonies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Minecolonies/subscriptions","organizations_url":"https://api.github.com/users/Minecolonies/orgs","repos_url":"https://api.github.com/users/Minecolonies/repos","events_url":"https://api.github.com/users/Minecolonies/events{/privacy}","received_events_url":"https://api.github.com/users/Minecolonies/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Minecolonies/minecolonies","description":"Minecolonies minecraft mod","fork":false,"url":"https://api.github.com/repos/Minecolonies/minecolonies","forks_url":"https://api.github.com/repos/Minecolonies/minecolonies/forks","keys_url":"https://api.github.com/repos/Minecolonies/minecolonies/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Minecolonies/minecolonies/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Minecolonies/minecolonies/teams","hooks_url":"https://api.github.com/repos/Minecolonies/minecolonies/hooks","issue_events_url":"https://api.github.com/repos/Minecolonies/minecolonies/issues/events{/number}","events_url":"https://api.github.com/repos/Minecolonies/minecolonies/events","assignees_url":"https://api.github.com/repos/Minecolonies/minecolonies/assignees{/user}","branches_url":"https://api.github.com/repos/Minecolonies/minecolonies/branches{/branch}","tags_url":"https://api.github.com/repos/Minecolonies/minecolonies/tags","blobs_url":"https://api.github.com/repos/Minecolonies/minecolonies/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Minecolonies/minecolonies/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Minecolonies/minecolonies/git/refs{/sha}","trees_url":"https://api.github.com/repos/Minecolonies/minecolonies/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Minecolonies/minecolonies/statuses/{sha}","languages_url":"https://api.github.com/repos/Minecolonies/minecolonies/languages","stargazers_url":"https://api.github.com/repos/Minecolonies/minecolonies/stargazers","contributors_url":"https://api.github.com/repos/Minecolonies/minecolonies/contributors","subscribers_url":"https://api.github.com/repos/Minecolonies/minecolonies/subscribers","subscription_url":"https://api.github.com/repos/Minecolonies/minecolonies/subscription","commits_url":"https://api.github.com/repos/Minecolonies/minecolonies/commits{/sha}","git_commits_url":"https://api.github.com/repos/Minecolonies/minecolonies/git/commits{/sha}","comments_url":"https://api.github.com/repos/Minecolonies/minecolonies/comments{/number}","issue_comment_url":"https://api.github.com/repos/Minecolonies/minecolonies/issues/comments{/number}","contents_url":"https://api.github.com/repos/Minecolonies/minecolonies/contents/{+path}","compare_url":"https://api.github.com/repos/Minecolonies/minecolonies/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Minecolonies/minecolonies/merges","archive_url":"https://api.github.com/repos/Minecolonies/minecolonies/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Minecolonies/minecolonies/downloads","issues_url":"https://api.github.com/repos/Minecolonies/minecolonies/issues{/number}","pulls_url":"https://api.github.com/repos/Minecolonies/minecolonies/pulls{/number}","milestones_url":"https://api.github.com/repos/Minecolonies/minecolonies/milestones{/number}","notifications_url":"https://api.github.com/repos/Minecolonies/minecolonies/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Minecolonies/minecolonies/labels{/name}","releases_url":"https://api.github.com/repos/Minecolonies/minecolonies/releases{/id}","deployments_url":"https://api.github.com/repos/Minecolonies/minecolonies/deployments","created_at":"2016-08-13T12:45:38Z","updated_at":"2018-01-30T08:48:36Z","pushed_at":"2018-02-01T14:13:08Z","git_url":"git://github.com/Minecolonies/minecolonies.git","ssh_url":"git@github.com:Minecolonies/minecolonies.git","clone_url":"https://github.com/Minecolonies/minecolonies.git","svn_url":"https://github.com/Minecolonies/minecolonies","homepage":"http://minecolonies.com/","size":39193,"stargazers_count":74,"watchers_count":74,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":65,"mirror_url":null,"archived":false,"open_issues_count":126,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":65,"open_issues":126,"watchers":74,"default_branch":"version/1.12"}},"base":{"label":"Minecolonies:version/1.12","ref":"version/1.12","sha":"930d47607cba46cd23dc5af6415bc265cd682a59","user":{"login":"Minecolonies","id":5167336,"avatar_url":"https://avatars3.githubusercontent.com/u/5167336?v=4","gravatar_id":"","url":"https://api.github.com/users/Minecolonies","html_url":"https://github.com/Minecolonies","followers_url":"https://api.github.com/users/Minecolonies/followers","following_url":"https://api.github.com/users/Minecolonies/following{/other_user}","gists_url":"https://api.github.com/users/Minecolonies/gists{/gist_id}","starred_url":"https://api.github.com/users/Minecolonies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Minecolonies/subscriptions","organizations_url":"https://api.github.com/users/Minecolonies/orgs","repos_url":"https://api.github.com/users/Minecolonies/repos","events_url":"https://api.github.com/users/Minecolonies/events{/privacy}","received_events_url":"https://api.github.com/users/Minecolonies/received_events","type":"Organization","site_admin":false},"repo":{"id":65616760,"name":"minecolonies","full_name":"Minecolonies/minecolonies","owner":{"login":"Minecolonies","id":5167336,"avatar_url":"https://avatars3.githubusercontent.com/u/5167336?v=4","gravatar_id":"","url":"https://api.github.com/users/Minecolonies","html_url":"https://github.com/Minecolonies","followers_url":"https://api.github.com/users/Minecolonies/followers","following_url":"https://api.github.com/users/Minecolonies/following{/other_user}","gists_url":"https://api.github.com/users/Minecolonies/gists{/gist_id}","starred_url":"https://api.github.com/users/Minecolonies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Minecolonies/subscriptions","organizations_url":"https://api.github.com/users/Minecolonies/orgs","repos_url":"https://api.github.com/users/Minecolonies/repos","events_url":"https://api.github.com/users/Minecolonies/events{/privacy}","received_events_url":"https://api.github.com/users/Minecolonies/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Minecolonies/minecolonies","description":"Minecolonies minecraft mod","fork":false,"url":"https://api.github.com/repos/Minecolonies/minecolonies","forks_url":"https://api.github.com/repos/Minecolonies/minecolonies/forks","keys_url":"https://api.github.com/repos/Minecolonies/minecolonies/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Minecolonies/minecolonies/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Minecolonies/minecolonies/teams","hooks_url":"https://api.github.com/repos/Minecolonies/minecolonies/hooks","issue_events_url":"https://api.github.com/repos/Minecolonies/minecolonies/issues/events{/number}","events_url":"https://api.github.com/repos/Minecolonies/minecolonies/events","assignees_url":"https://api.github.com/repos/Minecolonies/minecolonies/assignees{/user}","branches_url":"https://api.github.com/repos/Minecolonies/minecolonies/branches{/branch}","tags_url":"https://api.github.com/repos/Minecolonies/minecolonies/tags","blobs_url":"https://api.github.com/repos/Minecolonies/minecolonies/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Minecolonies/minecolonies/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Minecolonies/minecolonies/git/refs{/sha}","trees_url":"https://api.github.com/repos/Minecolonies/minecolonies/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Minecolonies/minecolonies/statuses/{sha}","languages_url":"https://api.github.com/repos/Minecolonies/minecolonies/languages","stargazers_url":"https://api.github.com/repos/Minecolonies/minecolonies/stargazers","contributors_url":"https://api.github.com/repos/Minecolonies/minecolonies/contributors","subscribers_url":"https://api.github.com/repos/Minecolonies/minecolonies/subscribers","subscription_url":"https://api.github.com/repos/Minecolonies/minecolonies/subscription","commits_url":"https://api.github.com/repos/Minecolonies/minecolonies/commits{/sha}","git_commits_url":"https://api.github.com/repos/Minecolonies/minecolonies/git/commits{/sha}","comments_url":"https://api.github.com/repos/Minecolonies/minecolonies/comments{/number}","issue_comment_url":"https://api.github.com/repos/Minecolonies/minecolonies/issues/comments{/number}","contents_url":"https://api.github.com/repos/Minecolonies/minecolonies/contents/{+path}","compare_url":"https://api.github.com/repos/Minecolonies/minecolonies/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Minecolonies/minecolonies/merges","archive_url":"https://api.github.com/repos/Minecolonies/minecolonies/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Minecolonies/minecolonies/downloads","issues_url":"https://api.github.com/repos/Minecolonies/minecolonies/issues{/number}","pulls_url":"https://api.github.com/repos/Minecolonies/minecolonies/pulls{/number}","milestones_url":"https://api.github.com/repos/Minecolonies/minecolonies/milestones{/number}","notifications_url":"https://api.github.com/repos/Minecolonies/minecolonies/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Minecolonies/minecolonies/labels{/name}","releases_url":"https://api.github.com/repos/Minecolonies/minecolonies/releases{/id}","deployments_url":"https://api.github.com/repos/Minecolonies/minecolonies/deployments","created_at":"2016-08-13T12:45:38Z","updated_at":"2018-01-30T08:48:36Z","pushed_at":"2018-02-01T14:13:08Z","git_url":"git://github.com/Minecolonies/minecolonies.git","ssh_url":"git@github.com:Minecolonies/minecolonies.git","clone_url":"https://github.com/Minecolonies/minecolonies.git","svn_url":"https://github.com/Minecolonies/minecolonies","homepage":"http://minecolonies.com/","size":39193,"stargazers_count":74,"watchers_count":74,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":65,"mirror_url":null,"archived":false,"open_issues_count":126,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":65,"open_issues":126,"watchers":74,"default_branch":"version/1.12"}},"_links":{"self":{"href":"https://api.github.com/repos/Minecolonies/minecolonies/pulls/2130"},"html":{"href":"https://github.com/Minecolonies/minecolonies/pull/2130"},"issue":{"href":"https://api.github.com/repos/Minecolonies/minecolonies/issues/2130"},"comments":{"href":"https://api.github.com/repos/Minecolonies/minecolonies/issues/2130/comments"},"review_comments":{"href":"https://api.github.com/repos/Minecolonies/minecolonies/pulls/2130/comments"},"review_comment":{"href":"https://api.github.com/repos/Minecolonies/minecolonies/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Minecolonies/minecolonies/pulls/2130/commits"},"statuses":{"href":"https://api.github.com/repos/Minecolonies/minecolonies/statuses/d4a5debd53768a261b8ff9392454aed1e877db4e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"codacy-bot"}}