{"action":"closed","number":500,"pull_request":{"url":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/500","id":31181539,"html_url":"https://github.com/SpongePowered/SpongeAPI/pull/500","diff_url":"https://github.com/SpongePowered/SpongeAPI/pull/500.diff","patch_url":"https://github.com/SpongePowered/SpongeAPI/pull/500.patch","issue_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/500","number":500,"state":"closed","locked":false,"title":"Fix StatisticGroups","user":{"login":"ST-DDT","id":1579362,"avatar_url":"https://avatars.githubusercontent.com/u/1579362?v=3","gravatar_id":"","url":"https://api.github.com/users/ST-DDT","html_url":"https://github.com/ST-DDT","followers_url":"https://api.github.com/users/ST-DDT/followers","following_url":"https://api.github.com/users/ST-DDT/following{/other_user}","gists_url":"https://api.github.com/users/ST-DDT/gists{/gist_id}","starred_url":"https://api.github.com/users/ST-DDT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ST-DDT/subscriptions","organizations_url":"https://api.github.com/users/ST-DDT/orgs","repos_url":"https://api.github.com/users/ST-DDT/repos","events_url":"https://api.github.com/users/ST-DDT/events{/privacy}","received_events_url":"https://api.github.com/users/ST-DDT/received_events","type":"User","site_admin":false},"body":"FIxes #220\r\n\r\nThe currently suggested `StatisticGroup` layout has some serious disadvantages.\r\n\r\nIn minecraft there are no groups, but they are quite useful if defined properly.\r\n\r\nThe old suggestion defines the usage something similar to this:\r\n````java\r\nMap<Statistic, Long> stats = player.getStatisticsByGroup(group);\r\nfor (Entry entry : stats) {\r\n    Statistic stat = entry.getKey();\r\n    player.sendMessage(asText(stat) + stat.getFormat().or(group.getDefaultFormat()).format(entry.getValue());\r\n}\r\n````\r\nI considers this malicious and error prone.\r\nSo i want to change this to simplyfy the process:\r\n````java\r\nMap<Statistic, Long> stats = player.getStatisticsByGroup(group);\r\nStatisticFormat formatter = group.getFormat();\r\nfor (Entry entry : stats) {\r\n    Statistic stat = entry.getKey();\r\n    player.sendMessage(asText(stat) + formatter.format(entry.getValue());\r\n}\r\n````\r\n\r\nSo basically every statistic group defines a fix format all members use. There are no exceptions from that rule. This also allows a more useful displaying because different categories are not merged randomly.\r\n(First show the general_count, that general_fractional, then the distances, than times spend, or however you want it)\r\n\r\nThis PR removes the format from the statistic and splits the general group into smaller pieces to ensure that each group only contains stazs with the same format.\r\n\r\n\r\nAs an alternative there are 2 other ways that can be used independently from each other.\r\n- Remove only the Optional from `Statistic.getFormat()`\r\n  -  Because in minecraft every statistic has its own reference to a formatter\r\n- Remove the general group\r\n  - Because the group has nothing in common except that they don't have anything in common","created_at":"2015-03-14T10:29:00Z","updated_at":"2015-03-15T00:19:10Z","closed_at":"2015-03-15T00:19:10Z","merged_at":null,"merge_commit_sha":"6a9e37ec6e8cf7012e05d33af47ff6920c175f1f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/500/commits","review_comments_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/500/comments","review_comment_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/500/comments","statuses_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/statuses/883da307e568dd983d4c9c16173970945d58b69c","head":{"label":"ST-DDT:feature/statsFix","ref":"feature/statsFix","sha":"883da307e568dd983d4c9c16173970945d58b69c","user":{"login":"ST-DDT","id":1579362,"avatar_url":"https://avatars.githubusercontent.com/u/1579362?v=3","gravatar_id":"","url":"https://api.github.com/users/ST-DDT","html_url":"https://github.com/ST-DDT","followers_url":"https://api.github.com/users/ST-DDT/followers","following_url":"https://api.github.com/users/ST-DDT/following{/other_user}","gists_url":"https://api.github.com/users/ST-DDT/gists{/gist_id}","starred_url":"https://api.github.com/users/ST-DDT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ST-DDT/subscriptions","organizations_url":"https://api.github.com/users/ST-DDT/orgs","repos_url":"https://api.github.com/users/ST-DDT/repos","events_url":"https://api.github.com/users/ST-DDT/events{/privacy}","received_events_url":"https://api.github.com/users/ST-DDT/received_events","type":"User","site_admin":false},"repo":{"id":23807335,"name":"SpongeAPI","full_name":"ST-DDT/SpongeAPI","owner":{"login":"ST-DDT","id":1579362,"avatar_url":"https://avatars.githubusercontent.com/u/1579362?v=3","gravatar_id":"","url":"https://api.github.com/users/ST-DDT","html_url":"https://github.com/ST-DDT","followers_url":"https://api.github.com/users/ST-DDT/followers","following_url":"https://api.github.com/users/ST-DDT/following{/other_user}","gists_url":"https://api.github.com/users/ST-DDT/gists{/gist_id}","starred_url":"https://api.github.com/users/ST-DDT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ST-DDT/subscriptions","organizations_url":"https://api.github.com/users/ST-DDT/orgs","repos_url":"https://api.github.com/users/ST-DDT/repos","events_url":"https://api.github.com/users/ST-DDT/events{/privacy}","received_events_url":"https://api.github.com/users/ST-DDT/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ST-DDT/SpongeAPI","description":"A Minecraft plugin API (not including an implementation)","fork":true,"url":"https://api.github.com/repos/ST-DDT/SpongeAPI","forks_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/forks","keys_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/teams","hooks_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/hooks","issue_events_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/issues/events{/number}","events_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/events","assignees_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/assignees{/user}","branches_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/branches{/branch}","tags_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/tags","blobs_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/git/refs{/sha}","trees_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/statuses/{sha}","languages_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/languages","stargazers_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/stargazers","contributors_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/contributors","subscribers_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/subscribers","subscription_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/subscription","commits_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/commits{/sha}","git_commits_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/git/commits{/sha}","comments_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/comments{/number}","issue_comment_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/issues/comments{/number}","contents_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/contents/{+path}","compare_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/merges","archive_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/downloads","issues_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/issues{/number}","pulls_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/pulls{/number}","milestones_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/milestones{/number}","notifications_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/labels{/name}","releases_url":"https://api.github.com/repos/ST-DDT/SpongeAPI/releases{/id}","created_at":"2014-09-08T20:37:00Z","updated_at":"2015-03-02T21:01:53Z","pushed_at":"2015-03-14T10:25:50Z","git_url":"git://github.com/ST-DDT/SpongeAPI.git","ssh_url":"git@github.com:ST-DDT/SpongeAPI.git","clone_url":"https://github.com/ST-DDT/SpongeAPI.git","svn_url":"https://github.com/ST-DDT/SpongeAPI","homepage":"http://www.spongepowered.org/","size":2691,"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":"SpongePowered:feature/stats","ref":"feature/stats","sha":"b865251aa94aff8af49b9db7b71af4b1495d0055","user":{"login":"SpongePowered","id":8683473,"avatar_url":"https://avatars.githubusercontent.com/u/8683473?v=3","gravatar_id":"","url":"https://api.github.com/users/SpongePowered","html_url":"https://github.com/SpongePowered","followers_url":"https://api.github.com/users/SpongePowered/followers","following_url":"https://api.github.com/users/SpongePowered/following{/other_user}","gists_url":"https://api.github.com/users/SpongePowered/gists{/gist_id}","starred_url":"https://api.github.com/users/SpongePowered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpongePowered/subscriptions","organizations_url":"https://api.github.com/users/SpongePowered/orgs","repos_url":"https://api.github.com/users/SpongePowered/repos","events_url":"https://api.github.com/users/SpongePowered/events{/privacy}","received_events_url":"https://api.github.com/users/SpongePowered/received_events","type":"Organization","site_admin":false},"repo":{"id":23770421,"name":"SpongeAPI","full_name":"SpongePowered/SpongeAPI","owner":{"login":"SpongePowered","id":8683473,"avatar_url":"https://avatars.githubusercontent.com/u/8683473?v=3","gravatar_id":"","url":"https://api.github.com/users/SpongePowered","html_url":"https://github.com/SpongePowered","followers_url":"https://api.github.com/users/SpongePowered/followers","following_url":"https://api.github.com/users/SpongePowered/following{/other_user}","gists_url":"https://api.github.com/users/SpongePowered/gists{/gist_id}","starred_url":"https://api.github.com/users/SpongePowered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpongePowered/subscriptions","organizations_url":"https://api.github.com/users/SpongePowered/orgs","repos_url":"https://api.github.com/users/SpongePowered/repos","events_url":"https://api.github.com/users/SpongePowered/events{/privacy}","received_events_url":"https://api.github.com/users/SpongePowered/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SpongePowered/SpongeAPI","description":"A Minecraft plugin API","fork":false,"url":"https://api.github.com/repos/SpongePowered/SpongeAPI","forks_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/forks","keys_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/teams","hooks_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/hooks","issue_events_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/events{/number}","events_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/events","assignees_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/assignees{/user}","branches_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/branches{/branch}","tags_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/tags","blobs_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/git/refs{/sha}","trees_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/statuses/{sha}","languages_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/languages","stargazers_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/stargazers","contributors_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/contributors","subscribers_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/subscribers","subscription_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/subscription","commits_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/commits{/sha}","git_commits_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/git/commits{/sha}","comments_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/comments{/number}","issue_comment_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/comments{/number}","contents_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/contents/{+path}","compare_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/merges","archive_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/downloads","issues_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues{/number}","pulls_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls{/number}","milestones_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/milestones{/number}","notifications_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/labels{/name}","releases_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/releases{/id}","created_at":"2014-09-07T20:39:25Z","updated_at":"2015-03-14T22:58:28Z","pushed_at":"2015-03-14T19:42:08Z","git_url":"git://github.com/SpongePowered/SpongeAPI.git","ssh_url":"git@github.com:SpongePowered/SpongeAPI.git","clone_url":"https://github.com/SpongePowered/SpongeAPI.git","svn_url":"https://github.com/SpongePowered/SpongeAPI","homepage":"http://www.spongepowered.org/","size":17337,"stargazers_count":745,"watchers_count":745,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":333,"mirror_url":null,"open_issues_count":53,"forks":333,"open_issues":53,"watchers":745,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/500"},"html":{"href":"https://github.com/SpongePowered/SpongeAPI/pull/500"},"issue":{"href":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/500"},"comments":{"href":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/500/comments"},"review_comments":{"href":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/500/comments"},"review_comment":{"href":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SpongePowered/SpongeAPI/pulls/500/commits"},"statuses":{"href":"https://api.github.com/repos/SpongePowered/SpongeAPI/statuses/883da307e568dd983d4c9c16173970945d58b69c"}},"merged":false,"mergeable":true,"mergeable_state":"unstable","merged_by":null,"comments":2,"review_comments":0,"commits":1,"additions":27,"deletions":30,"changed_files":5}}