{"action":"created","comment":{"url":"https://api.github.com/repos/SpongePowered/SpongeCommon/pulls/comments/43436375","id":43436375,"diff_hunk":"@@ -0,0 +1,95 @@\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+package org.spongepowered.common.data.processor.data;\n+\n+import java.awt.Color;\n+import java.util.Optional;\n+\n+import org.spongepowered.api.data.DataHolder;\n+import org.spongepowered.api.data.DataTransactionBuilder;\n+import org.spongepowered.api.data.DataTransactionResult;\n+import org.spongepowered.api.data.key.Keys;\n+import org.spongepowered.api.data.manipulator.immutable.ImmutableColoredData;\n+import org.spongepowered.api.data.manipulator.mutable.ColoredData;\n+import org.spongepowered.api.data.value.immutable.ImmutableValue;\n+import org.spongepowered.api.data.value.mutable.Value;\n+import org.spongepowered.common.Sponge;\n+import org.spongepowered.common.data.manipulator.mutable.SpongeColoredData;\n+import org.spongepowered.common.data.processor.common.AbstractItemSingleDataProcessor;\n+import org.spongepowered.common.data.util.NbtDataUtil;\n+import org.spongepowered.common.data.value.immutable.ImmutableSpongeValue;\n+import org.spongepowered.common.util.ColorUtil;\n+\n+import net.minecraft.item.ItemStack;\n+\n+public class ColoredDataProcessor extends AbstractItemSingleDataProcessor<Color, Value<Color>, ColoredData, ImmutableColoredData> {\n+\n+    public ColoredDataProcessor() {\n+        super(stack -> ColorUtil.getItemStackColor(stack).isPresent(), Keys.COLOR);","path":"src/main/java/org/spongepowered/common/data/processor/data/ColoredDataProcessor.java","position":50,"original_position":50,"commit_id":"373517c538281da07ea6e86d6e8bc83102e3d3ba","original_commit_id":"373517c538281da07ea6e86d6e8bc83102e3d3ba","user":{"login":"gabizou","id":1203877,"avatar_url":"https://avatars.githubusercontent.com/u/1203877?v=3","gravatar_id":"","url":"https://api.github.com/users/gabizou","html_url":"https://github.com/gabizou","followers_url":"https://api.github.com/users/gabizou/followers","following_url":"https://api.github.com/users/gabizou/following{/other_user}","gists_url":"https://api.github.com/users/gabizou/gists{/gist_id}","starred_url":"https://api.github.com/users/gabizou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabizou/subscriptions","organizations_url":"https://api.github.com/users/gabizou/orgs","repos_url":"https://api.github.com/users/gabizou/repos","events_url":"https://api.github.com/users/gabizou/events{/privacy}","received_events_url":"https://api.github.com/users/gabizou/received_events","type":"User","site_admin":false},"body":"Why not just have the util check that it supports color instead of trying to get the color twice?","created_at":"2015-10-29T19:58:47Z","updated_at":"2015-10-29T19:58:47Z","html_url":"https://github.com/SpongePowered/SpongeCommon/pull/213#discussion_r43436375","pull_request_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/pulls/213","_links":{"self":{"href":"https://api.github.com/repos/SpongePowered/SpongeCommon/pulls/comments/43436375"},"html":{"href":"https://github.com/SpongePowered/SpongeCommon/pull/213#discussion_r43436375"},"pull_request":{"href":"https://api.github.com/repos/SpongePowered/SpongeCommon/pulls/213"}}},"pull_request":{"url":"https://api.github.com/repos/SpongePowered/SpongeCommon/pulls/213","id":48003148,"html_url":"https://github.com/SpongePowered/SpongeCommon/pull/213","diff_url":"https://github.com/SpongePowered/SpongeCommon/pull/213.diff","patch_url":"https://github.com/SpongePowered/SpongeCommon/pull/213.patch","issue_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/issues/213","number":213,"state":"open","locked":false,"title":"Implement ColoredData","user":{"login":"kenzierocks","id":2093023,"avatar_url":"https://avatars.githubusercontent.com/u/2093023?v=3","gravatar_id":"","url":"https://api.github.com/users/kenzierocks","html_url":"https://github.com/kenzierocks","followers_url":"https://api.github.com/users/kenzierocks/followers","following_url":"https://api.github.com/users/kenzierocks/following{/other_user}","gists_url":"https://api.github.com/users/kenzierocks/gists{/gist_id}","starred_url":"https://api.github.com/users/kenzierocks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenzierocks/subscriptions","organizations_url":"https://api.github.com/users/kenzierocks/orgs","repos_url":"https://api.github.com/users/kenzierocks/repos","events_url":"https://api.github.com/users/kenzierocks/events{/privacy}","received_events_url":"https://api.github.com/users/kenzierocks/received_events","type":"User","site_admin":false},"body":"Implementation of `SpongeColoredData`.\r\n- [x] Registration of field getters and setters\r\n- [X] Accurately used the appropriate `AbstractData` implementation\r\n\r\nImplementation of `ImmutableSpongeColoredData`\r\n- [X] Accurately extended the appropriate `AbstractImmutableData` implementation\r\n- [X] Accurately instantiating final instance fields with an `ImmutableValue` counter part for any value getters (probably? cache utils)\r\n\r\nImplementation of the `ItemColorValueProcessor`(s):\r\n- [X] Appropriately extended `AbstractSpongeValueProcessor`\r\n- [X] Individual processors for each source type possible (one for `ItemStack`/`TileEntity`/`Entity` as necessary).\r\n\r\nRegistration:\r\n- [X] Registered the `Key` correctly by `color` in the `KeyRegistry`\r\n- [X] Registered the `DataProcessor`s and `DataManipulatorBuilder` in `SpongeSerializationRegistry`\r\n- [x] Registered the `ValueProcessor`s in the `SpongeSerializationRegistry`\r\n\r\nTest Plugin code:\r\nPending completion....","created_at":"2015-10-18T06:59:28Z","updated_at":"2015-10-29T19:58:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"09a0bb56205b8652f34fb7e75f5cb9306b681c5e","assignee":{"login":"gabizou","id":1203877,"avatar_url":"https://avatars.githubusercontent.com/u/1203877?v=3","gravatar_id":"","url":"https://api.github.com/users/gabizou","html_url":"https://github.com/gabizou","followers_url":"https://api.github.com/users/gabizou/followers","following_url":"https://api.github.com/users/gabizou/following{/other_user}","gists_url":"https://api.github.com/users/gabizou/gists{/gist_id}","starred_url":"https://api.github.com/users/gabizou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabizou/subscriptions","organizations_url":"https://api.github.com/users/gabizou/orgs","repos_url":"https://api.github.com/users/gabizou/repos","events_url":"https://api.github.com/users/gabizou/events{/privacy}","received_events_url":"https://api.github.com/users/gabizou/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/pulls/213/commits","review_comments_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/pulls/213/comments","review_comment_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/issues/213/comments","statuses_url":"https://api.github.com/repos/SpongePowered/SpongeCommon/statuses/373517c538281da07ea6e86d6e8bc83102e3d3ba","head":{"label":"kenzierocks:feature/colored-data","ref":"feature/colored-data","sha":"373517c538281da07ea6e86d6e8bc83102e3d3ba","user":{"login":"kenzierocks","id":2093023,"avatar_url":"https://avatars.githubusercontent.com/u/2093023?v=3","gravatar_id":"","url":"https://api.github.com/users/kenzierocks","html_url":"https://github.com/kenzierocks","followers_url":"https://api.github.com/users/kenzierocks/followers","following_url":"https://api.github.com/users/kenzierocks/following{/other_user}","gists_url":"https://api.github.com/users/kenzierocks/gists{/gist_id}","starred_url":"https://api.github.com/users/kenzierocks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenzierocks/subscriptions","organizations_url":"https://api.github.com/users/kenzierocks/orgs","repos_url":"https://api.github.com/users/kenzierocks/repos","events_url":"https://api.github.com/users/kenzierocks/events{/privacy}","received_events_url":"https://api.github.com/users/kenzierocks/received_events","type":"User","site_admin":false},"repo":{"id":34396694,"name":"SpongeCommon","full_name":"kenzierocks/SpongeCommon","owner":{"login":"kenzierocks","id":2093023,"avatar_url":"https://avatars.githubusercontent.com/u/2093023?v=3","gravatar_id":"","url":"https://api.github.com/users/kenzierocks","html_url":"https://github.com/kenzierocks","followers_url":"https://api.github.com/users/kenzierocks/followers","following_url":"https://api.github.com/users/kenzierocks/following{/other_user}","gists_url":"https://api.github.com/users/kenzierocks/gists{/gist_id}","starred_url":"https://api.github.com/users/kenzierocks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenzierocks/subscriptions","organizations_url":"https://api.github.com/users/kenzierocks/orgs","repos_url":"https://api.github.com/users/kenzierocks/repos","events_url":"https://api.github.com/users/kenzierocks/events{/privacy}","received_events_url":"https://api.github.com/users/kenzierocks/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kenzierocks/SpongeCommon","description":"Shared code between Sponge and SpongeVanilla","fork":true,"url":"https://api.github.com/repos/kenzierocks/SpongeCommon","forks_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/forks","keys_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/teams","hooks_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/hooks","issue_events_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/issues/events{/number}","events_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/events","assignees_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/assignees{/user}","branches_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/branches{/branch}","tags_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/tags","blobs_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/git/refs{/sha}","trees_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/statuses/{sha}","languages_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/languages","stargazers_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/stargazers","contributors_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/contributors","subscribers_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/subscribers","subscription_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/subscription","commits_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/commits{/sha}","git_commits_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/git/commits{/sha}","comments_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/comments{/number}","issue_comment_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/issues/comments{/number}","contents_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/contents/{+path}","compare_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/merges","archive_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/downloads","issues_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/issues{/number}","pulls_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/pulls{/number}","milestones_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/milestones{/number}","notifications_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/labels{/name}","releases_url":"https://api.github.com/repos/kenzierocks/SpongeCommon/releases{/id}","created_at":"2015-04-22T14:54:52Z","updated_at":"2015-05-03T18:32:30Z","pushed_at":"2015-10-29T19:23:44Z","git_url":"git://github.com/kenzierocks/SpongeCommon.git","ssh_url":"git@github.com:kenzierocks/SpongeCommon.git","clone_url":"https://github.com/kenzierocks/SpongeCommon.git","svn_url":"https://github.com/kenzierocks/SpongeCommon","homepage":null,"size":3919,"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":"43c4fd1a39d2598cee683239b959201d2e40011b","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-10-27T14:12:08Z","pushed_at":"2015-10-29T19:55:22Z","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":11899,"stargazers_count":50,"watchers_count":50,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":55,"mirror_url":null,"open_issues_count":67,"forks":55,"open_issues":67,"watchers":50,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SpongePowered/SpongeCommon/pulls/213"},"html":{"href":"https://github.com/SpongePowered/SpongeCommon/pull/213"},"issue":{"href":"https://api.github.com/repos/SpongePowered/SpongeCommon/issues/213"},"comments":{"href":"https://api.github.com/repos/SpongePowered/SpongeCommon/issues/213/comments"},"review_comments":{"href":"https://api.github.com/repos/SpongePowered/SpongeCommon/pulls/213/comments"},"review_comment":{"href":"https://api.github.com/repos/SpongePowered/SpongeCommon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SpongePowered/SpongeCommon/pulls/213/commits"},"statuses":{"href":"https://api.github.com/repos/SpongePowered/SpongeCommon/statuses/373517c538281da07ea6e86d6e8bc83102e3d3ba"}}}}