{"action":"created","comment":{"url":"https://api.github.com/repos/prism/Bedrock/pulls/comments/59467901","id":59467901,"diff_hunk":"@@ -36,16 +39,28 @@ public void onPlayerQuit(final ClientConnectionEvent.Disconnect event) {\n             return;\n         }\n \n+        Player player = event.getTargetEntity();\n+\n+        // Is disconnect message enabled?\n+        if (Bedrock.getConfig().getNode(\"joinLeaveMessages\", \"leave\", \"overrideEnabled\").getBoolean()) {\n+            String serializedDisconnectMessage = Bedrock.getConfig().getNode(\"joinLeaveMessages\", \"leave\", \"message\").getString();\n+\n+            Text disconnectMessage = TextSerializers.formattingCode('&').deserialize(String.format(serializedDisconnectMessage, player.getName()));","path":"src/main/java/com/helion3/bedrock/listeners/DisconnectListener.java","position":22,"original_position":22,"commit_id":"01dfb82ac6b704fdee3c95c147169cab74d49649","original_commit_id":"01dfb82ac6b704fdee3c95c147169cab74d49649","user":{"login":"viveleroi","id":70734,"avatar_url":"https://avatars.githubusercontent.com/u/70734?v=3","gravatar_id":"","url":"https://api.github.com/users/viveleroi","html_url":"https://github.com/viveleroi","followers_url":"https://api.github.com/users/viveleroi/followers","following_url":"https://api.github.com/users/viveleroi/following{/other_user}","gists_url":"https://api.github.com/users/viveleroi/gists{/gist_id}","starred_url":"https://api.github.com/users/viveleroi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viveleroi/subscriptions","organizations_url":"https://api.github.com/users/viveleroi/orgs","repos_url":"https://api.github.com/users/viveleroi/repos","events_url":"https://api.github.com/users/viveleroi/events{/privacy}","received_events_url":"https://api.github.com/users/viveleroi/received_events","type":"User","site_admin":false},"body":"You can move the variable to the top of the class block:\r\n\r\n    private final Text disconnectMessage;\r\n\r\nand inside the class constructor, set it:\r\n\r\n```\r\npublic DisconnectListener() {\r\n    String message = Bedrock.getConfig().getNode(\"joinLeaveMessages\", \"leave\", \"message\").getString();\r\n    disconnectMessage = TextSerializers.formattingCode('&').deserialize(message));\r\n}\r\n```\r\n\r\nThis way `disconnectMessage` is available each time the listener is called, but it's only deserialized once.\r\n\r\n    event.setMessage(String.format(disconnectMessage, player.getName()));","created_at":"2016-04-12T22:50:34Z","updated_at":"2016-04-12T22:50:34Z","html_url":"https://github.com/prism/Bedrock/pull/82#discussion_r59467901","pull_request_url":"https://api.github.com/repos/prism/Bedrock/pulls/82","_links":{"self":{"href":"https://api.github.com/repos/prism/Bedrock/pulls/comments/59467901"},"html":{"href":"https://github.com/prism/Bedrock/pull/82#discussion_r59467901"},"pull_request":{"href":"https://api.github.com/repos/prism/Bedrock/pulls/82"}}},"pull_request":{"url":"https://api.github.com/repos/prism/Bedrock/pulls/82","id":65903631,"html_url":"https://github.com/prism/Bedrock/pull/82","diff_url":"https://github.com/prism/Bedrock/pull/82.diff","patch_url":"https://github.com/prism/Bedrock/pull/82.patch","issue_url":"https://api.github.com/repos/prism/Bedrock/issues/82","number":82,"state":"open","locked":false,"title":"Adds the ability to customize the first join, join, and disconnect messages","user":{"login":"Meronat","id":18372958,"avatar_url":"https://avatars.githubusercontent.com/u/18372958?v=3","gravatar_id":"","url":"https://api.github.com/users/Meronat","html_url":"https://github.com/Meronat","followers_url":"https://api.github.com/users/Meronat/followers","following_url":"https://api.github.com/users/Meronat/following{/other_user}","gists_url":"https://api.github.com/users/Meronat/gists{/gist_id}","starred_url":"https://api.github.com/users/Meronat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Meronat/subscriptions","organizations_url":"https://api.github.com/users/Meronat/orgs","repos_url":"https://api.github.com/users/Meronat/repos","events_url":"https://api.github.com/users/Meronat/events{/privacy}","received_events_url":"https://api.github.com/users/Meronat/received_events","type":"User","site_admin":false},"body":"Adds the ability to disable or enable the welcome message and set the server name yourself including color codes by an ampersand in the bedrock configuration file.","created_at":"2016-04-10T07:38:11Z","updated_at":"2016-04-12T22:50:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"92971f23f44dcfaeddd1a3e367b0ffa0acb5d3ba","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/prism/Bedrock/pulls/82/commits","review_comments_url":"https://api.github.com/repos/prism/Bedrock/pulls/82/comments","review_comment_url":"https://api.github.com/repos/prism/Bedrock/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prism/Bedrock/issues/82/comments","statuses_url":"https://api.github.com/repos/prism/Bedrock/statuses/01dfb82ac6b704fdee3c95c147169cab74d49649","head":{"label":"Meronat:CustomizeWelcomeMessage","ref":"CustomizeWelcomeMessage","sha":"01dfb82ac6b704fdee3c95c147169cab74d49649","user":{"login":"Meronat","id":18372958,"avatar_url":"https://avatars.githubusercontent.com/u/18372958?v=3","gravatar_id":"","url":"https://api.github.com/users/Meronat","html_url":"https://github.com/Meronat","followers_url":"https://api.github.com/users/Meronat/followers","following_url":"https://api.github.com/users/Meronat/following{/other_user}","gists_url":"https://api.github.com/users/Meronat/gists{/gist_id}","starred_url":"https://api.github.com/users/Meronat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Meronat/subscriptions","organizations_url":"https://api.github.com/users/Meronat/orgs","repos_url":"https://api.github.com/users/Meronat/repos","events_url":"https://api.github.com/users/Meronat/events{/privacy}","received_events_url":"https://api.github.com/users/Meronat/received_events","type":"User","site_admin":false},"repo":{"id":55882321,"name":"Bedrock","full_name":"Meronat/Bedrock","owner":{"login":"Meronat","id":18372958,"avatar_url":"https://avatars.githubusercontent.com/u/18372958?v=3","gravatar_id":"","url":"https://api.github.com/users/Meronat","html_url":"https://github.com/Meronat","followers_url":"https://api.github.com/users/Meronat/followers","following_url":"https://api.github.com/users/Meronat/following{/other_user}","gists_url":"https://api.github.com/users/Meronat/gists{/gist_id}","starred_url":"https://api.github.com/users/Meronat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Meronat/subscriptions","organizations_url":"https://api.github.com/users/Meronat/orgs","repos_url":"https://api.github.com/users/Meronat/repos","events_url":"https://api.github.com/users/Meronat/events{/privacy}","received_events_url":"https://api.github.com/users/Meronat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Meronat/Bedrock","description":"The foundation of every server! Essential commands for Sponge-based servers.","fork":true,"url":"https://api.github.com/repos/Meronat/Bedrock","forks_url":"https://api.github.com/repos/Meronat/Bedrock/forks","keys_url":"https://api.github.com/repos/Meronat/Bedrock/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Meronat/Bedrock/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Meronat/Bedrock/teams","hooks_url":"https://api.github.com/repos/Meronat/Bedrock/hooks","issue_events_url":"https://api.github.com/repos/Meronat/Bedrock/issues/events{/number}","events_url":"https://api.github.com/repos/Meronat/Bedrock/events","assignees_url":"https://api.github.com/repos/Meronat/Bedrock/assignees{/user}","branches_url":"https://api.github.com/repos/Meronat/Bedrock/branches{/branch}","tags_url":"https://api.github.com/repos/Meronat/Bedrock/tags","blobs_url":"https://api.github.com/repos/Meronat/Bedrock/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Meronat/Bedrock/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Meronat/Bedrock/git/refs{/sha}","trees_url":"https://api.github.com/repos/Meronat/Bedrock/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Meronat/Bedrock/statuses/{sha}","languages_url":"https://api.github.com/repos/Meronat/Bedrock/languages","stargazers_url":"https://api.github.com/repos/Meronat/Bedrock/stargazers","contributors_url":"https://api.github.com/repos/Meronat/Bedrock/contributors","subscribers_url":"https://api.github.com/repos/Meronat/Bedrock/subscribers","subscription_url":"https://api.github.com/repos/Meronat/Bedrock/subscription","commits_url":"https://api.github.com/repos/Meronat/Bedrock/commits{/sha}","git_commits_url":"https://api.github.com/repos/Meronat/Bedrock/git/commits{/sha}","comments_url":"https://api.github.com/repos/Meronat/Bedrock/comments{/number}","issue_comment_url":"https://api.github.com/repos/Meronat/Bedrock/issues/comments{/number}","contents_url":"https://api.github.com/repos/Meronat/Bedrock/contents/{+path}","compare_url":"https://api.github.com/repos/Meronat/Bedrock/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Meronat/Bedrock/merges","archive_url":"https://api.github.com/repos/Meronat/Bedrock/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Meronat/Bedrock/downloads","issues_url":"https://api.github.com/repos/Meronat/Bedrock/issues{/number}","pulls_url":"https://api.github.com/repos/Meronat/Bedrock/pulls{/number}","milestones_url":"https://api.github.com/repos/Meronat/Bedrock/milestones{/number}","notifications_url":"https://api.github.com/repos/Meronat/Bedrock/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Meronat/Bedrock/labels{/name}","releases_url":"https://api.github.com/repos/Meronat/Bedrock/releases{/id}","deployments_url":"https://api.github.com/repos/Meronat/Bedrock/deployments","created_at":"2016-04-10T05:23:48Z","updated_at":"2016-04-10T05:23:50Z","pushed_at":"2016-04-12T21:15:39Z","git_url":"git://github.com/Meronat/Bedrock.git","ssh_url":"git@github.com:Meronat/Bedrock.git","clone_url":"https://github.com/Meronat/Bedrock.git","svn_url":"https://github.com/Meronat/Bedrock","homepage":null,"size":173,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"prism:master","ref":"master","sha":"3a22af3190ee63edcf73ae7d12575c3ed00678cb","user":{"login":"prism","id":3801413,"avatar_url":"https://avatars.githubusercontent.com/u/3801413?v=3","gravatar_id":"","url":"https://api.github.com/users/prism","html_url":"https://github.com/prism","followers_url":"https://api.github.com/users/prism/followers","following_url":"https://api.github.com/users/prism/following{/other_user}","gists_url":"https://api.github.com/users/prism/gists{/gist_id}","starred_url":"https://api.github.com/users/prism/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prism/subscriptions","organizations_url":"https://api.github.com/users/prism/orgs","repos_url":"https://api.github.com/users/prism/repos","events_url":"https://api.github.com/users/prism/events{/privacy}","received_events_url":"https://api.github.com/users/prism/received_events","type":"Organization","site_admin":false},"repo":{"id":52168368,"name":"Bedrock","full_name":"prism/Bedrock","owner":{"login":"prism","id":3801413,"avatar_url":"https://avatars.githubusercontent.com/u/3801413?v=3","gravatar_id":"","url":"https://api.github.com/users/prism","html_url":"https://github.com/prism","followers_url":"https://api.github.com/users/prism/followers","following_url":"https://api.github.com/users/prism/following{/other_user}","gists_url":"https://api.github.com/users/prism/gists{/gist_id}","starred_url":"https://api.github.com/users/prism/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prism/subscriptions","organizations_url":"https://api.github.com/users/prism/orgs","repos_url":"https://api.github.com/users/prism/repos","events_url":"https://api.github.com/users/prism/events{/privacy}","received_events_url":"https://api.github.com/users/prism/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/prism/Bedrock","description":"The foundation of every server! Essential commands for Sponge-based servers.","fork":false,"url":"https://api.github.com/repos/prism/Bedrock","forks_url":"https://api.github.com/repos/prism/Bedrock/forks","keys_url":"https://api.github.com/repos/prism/Bedrock/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prism/Bedrock/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prism/Bedrock/teams","hooks_url":"https://api.github.com/repos/prism/Bedrock/hooks","issue_events_url":"https://api.github.com/repos/prism/Bedrock/issues/events{/number}","events_url":"https://api.github.com/repos/prism/Bedrock/events","assignees_url":"https://api.github.com/repos/prism/Bedrock/assignees{/user}","branches_url":"https://api.github.com/repos/prism/Bedrock/branches{/branch}","tags_url":"https://api.github.com/repos/prism/Bedrock/tags","blobs_url":"https://api.github.com/repos/prism/Bedrock/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prism/Bedrock/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prism/Bedrock/git/refs{/sha}","trees_url":"https://api.github.com/repos/prism/Bedrock/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prism/Bedrock/statuses/{sha}","languages_url":"https://api.github.com/repos/prism/Bedrock/languages","stargazers_url":"https://api.github.com/repos/prism/Bedrock/stargazers","contributors_url":"https://api.github.com/repos/prism/Bedrock/contributors","subscribers_url":"https://api.github.com/repos/prism/Bedrock/subscribers","subscription_url":"https://api.github.com/repos/prism/Bedrock/subscription","commits_url":"https://api.github.com/repos/prism/Bedrock/commits{/sha}","git_commits_url":"https://api.github.com/repos/prism/Bedrock/git/commits{/sha}","comments_url":"https://api.github.com/repos/prism/Bedrock/comments{/number}","issue_comment_url":"https://api.github.com/repos/prism/Bedrock/issues/comments{/number}","contents_url":"https://api.github.com/repos/prism/Bedrock/contents/{+path}","compare_url":"https://api.github.com/repos/prism/Bedrock/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prism/Bedrock/merges","archive_url":"https://api.github.com/repos/prism/Bedrock/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prism/Bedrock/downloads","issues_url":"https://api.github.com/repos/prism/Bedrock/issues{/number}","pulls_url":"https://api.github.com/repos/prism/Bedrock/pulls{/number}","milestones_url":"https://api.github.com/repos/prism/Bedrock/milestones{/number}","notifications_url":"https://api.github.com/repos/prism/Bedrock/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prism/Bedrock/labels{/name}","releases_url":"https://api.github.com/repos/prism/Bedrock/releases{/id}","deployments_url":"https://api.github.com/repos/prism/Bedrock/deployments","created_at":"2016-02-20T18:23:44Z","updated_at":"2016-04-10T07:38:27Z","pushed_at":"2016-04-12T21:15:39Z","git_url":"git://github.com/prism/Bedrock.git","ssh_url":"git@github.com:prism/Bedrock.git","clone_url":"https://github.com/prism/Bedrock.git","svn_url":"https://github.com/prism/Bedrock","homepage":null,"size":189,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":38,"forks":5,"open_issues":38,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prism/Bedrock/pulls/82"},"html":{"href":"https://github.com/prism/Bedrock/pull/82"},"issue":{"href":"https://api.github.com/repos/prism/Bedrock/issues/82"},"comments":{"href":"https://api.github.com/repos/prism/Bedrock/issues/82/comments"},"review_comments":{"href":"https://api.github.com/repos/prism/Bedrock/pulls/82/comments"},"review_comment":{"href":"https://api.github.com/repos/prism/Bedrock/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prism/Bedrock/pulls/82/commits"},"statuses":{"href":"https://api.github.com/repos/prism/Bedrock/statuses/01dfb82ac6b704fdee3c95c147169cab74d49649"}}}}