{"action":"created","comment":{"url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/pulls/comments/41083412","id":41083412,"diff_hunk":"@@ -0,0 +1,159 @@\n+/*\n+ * This file is part of Applied Energistics 2.\n+ * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.\n+ *\n+ * Applied Energistics 2 is free software: you can redistribute it and/or modify\n+ * it under the terms of the GNU Lesser General Public License as published by\n+ * the Free Software Foundation, either version 3 of the License, or\n+ * (at your option) any later version.\n+ *\n+ * Applied Energistics 2 is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+ * GNU Lesser General Public License for more details.\n+ *\n+ * You should have received a copy of the GNU Lesser General Public License\n+ * along with Applied Energistics 2.  If not, see <http://www.gnu.org/licenses/lgpl>.\n+ */\n+\n+package appeng.recipes.game;\n+\n+import java.util.ArrayList;\n+import javax.annotation.Nullable;\n+\n+import net.minecraft.init.Items;\n+import net.minecraft.inventory.IInventory;\n+import net.minecraft.inventory.InventoryCrafting;\n+import net.minecraft.item.ItemStack;\n+import net.minecraft.item.crafting.IRecipe;\n+import net.minecraft.nbt.NBTTagCompound;\n+import net.minecraft.world.World;\n+import net.minecraftforge.oredict.OreDictionary;\n+\n+import appeng.api.AEApi;\n+import appeng.api.definitions.IComparableDefinition;\n+import appeng.api.definitions.IDefinitions;\n+\n+public class WirelessTerminalRecipe implements IRecipe\n+{\n+\n+    private final IComparableDefinition terminal;\n+    private final ItemStack waterBucket;\n+\n+    private static final ArrayList<String> dyes = new ArrayList<String>();\n+    static\n+    {\n+        dyes.add( \"dyeBlack\" );\n+        dyes.add( \"dyeBlue\" );\n+        dyes.add( \"dyeBrown\" );\n+        dyes.add( \"dyeCyan\" );\n+        dyes.add( \"dyeGray\" );\n+        dyes.add( \"dyeGreen\" );\n+        dyes.add( \"dyeLightBlue\" );\n+        dyes.add( \"dyeLightGray\" );\n+        dyes.add( \"dyeLime\" );\n+        dyes.add( \"dyeMagenta\" );\n+        dyes.add( \"dyeOrange\" );\n+        dyes.add( \"dyePink\" );\n+        dyes.add( \"dyePurple\" );\n+        dyes.add( \"dyeRed\" );\n+        dyes.add( \"dyeWhite\" );\n+        dyes.add( \"dyeYellow\" );\n+    }\n+\n+    public WirelessTerminalRecipe()\n+    {\n+        final IDefinitions definitions = AEApi.instance().definitions();\n+        terminal = definitions.items().wirelessTerminal();\n+        waterBucket = new ItemStack( Items.water_bucket, 1 );\n+    }\n+\n+    @Override\n+    public boolean matches( InventoryCrafting inv, World w )\n+    {\n+        return this.getOutput( inv, false ) != null;\n+    }\n+\n+    @Nullable\n+    private ItemStack getOutput( final IInventory inv, final boolean createTerminal )\n+    {\n+        ItemStack inputTerminal = null;\n+        String color = null;\n+        int numIngredients = 0;\n+        for( int i = 0; i < 9; i++ )\n+        {\n+            //If the slot is empty, ignore it\n+            if( inv.getStackInSlot( i ) != null )\n+            {\n+                numIngredients++;\n+                //if it contains a terminal, return that terminal\n+                if( this.terminal.isSameAs( inv.getStackInSlot( i ) ) )\n+                {\n+                    inputTerminal = inv.getStackInSlot( i );\n+                }\n+                else\n+                {\n+                    //check if the other item is a dye\n+                    color = getColorFromItem( inv.getStackInSlot( i ) );\n+                }\n+            }\n+\n+        }\n+\n+        //Check if both a terminal and a dye were found\n+        if( inputTerminal==null || color == null || numIngredients!=2)\n+        {\n+            return null;\n+        }\n+\n+        ItemStack output = ItemStack.copyItemStack( inputTerminal );","path":"src/main/java/appeng/recipes/game/WirelessTerminalRecipe.java","position":109,"original_position":109,"commit_id":"80b5bbdd32562b188661fdcde38bd16d32821b1a","original_commit_id":"80b5bbdd32562b188661fdcde38bd16d32821b1a","user":{"login":"orod-org","id":14347709,"avatar_url":"https://avatars.githubusercontent.com/u/14347709?v=3","gravatar_id":"","url":"https://api.github.com/users/orod-org","html_url":"https://github.com/orod-org","followers_url":"https://api.github.com/users/orod-org/followers","following_url":"https://api.github.com/users/orod-org/following{/other_user}","gists_url":"https://api.github.com/users/orod-org/gists{/gist_id}","starred_url":"https://api.github.com/users/orod-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orod-org/subscriptions","organizations_url":"https://api.github.com/users/orod-org/orgs","repos_url":"https://api.github.com/users/orod-org/repos","events_url":"https://api.github.com/users/orod-org/events{/privacy}","received_events_url":"https://api.github.com/users/orod-org/received_events","type":"User","site_admin":false},"body":"![MINOR](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/severity-minor.png) Local variable 'output' could be declared final [![rule](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/rule.png)](http://nemo.sonarqube.org/coding_rules#rule_key=pmd%3ALocalVariableCouldBeFinal)\n","created_at":"2015-10-03T03:41:16Z","updated_at":"2015-10-03T03:41:16Z","html_url":"https://github.com/AppliedEnergistics/Applied-Energistics-2/pull/1927#discussion_r41083412","pull_request_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/pulls/1927","_links":{"self":{"href":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/pulls/comments/41083412"},"html":{"href":"https://github.com/AppliedEnergistics/Applied-Energistics-2/pull/1927#discussion_r41083412"},"pull_request":{"href":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/pulls/1927"}}},"pull_request":{"url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/pulls/1927","id":46673271,"html_url":"https://github.com/AppliedEnergistics/Applied-Energistics-2/pull/1927","diff_url":"https://github.com/AppliedEnergistics/Applied-Energistics-2/pull/1927.diff","patch_url":"https://github.com/AppliedEnergistics/Applied-Energistics-2/pull/1927.patch","issue_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/issues/1927","number":1927,"state":"open","locked":false,"title":"Colored Wireless Terminals (#1693)","user":{"login":"Digmaster","id":302122,"avatar_url":"https://avatars.githubusercontent.com/u/302122?v=3","gravatar_id":"","url":"https://api.github.com/users/Digmaster","html_url":"https://github.com/Digmaster","followers_url":"https://api.github.com/users/Digmaster/followers","following_url":"https://api.github.com/users/Digmaster/following{/other_user}","gists_url":"https://api.github.com/users/Digmaster/gists{/gist_id}","starred_url":"https://api.github.com/users/Digmaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Digmaster/subscriptions","organizations_url":"https://api.github.com/users/Digmaster/orgs","repos_url":"https://api.github.com/users/Digmaster/repos","events_url":"https://api.github.com/users/Digmaster/events{/privacy}","received_events_url":"https://api.github.com/users/Digmaster/received_events","type":"User","site_admin":false},"body":"Allows users to color their wireless terminals any color. Also shows a slightly different graphic if the device is unlinked. Accomplishes feature #1693.\r\n\r\nRecipe is a wireless terminal and any dye in a shapeless pattern, or a water bucket to remove the color.\r\n![coloredterminal](https://cloud.githubusercontent.com/assets/302122/10255824/f90f4970-691a-11e5-9f60-5d6e464f061c.png)\r\n","created_at":"2015-10-02T19:33:57Z","updated_at":"2015-10-03T03:41:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"47e4d487fd5aa4d218bf663e1f1eaa5479bf4d29","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/pulls/1927/commits","review_comments_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/pulls/1927/comments","review_comment_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/issues/1927/comments","statuses_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/statuses/80b5bbdd32562b188661fdcde38bd16d32821b1a","head":{"label":"Digmaster:master","ref":"master","sha":"80b5bbdd32562b188661fdcde38bd16d32821b1a","user":{"login":"Digmaster","id":302122,"avatar_url":"https://avatars.githubusercontent.com/u/302122?v=3","gravatar_id":"","url":"https://api.github.com/users/Digmaster","html_url":"https://github.com/Digmaster","followers_url":"https://api.github.com/users/Digmaster/followers","following_url":"https://api.github.com/users/Digmaster/following{/other_user}","gists_url":"https://api.github.com/users/Digmaster/gists{/gist_id}","starred_url":"https://api.github.com/users/Digmaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Digmaster/subscriptions","organizations_url":"https://api.github.com/users/Digmaster/orgs","repos_url":"https://api.github.com/users/Digmaster/repos","events_url":"https://api.github.com/users/Digmaster/events{/privacy}","received_events_url":"https://api.github.com/users/Digmaster/received_events","type":"User","site_admin":false},"repo":{"id":43572142,"name":"Applied-Energistics-2","full_name":"Digmaster/Applied-Energistics-2","owner":{"login":"Digmaster","id":302122,"avatar_url":"https://avatars.githubusercontent.com/u/302122?v=3","gravatar_id":"","url":"https://api.github.com/users/Digmaster","html_url":"https://github.com/Digmaster","followers_url":"https://api.github.com/users/Digmaster/followers","following_url":"https://api.github.com/users/Digmaster/following{/other_user}","gists_url":"https://api.github.com/users/Digmaster/gists{/gist_id}","starred_url":"https://api.github.com/users/Digmaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Digmaster/subscriptions","organizations_url":"https://api.github.com/users/Digmaster/orgs","repos_url":"https://api.github.com/users/Digmaster/repos","events_url":"https://api.github.com/users/Digmaster/events{/privacy}","received_events_url":"https://api.github.com/users/Digmaster/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Digmaster/Applied-Energistics-2","description":"A Minecraft Mod about Matter, Energy and using them to conquer the world..","fork":true,"url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2","forks_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/forks","keys_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/teams","hooks_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/hooks","issue_events_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/issues/events{/number}","events_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/events","assignees_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/assignees{/user}","branches_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/branches{/branch}","tags_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/tags","blobs_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/git/refs{/sha}","trees_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/statuses/{sha}","languages_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/languages","stargazers_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/stargazers","contributors_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/contributors","subscribers_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/subscribers","subscription_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/subscription","commits_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/commits{/sha}","git_commits_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/git/commits{/sha}","comments_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/comments{/number}","issue_comment_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/issues/comments{/number}","contents_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/contents/{+path}","compare_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/merges","archive_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/downloads","issues_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/issues{/number}","pulls_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/pulls{/number}","milestones_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/milestones{/number}","notifications_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/labels{/name}","releases_url":"https://api.github.com/repos/Digmaster/Applied-Energistics-2/releases{/id}","created_at":"2015-10-02T19:27:31Z","updated_at":"2015-10-02T19:27:37Z","pushed_at":"2015-10-03T03:39:41Z","git_url":"git://github.com/Digmaster/Applied-Energistics-2.git","ssh_url":"git@github.com:Digmaster/Applied-Energistics-2.git","clone_url":"https://github.com/Digmaster/Applied-Energistics-2.git","svn_url":"https://github.com/Digmaster/Applied-Energistics-2","homepage":"http://ae-mod.info/","size":24420,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"AppliedEnergistics:master","ref":"master","sha":"d52efa8f7881def1529565ce62121265ab83c1bc","user":{"login":"AppliedEnergistics","id":8868712,"avatar_url":"https://avatars.githubusercontent.com/u/8868712?v=3","gravatar_id":"","url":"https://api.github.com/users/AppliedEnergistics","html_url":"https://github.com/AppliedEnergistics","followers_url":"https://api.github.com/users/AppliedEnergistics/followers","following_url":"https://api.github.com/users/AppliedEnergistics/following{/other_user}","gists_url":"https://api.github.com/users/AppliedEnergistics/gists{/gist_id}","starred_url":"https://api.github.com/users/AppliedEnergistics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AppliedEnergistics/subscriptions","organizations_url":"https://api.github.com/users/AppliedEnergistics/orgs","repos_url":"https://api.github.com/users/AppliedEnergistics/repos","events_url":"https://api.github.com/users/AppliedEnergistics/events{/privacy}","received_events_url":"https://api.github.com/users/AppliedEnergistics/received_events","type":"Organization","site_admin":false},"repo":{"id":24395109,"name":"Applied-Energistics-2","full_name":"AppliedEnergistics/Applied-Energistics-2","owner":{"login":"AppliedEnergistics","id":8868712,"avatar_url":"https://avatars.githubusercontent.com/u/8868712?v=3","gravatar_id":"","url":"https://api.github.com/users/AppliedEnergistics","html_url":"https://github.com/AppliedEnergistics","followers_url":"https://api.github.com/users/AppliedEnergistics/followers","following_url":"https://api.github.com/users/AppliedEnergistics/following{/other_user}","gists_url":"https://api.github.com/users/AppliedEnergistics/gists{/gist_id}","starred_url":"https://api.github.com/users/AppliedEnergistics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AppliedEnergistics/subscriptions","organizations_url":"https://api.github.com/users/AppliedEnergistics/orgs","repos_url":"https://api.github.com/users/AppliedEnergistics/repos","events_url":"https://api.github.com/users/AppliedEnergistics/events{/privacy}","received_events_url":"https://api.github.com/users/AppliedEnergistics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AppliedEnergistics/Applied-Energistics-2","description":"A Minecraft Mod about Matter, Energy and using them to conquer the world..","fork":false,"url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2","forks_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/forks","keys_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/teams","hooks_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/hooks","issue_events_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/issues/events{/number}","events_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/events","assignees_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/assignees{/user}","branches_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/branches{/branch}","tags_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/tags","blobs_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/git/refs{/sha}","trees_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/statuses/{sha}","languages_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/languages","stargazers_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/stargazers","contributors_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/contributors","subscribers_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/subscribers","subscription_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/subscription","commits_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/commits{/sha}","git_commits_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/git/commits{/sha}","comments_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/comments{/number}","issue_comment_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/issues/comments{/number}","contents_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/contents/{+path}","compare_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/merges","archive_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/downloads","issues_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/issues{/number}","pulls_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/pulls{/number}","milestones_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/milestones{/number}","notifications_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/labels{/name}","releases_url":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/releases{/id}","created_at":"2014-09-24T00:48:40Z","updated_at":"2015-10-03T03:21:31Z","pushed_at":"2015-10-03T03:39:41Z","git_url":"git://github.com/AppliedEnergistics/Applied-Energistics-2.git","ssh_url":"git@github.com:AppliedEnergistics/Applied-Energistics-2.git","clone_url":"https://github.com/AppliedEnergistics/Applied-Energistics-2.git","svn_url":"https://github.com/AppliedEnergistics/Applied-Energistics-2","homepage":"http://ae-mod.info/","size":24420,"stargazers_count":281,"watchers_count":281,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":122,"mirror_url":null,"open_issues_count":235,"forks":122,"open_issues":235,"watchers":281,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/pulls/1927"},"html":{"href":"https://github.com/AppliedEnergistics/Applied-Energistics-2/pull/1927"},"issue":{"href":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/issues/1927"},"comments":{"href":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/issues/1927/comments"},"review_comments":{"href":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/pulls/1927/comments"},"review_comment":{"href":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/pulls/1927/commits"},"statuses":{"href":"https://api.github.com/repos/AppliedEnergistics/Applied-Energistics-2/statuses/80b5bbdd32562b188661fdcde38bd16d32821b1a"}}}}