{"action":"created","comment":{"url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/pulls/comments/68493827","id":68493827,"diff_hunk":"@@ -0,0 +1,147 @@\n+package xyz.openmodloader.registry;\n+\n+\n+import net.minecraft.block.Block;\n+import net.minecraft.block.material.Material;\n+import net.minecraft.init.Blocks;\n+import net.minecraft.init.Items;\n+import net.minecraft.item.*;\n+\n+import javax.annotation.Nonnull;\n+import java.util.ArrayList;\n+import java.util.HashMap;\n+import java.util.List;\n+import java.util.Map;\n+\n+public class FuelRegistry {\n+    /**\n+     * Map containing time in game ticks items burn in furnaces.\n+     */\n+    private static Map<Item, Integer> itemBurnTimeMap;\n+\n+    /**\n+     * Map containing time in game ticks certain materials burn in furnaces.\n+     */\n+    private static Map<Object, Integer> materialBurnTimeMap;\n+\n+    /**\n+     * List containing unsmeltable items.\n+     */\n+    private static List<Item> itemBurnBlacklist;\n+\n+    @SuppressWarnings(\"ConstantConditions\")\n+    public static void initVanillaFuels(){\n+        registerItemBurnTime(Item.getItemFromBlock(Blocks.WOODEN_SLAB),150);\n+        registerItemBurnTime(Item.getItemFromBlock(Blocks.COAL_BLOCK),16000);\n+        registerItemBurnTime(Item.getItemFromBlock(Blocks.SAPLING), 100);\n+\n+        registerItemBurnTime(Items.STICK, 100);\n+        registerItemBurnTime(Items.COAL, 1600);\n+        registerItemBurnTime(Items.LAVA_BUCKET, 20000);\n+        registerItemBurnTime(Items.BLAZE_ROD, 2400);\n+\n+        registerMaterialBurnTime(Material.WOOD, 300);\n+        registerMaterialBurnTime(Item.a.WOOD, 200);\n+    }\n+\n+    public static boolean registerItemBurnTime(@Nonnull Item item, int burnTime){\n+        if (burnTime <= 0 || isItemBlacklisted(item)){\n+            return false;\n+        }\n+\n+        getItemBurnTimeMap().put(item, burnTime);\n+        return true;\n+    }\n+\n+    public static boolean registerMaterialBurnTime(@Nonnull Material material, int burnTime){\n+        if (burnTime <= 0){\n+            return false;\n+        }\n+\n+        getMaterialBurnTimeMap().put(material, burnTime);\n+        return true;\n+    }\n+\n+    public static boolean registerMaterialBurnTime(@Nonnull Item.a itemMaterial, int burnTime){\n+        if (burnTime <= 0){\n+            return false;\n+        }\n+\n+        getMaterialBurnTimeMap().put(itemMaterial, burnTime);\n+        return true;\n+    }\n+\n+    public static int getItemBurnTimeStrict(@Nonnull Item item){\n+        return getItemBurnTimeMap().get(item);\n+    }\n+\n+    public static int getMaterialBurnTime(@Nonnull Material material){\n+        return getMaterialBurnTimeMap().get(material);\n+    }\n+\n+    public static int getMaterialBurnTime(@Nonnull Item.a material){\n+        return getMaterialBurnTimeMap().get(material);\n+    }\n+\n+    public static boolean isItemBlacklisted(@Nonnull Item item) {","path":"src/main/java/xyz/openmodloader/registry/FuelRegistry.java","position":86,"original_position":86,"commit_id":"53d17cc9e89cf0b51ebc51a98867d3111a0f3adc","original_commit_id":"53d17cc9e89cf0b51ebc51a98867d3111a0f3adc","user":{"login":"iLexiconn","id":5201999,"avatar_url":"https://avatars.githubusercontent.com/u/5201999?v=3","gravatar_id":"","url":"https://api.github.com/users/iLexiconn","html_url":"https://github.com/iLexiconn","followers_url":"https://api.github.com/users/iLexiconn/followers","following_url":"https://api.github.com/users/iLexiconn/following{/other_user}","gists_url":"https://api.github.com/users/iLexiconn/gists{/gist_id}","starred_url":"https://api.github.com/users/iLexiconn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iLexiconn/subscriptions","organizations_url":"https://api.github.com/users/iLexiconn/orgs","repos_url":"https://api.github.com/users/iLexiconn/repos","events_url":"https://api.github.com/users/iLexiconn/events{/privacy}","received_events_url":"https://api.github.com/users/iLexiconn/received_events","type":"User","site_admin":false},"body":"Remove annotations","created_at":"2016-06-25T21:00:57Z","updated_at":"2016-06-25T21:00:57Z","html_url":"https://github.com/OpenModLoader/OpenModLoader/pull/37#discussion_r68493827","pull_request_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/pulls/37","_links":{"self":{"href":"https://api.github.com/repos/OpenModLoader/OpenModLoader/pulls/comments/68493827"},"html":{"href":"https://github.com/OpenModLoader/OpenModLoader/pull/37#discussion_r68493827"},"pull_request":{"href":"https://api.github.com/repos/OpenModLoader/OpenModLoader/pulls/37"}}},"pull_request":{"url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/pulls/37","id":75211323,"html_url":"https://github.com/OpenModLoader/OpenModLoader/pull/37","diff_url":"https://github.com/OpenModLoader/OpenModLoader/pull/37.diff","patch_url":"https://github.com/OpenModLoader/OpenModLoader/pull/37.patch","issue_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/issues/37","number":37,"state":"open","locked":false,"title":"Added fuel registry and patched Minecraft to use it.","user":{"login":"Caellian","id":4082795,"avatar_url":"https://avatars.githubusercontent.com/u/4082795?v=3","gravatar_id":"","url":"https://api.github.com/users/Caellian","html_url":"https://github.com/Caellian","followers_url":"https://api.github.com/users/Caellian/followers","following_url":"https://api.github.com/users/Caellian/following{/other_user}","gists_url":"https://api.github.com/users/Caellian/gists{/gist_id}","starred_url":"https://api.github.com/users/Caellian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Caellian/subscriptions","organizations_url":"https://api.github.com/users/Caellian/orgs","repos_url":"https://api.github.com/users/Caellian/repos","events_url":"https://api.github.com/users/Caellian/events{/privacy}","received_events_url":"https://api.github.com/users/Caellian/received_events","type":"User","site_admin":false},"body":"I added fuel registry for mods to use.\r\nThis allows mod developers to get a list of items and materials burnable in furnaces and their burn time. Fuel registry also allows blacklisting items that shouldn't be smelted.\r\nThis should hopefully allow mods adding machines like generators to easily support vanilla fuels and fuels added by other mods without modifying their code.\r\n\r\nThis is currently very simple and only makes vanilla system a bit more flexible and modifiable without asm. Support for NBT should be implemented next (in case only items of specific data value are burnable) and different block states.\r\n\r\nI made all methods accessible in case a mod developer needs to access specific part of this registry.\r\n\r\nTell me if my pull request needs any additional changes before being accepted.","created_at":"2016-06-25T18:36:11Z","updated_at":"2016-06-25T21:00:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f9058999d5fceafcd7476adbee23063302cccf0d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/pulls/37/commits","review_comments_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/pulls/37/comments","review_comment_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/issues/37/comments","statuses_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/statuses/53d17cc9e89cf0b51ebc51a98867d3111a0f3adc","head":{"label":"Caellian:master","ref":"master","sha":"53d17cc9e89cf0b51ebc51a98867d3111a0f3adc","user":{"login":"Caellian","id":4082795,"avatar_url":"https://avatars.githubusercontent.com/u/4082795?v=3","gravatar_id":"","url":"https://api.github.com/users/Caellian","html_url":"https://github.com/Caellian","followers_url":"https://api.github.com/users/Caellian/followers","following_url":"https://api.github.com/users/Caellian/following{/other_user}","gists_url":"https://api.github.com/users/Caellian/gists{/gist_id}","starred_url":"https://api.github.com/users/Caellian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Caellian/subscriptions","organizations_url":"https://api.github.com/users/Caellian/orgs","repos_url":"https://api.github.com/users/Caellian/repos","events_url":"https://api.github.com/users/Caellian/events{/privacy}","received_events_url":"https://api.github.com/users/Caellian/received_events","type":"User","site_admin":false},"repo":{"id":61950664,"name":"OpenModLoader","full_name":"Caellian/OpenModLoader","owner":{"login":"Caellian","id":4082795,"avatar_url":"https://avatars.githubusercontent.com/u/4082795?v=3","gravatar_id":"","url":"https://api.github.com/users/Caellian","html_url":"https://github.com/Caellian","followers_url":"https://api.github.com/users/Caellian/followers","following_url":"https://api.github.com/users/Caellian/following{/other_user}","gists_url":"https://api.github.com/users/Caellian/gists{/gist_id}","starred_url":"https://api.github.com/users/Caellian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Caellian/subscriptions","organizations_url":"https://api.github.com/users/Caellian/orgs","repos_url":"https://api.github.com/users/Caellian/repos","events_url":"https://api.github.com/users/Caellian/events{/privacy}","received_events_url":"https://api.github.com/users/Caellian/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Caellian/OpenModLoader","description":"A next gen minecraft mod loader for minecraft 1.10 and above","fork":true,"url":"https://api.github.com/repos/Caellian/OpenModLoader","forks_url":"https://api.github.com/repos/Caellian/OpenModLoader/forks","keys_url":"https://api.github.com/repos/Caellian/OpenModLoader/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Caellian/OpenModLoader/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Caellian/OpenModLoader/teams","hooks_url":"https://api.github.com/repos/Caellian/OpenModLoader/hooks","issue_events_url":"https://api.github.com/repos/Caellian/OpenModLoader/issues/events{/number}","events_url":"https://api.github.com/repos/Caellian/OpenModLoader/events","assignees_url":"https://api.github.com/repos/Caellian/OpenModLoader/assignees{/user}","branches_url":"https://api.github.com/repos/Caellian/OpenModLoader/branches{/branch}","tags_url":"https://api.github.com/repos/Caellian/OpenModLoader/tags","blobs_url":"https://api.github.com/repos/Caellian/OpenModLoader/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Caellian/OpenModLoader/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Caellian/OpenModLoader/git/refs{/sha}","trees_url":"https://api.github.com/repos/Caellian/OpenModLoader/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Caellian/OpenModLoader/statuses/{sha}","languages_url":"https://api.github.com/repos/Caellian/OpenModLoader/languages","stargazers_url":"https://api.github.com/repos/Caellian/OpenModLoader/stargazers","contributors_url":"https://api.github.com/repos/Caellian/OpenModLoader/contributors","subscribers_url":"https://api.github.com/repos/Caellian/OpenModLoader/subscribers","subscription_url":"https://api.github.com/repos/Caellian/OpenModLoader/subscription","commits_url":"https://api.github.com/repos/Caellian/OpenModLoader/commits{/sha}","git_commits_url":"https://api.github.com/repos/Caellian/OpenModLoader/git/commits{/sha}","comments_url":"https://api.github.com/repos/Caellian/OpenModLoader/comments{/number}","issue_comment_url":"https://api.github.com/repos/Caellian/OpenModLoader/issues/comments{/number}","contents_url":"https://api.github.com/repos/Caellian/OpenModLoader/contents/{+path}","compare_url":"https://api.github.com/repos/Caellian/OpenModLoader/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Caellian/OpenModLoader/merges","archive_url":"https://api.github.com/repos/Caellian/OpenModLoader/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Caellian/OpenModLoader/downloads","issues_url":"https://api.github.com/repos/Caellian/OpenModLoader/issues{/number}","pulls_url":"https://api.github.com/repos/Caellian/OpenModLoader/pulls{/number}","milestones_url":"https://api.github.com/repos/Caellian/OpenModLoader/milestones{/number}","notifications_url":"https://api.github.com/repos/Caellian/OpenModLoader/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Caellian/OpenModLoader/labels{/name}","releases_url":"https://api.github.com/repos/Caellian/OpenModLoader/releases{/id}","deployments_url":"https://api.github.com/repos/Caellian/OpenModLoader/deployments","created_at":"2016-06-25T16:00:39Z","updated_at":"2016-06-25T16:00:40Z","pushed_at":"2016-06-25T18:27:39Z","git_url":"git://github.com/Caellian/OpenModLoader.git","ssh_url":"git@github.com:Caellian/OpenModLoader.git","clone_url":"https://github.com/Caellian/OpenModLoader.git","svn_url":"https://github.com/Caellian/OpenModLoader","homepage":"http://openmodloader.xyz/","size":2721,"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":"OpenModLoader:master","ref":"master","sha":"3b19ab5077405cace06fcf089883c0d47b009ac1","user":{"login":"OpenModLoader","id":20051910,"avatar_url":"https://avatars.githubusercontent.com/u/20051910?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenModLoader","html_url":"https://github.com/OpenModLoader","followers_url":"https://api.github.com/users/OpenModLoader/followers","following_url":"https://api.github.com/users/OpenModLoader/following{/other_user}","gists_url":"https://api.github.com/users/OpenModLoader/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenModLoader/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenModLoader/subscriptions","organizations_url":"https://api.github.com/users/OpenModLoader/orgs","repos_url":"https://api.github.com/users/OpenModLoader/repos","events_url":"https://api.github.com/users/OpenModLoader/events{/privacy}","received_events_url":"https://api.github.com/users/OpenModLoader/received_events","type":"Organization","site_admin":false},"repo":{"id":61618132,"name":"OpenModLoader","full_name":"OpenModLoader/OpenModLoader","owner":{"login":"OpenModLoader","id":20051910,"avatar_url":"https://avatars.githubusercontent.com/u/20051910?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenModLoader","html_url":"https://github.com/OpenModLoader","followers_url":"https://api.github.com/users/OpenModLoader/followers","following_url":"https://api.github.com/users/OpenModLoader/following{/other_user}","gists_url":"https://api.github.com/users/OpenModLoader/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenModLoader/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenModLoader/subscriptions","organizations_url":"https://api.github.com/users/OpenModLoader/orgs","repos_url":"https://api.github.com/users/OpenModLoader/repos","events_url":"https://api.github.com/users/OpenModLoader/events{/privacy}","received_events_url":"https://api.github.com/users/OpenModLoader/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenModLoader/OpenModLoader","description":"A next gen minecraft mod loader for minecraft 1.10 and above","fork":false,"url":"https://api.github.com/repos/OpenModLoader/OpenModLoader","forks_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/forks","keys_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/teams","hooks_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/hooks","issue_events_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/issues/events{/number}","events_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/events","assignees_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/assignees{/user}","branches_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/branches{/branch}","tags_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/tags","blobs_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/languages","stargazers_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/stargazers","contributors_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/contributors","subscribers_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/subscribers","subscription_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/subscription","commits_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/contents/{+path}","compare_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/merges","archive_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/downloads","issues_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/issues{/number}","pulls_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/labels{/name}","releases_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/releases{/id}","deployments_url":"https://api.github.com/repos/OpenModLoader/OpenModLoader/deployments","created_at":"2016-06-21T08:53:39Z","updated_at":"2016-06-25T20:24:03Z","pushed_at":"2016-06-25T20:56:11Z","git_url":"git://github.com/OpenModLoader/OpenModLoader.git","ssh_url":"git@github.com:OpenModLoader/OpenModLoader.git","clone_url":"https://github.com/OpenModLoader/OpenModLoader.git","svn_url":"https://github.com/OpenModLoader/OpenModLoader","homepage":"http://openmodloader.xyz/","size":2810,"stargazers_count":34,"watchers_count":34,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":9,"forks":11,"open_issues":9,"watchers":34,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenModLoader/OpenModLoader/pulls/37"},"html":{"href":"https://github.com/OpenModLoader/OpenModLoader/pull/37"},"issue":{"href":"https://api.github.com/repos/OpenModLoader/OpenModLoader/issues/37"},"comments":{"href":"https://api.github.com/repos/OpenModLoader/OpenModLoader/issues/37/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenModLoader/OpenModLoader/pulls/37/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenModLoader/OpenModLoader/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenModLoader/OpenModLoader/pulls/37/commits"},"statuses":{"href":"https://api.github.com/repos/OpenModLoader/OpenModLoader/statuses/53d17cc9e89cf0b51ebc51a98867d3111a0f3adc"}}}}
{"actor":{"display_login":"iLexiconn"}}