{"action":"created","issue":{"url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/1731","labels_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/1731/labels{/name}","comments_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/1731/comments","events_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/1731/events","html_url":"https://github.com/MinecraftForge/MinecraftForge/pull/1731","id":59387831,"number":1731,"title":"Add oredict support for tool/armor materials","user":{"login":"Zot201","id":5572539,"avatar_url":"https://avatars.githubusercontent.com/u/5572539?v=3","gravatar_id":"","url":"https://api.github.com/users/Zot201","html_url":"https://github.com/Zot201","followers_url":"https://api.github.com/users/Zot201/followers","following_url":"https://api.github.com/users/Zot201/following{/other_user}","gists_url":"https://api.github.com/users/Zot201/gists{/gist_id}","starred_url":"https://api.github.com/users/Zot201/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zot201/subscriptions","organizations_url":"https://api.github.com/users/Zot201/orgs","repos_url":"https://api.github.com/users/Zot201/repos","events_url":"https://api.github.com/users/Zot201/events{/privacy}","received_events_url":"https://api.github.com/users/Zot201/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-01T08:12:30Z","updated_at":"2015-03-03T13:50:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/pulls/1731","html_url":"https://github.com/MinecraftForge/MinecraftForge/pull/1731","diff_url":"https://github.com/MinecraftForge/MinecraftForge/pull/1731.diff","patch_url":"https://github.com/MinecraftForge/MinecraftForge/pull/1731.patch"},"body":"This PR Extends the current ```Item``` or ```ItemStack```  version of custom materials in ```ToolMaterial``` along with ```ArmorMaterial``` to support ore dictionary.\r\n\r\nA straightforward ```Predicate<ItemStack> repairMaterial``` based implementation is used, to support both oredict items and non-oredict items.\r\n\r\nWith this PR, you will be able to:\r\n\r\n* Add variations for vanilla materials crafting vanilla tools as well as repairing them, only by ore dictionary registrations. For example, any new wood planks registered with ```\"plankWood\"``` can be used in both crafting or repairing of vanilla wooden tools.\r\n\r\n* Allow others to add variations for your own custom materials crafting your own custom tools as well as repairing them, without explicitly iterating over ore dictionary entries in ```getIsRepairable``` methods of your own tool classes.\r\n\r\nA basic example is provided [here](https://gist.github.com/Zot201/1586bfd71727487e6d03). Please feel free to leave your comments for the implementation, ideas or else."},"comment":{"url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/comments/76947916","html_url":"https://github.com/MinecraftForge/MinecraftForge/pull/1731#issuecomment-76947916","issue_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/1731","id":76947916,"user":{"login":"Zot201","id":5572539,"avatar_url":"https://avatars.githubusercontent.com/u/5572539?v=3","gravatar_id":"","url":"https://api.github.com/users/Zot201","html_url":"https://github.com/Zot201","followers_url":"https://api.github.com/users/Zot201/followers","following_url":"https://api.github.com/users/Zot201/following{/other_user}","gists_url":"https://api.github.com/users/Zot201/gists{/gist_id}","starred_url":"https://api.github.com/users/Zot201/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zot201/subscriptions","organizations_url":"https://api.github.com/users/Zot201/orgs","repos_url":"https://api.github.com/users/Zot201/repos","events_url":"https://api.github.com/users/Zot201/events{/privacy}","received_events_url":"https://api.github.com/users/Zot201/received_events","type":"User","site_admin":false},"created_at":"2015-03-03T13:50:15Z","updated_at":"2015-03-03T13:50:15Z","body":"Thanks. It is updated now.\r\n\r\nThe ```ItemPredicate``` no longer holds an ```ItemStack``` now. Instead, it holds a ```RegistryDelegate``` and a damage value as they are the only parts required for the comparison. The ```apply``` method becomes a little bit more efficient as well.\r\n\r\nThe example is in the /test/ folder now.\r\n\r\nAs for the caching thing I have commented above, another choice may be deprecating it if it is going to be too complicated."}}