{"action":"created","comment":{"url":"https://api.github.com/repos/SpongePowered/SpongeCommon/pulls/comments/45786447","id":45786447,"diff_hunk":"@@ -0,0 +1,102 @@\n+/*\n+ * This file is part of Sponge, licensed under the MIT License (MIT).\n+ *\n+ * Copyright (c) SpongePowered <https://www.spongepowered.org>\n+ * Copyright (c) contributors\n+ *\n+ * Permission is hereby granted, free of charge, to any person obtaining a copy\n+ * of this software and associated documentation files (the \"Software\"), to deal\n+ * in the Software without restriction, including without limitation the rights\n+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n+ * copies of the Software, and to permit persons to whom the Software is\n+ * furnished to do so, subject to the following conditions:\n+ *\n+ * The above copyright notice and this permission notice shall be included in\n+ * all copies or substantial portions of the Software.\n+ *\n+ * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n+ * THE SOFTWARE.\n+ */\n+\n+package org.spongepowered.common.mixin.core.statistic;\n+\n+import com.google.common.collect.ImmutableSet;\n+import com.google.common.collect.Sets;\n+import org.spongepowered.api.statistic.Statistic;\n+import org.spongepowered.api.statistic.achievement.Achievement;\n+import org.spongepowered.api.text.Text;\n+import org.spongepowered.api.text.translation.Translation;\n+import org.spongepowered.asm.mixin.Mixin;\n+import org.spongepowered.asm.mixin.Shadow;\n+import org.spongepowered.asm.mixin.injection.At;\n+import org.spongepowered.asm.mixin.injection.Inject;\n+import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;\n+import org.spongepowered.common.interfaces.statistic.IMixinAchievement;\n+import org.spongepowered.common.text.SpongeTexts;\n+import org.spongepowered.common.text.translation.SpongeTranslation;\n+\n+import java.util.Collection;\n+import java.util.Optional;\n+import java.util.Set;\n+\n+@Mixin(net.minecraft.stats.Achievement.class)\n+public abstract class MixinAchievement extends MixinStatBase implements IMixinAchievement {\n+\n+    @Shadow private String achievementDescription;\n+    @Shadow public net.minecraft.stats.Achievement parentAchievement;\n+\n+    private Set<Achievement> childAchievements = Sets.newLinkedHashSet();","path":"src/main/java/org/spongepowered/common/mixin/core/statistic/MixinAchievement.java","position":53,"original_position":53,"commit_id":"f281f24e9c32128a715ed7801d84e8b38a0ab411","original_commit_id":"f281f24e9c32128a715ed7801d84e8b38a0ab411","user":{"login":"Deamon5550","id":1249030,"avatar_url":"https://avatars.githubusercontent.com/u/1249030?v=3","gravatar_id":"","url":"https://api.github.com/users/Deamon5550","html_url":"https://github.com/Deamon5550","followers_url":"https://api.github.com/users/Deamon5550/followers","following_url":"https://api.github.com/users/Deamon5550/following{/other_user}","gists_url":"https://api.github.com/users/Deamon5550/gists{/gist_id}","starred_url":"https://api.github.com/users/Deamon5550/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Deamon5550/subscriptions","organizations_url":"https://api.github.com/users/Deamon5550/orgs","repos_url":"https://api.github.com/users/Deamon5550/repos","events_url":"https://api.github.com/users/Deamon5550/events{/privacy}","received_events_url":"https://api.github.com/users/Deamon5550/received_events","type":"User","site_admin":false},"body":"This set is not immutable, but then is changed to be immutable as soon as a child is added?","created_at":"2015-11-24T19:59:20Z","updated_at":"2015-11-24T19:59:20Z","html_url":"https://github.com/SpongePowered/SpongeCommon/pull/131#discussion_r45786447","pull_request_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/pulls/131","_links":{"self":{"href":"https://api.github.com/repos/SpongePowered/SpongeCommon/pulls/comments/45786447"},"html":{"href":"https://github.com/SpongePowered/SpongeCommon/pull/131#discussion_r45786447"},"pull_request":{"href":"https://api.github.com/repos/SpongePowered/SpongeCommon/pulls/131"}}},"pull_request":{"url":"https://api.github.com/repos/SpongePowered/SpongeCommon/pulls/131","id":42535189,"html_url":"https://github.com/SpongePowered/SpongeCommon/pull/131","diff_url":"https://github.com/SpongePowered/SpongeCommon/pull/131.diff","patch_url":"https://github.com/SpongePowered/SpongeCommon/pull/131.patch","issue_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/issues/131","number":131,"state":"open","locked":false,"title":"Implement Statistics","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":"Implement the Achievement + Statistic API as specified in the [API](https://github.com/SpongePowered/SpongeAPI/tree/master/src/main/java/org/spongepowered/api/statistic).\r\nImplement the DataAPI connectors.\r\n\r\n**Tasks**\r\n- [x] `Statistic`\r\n  - `BlockStatistic` - TBD - nothing similar in the server (class wise)\r\n  - `EntityStatistic` - TBD - nothing similar in the server (class wise)\r\n  - `ItemStatistic` -TBD - nothing similar in the server (class wise)\r\n  - ~~`TeamStatistic`~~ - Does not exist at all (Only as Objective)\r\n- [x] `Statistics` (Almost ~ Minecraft compile time dependency too old (1.8 < 1.8.4))\r\n- [x] `StatisticFormat`\r\n- [x] `StatisticFormats`\r\n- [x] `StatisticGroup`\r\n- [x] `StatisticGroups`\r\n- [x] `StatisticData`\r\n- [x] Call `StatisticChangeEvent`\r\n- [x] `Achievement`\r\n- [x] `Achievements`\r\n- [x] `AchievementData`\r\n- [x] Call `AchievementEvent`\r\n- [x] Create TestPlugin\r\n\r\n**TestPlugin**\r\n[Plugin.jar](https://dl.dropboxusercontent.com/u/16999313/Sponge/Statistics.jar)\r\n[Plugin Sources](https://dl.dropboxusercontent.com/u/16999313/Sponge/Statistics.zip)\r\n\r\nCommands:\r\n* `/statisticdata`\r\n* `/statistics`\r\n* `/statisticgroups`\r\n* `/statisticformats`\r\n* `/achievementdata`\r\n* `/achievements`\r\n\r\n**TBD**\r\nThe `___Statistic`s have no counterpart on the server, \r\n* so we either remove them (as interfaces), but keep the gameregistry methods related to them. \r\n* Or we use wrapper classes instead of mixins.\r\n* Or we create those counterparts and redirect constructor calls.\r\n\r\nWhich way shalll I/we go?","created_at":"2015-08-16T11:43:46Z","updated_at":"2015-11-24T19:59:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc33ef2ab0f3c1f705403e01f51358c2ba169a04","assignee":{"login":"Deamon5550","id":1249030,"avatar_url":"https://avatars.githubusercontent.com/u/1249030?v=3","gravatar_id":"","url":"https://api.github.com/users/Deamon5550","html_url":"https://github.com/Deamon5550","followers_url":"https://api.github.com/users/Deamon5550/followers","following_url":"https://api.github.com/users/Deamon5550/following{/other_user}","gists_url":"https://api.github.com/users/Deamon5550/gists{/gist_id}","starred_url":"https://api.github.com/users/Deamon5550/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Deamon5550/subscriptions","organizations_url":"https://api.github.com/users/Deamon5550/orgs","repos_url":"https://api.github.com/users/Deamon5550/repos","events_url":"https://api.github.com/users/Deamon5550/events{/privacy}","received_events_url":"https://api.github.com/users/Deamon5550/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/pulls/131/commits","review_comments_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/pulls/131/comments","review_comment_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/issues/131/comments","statuses_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/statuses/f281f24e9c32128a715ed7801d84e8b38a0ab411","head":{"label":"ST-DDT:Statistics","ref":"Statistics","sha":"f281f24e9c32128a715ed7801d84e8b38a0ab411","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":36528587,"name":"SpongeCommon","full_name":"ST-DDT/SpongeCommon","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/SpongeCommon","description":"Shared code between Sponge and SpongeVanilla","fork":true,"url":"https://api.github.com/repos/ST-DDT/SpongeCommon","forks_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/forks","keys_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/teams","hooks_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/hooks","issue_events_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/issues/events{/number}","events_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/events","assignees_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/assignees{/user}","branches_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/branches{/branch}","tags_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/tags","blobs_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/git/refs{/sha}","trees_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/statuses/{sha}","languages_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/languages","stargazers_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/stargazers","contributors_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/contributors","subscribers_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/subscribers","subscription_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/subscription","commits_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/commits{/sha}","git_commits_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/git/commits{/sha}","comments_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/comments{/number}","issue_comment_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/issues/comments{/number}","contents_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/contents/{+path}","compare_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/merges","archive_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/downloads","issues_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/issues{/number}","pulls_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/pulls{/number}","milestones_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/milestones{/number}","notifications_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/labels{/name}","releases_url":"https://api.github.com/repos/ST-DDT/SpongeCommon/releases{/id}","created_at":"2015-05-29T20:54:56Z","updated_at":"2015-05-29T20:54:58Z","pushed_at":"2015-11-22T17:02:41Z","git_url":"git://github.com/ST-DDT/SpongeCommon.git","ssh_url":"git@github.com:ST-DDT/SpongeCommon.git","clone_url":"https://github.com/ST-DDT/SpongeCommon.git","svn_url":"https://github.com/ST-DDT/SpongeCommon","homepage":null,"size":5316,"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:master","ref":"master","sha":"661ffacaca2c4c37c67cecb4d09bab492fc7f16e","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":33791453,"name":"SpongeCommon","full_name":"SpongePowered/SpongeCommon","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/SpongeCommon","description":"Shared code between SpongeForge and SpongeVanilla","fork":false,"url":"https://api.github.com/repos/SpongePowered/SpongeCommon","forks_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/forks","keys_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/teams","hooks_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/hooks","issue_events_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/issues/events{/number}","events_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/events","assignees_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/assignees{/user}","branches_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/branches{/branch}","tags_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/tags","blobs_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/git/refs{/sha}","trees_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/statuses/{sha}","languages_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/languages","stargazers_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/stargazers","contributors_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/contributors","subscribers_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/subscribers","subscription_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/subscription","commits_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/commits{/sha}","git_commits_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/git/commits{/sha}","comments_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/comments{/number}","issue_comment_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/issues/comments{/number}","contents_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/contents/{+path}","compare_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/merges","archive_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/downloads","issues_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/issues{/number}","pulls_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/pulls{/number}","milestones_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/milestones{/number}","notifications_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/labels{/name}","releases_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/releases{/id}","created_at":"2015-04-11T20:38:48Z","updated_at":"2015-11-21T08:28:44Z","pushed_at":"2015-11-24T19:19:32Z","git_url":"git://github.com/SpongePowered/SpongeCommon.git","ssh_url":"git@github.com:SpongePowered/SpongeCommon.git","clone_url":"https://github.com/SpongePowered/SpongeCommon.git","svn_url":"https://github.com/SpongePowered/SpongeCommon","homepage":"","size":9150,"stargazers_count":52,"watchers_count":52,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":56,"mirror_url":null,"open_issues_count":49,"forks":56,"open_issues":49,"watchers":52,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SpongePowered/SpongeCommon/pulls/131"},"html":{"href":"https://github.com/SpongePowered/SpongeCommon/pull/131"},"issue":{"href":"https://api.github.com/repos/SpongePowered/SpongeCommon/issues/131"},"comments":{"href":"https://api.github.com/repos/SpongePowered/SpongeCommon/issues/131/comments"},"review_comments":{"href":"https://api.github.com/repos/SpongePowered/SpongeCommon/pulls/131/comments"},"review_comment":{"href":"https://api.github.com/repos/SpongePowered/SpongeCommon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SpongePowered/SpongeCommon/pulls/131/commits"},"statuses":{"href":"https://api.github.com/repos/SpongePowered/SpongeCommon/statuses/f281f24e9c32128a715ed7801d84e8b38a0ab411"}}}}