{"action":"created","issue":{"url":"https://api.github.com/repos/codetaylor/artisan-worktables/issues/69","repository_url":"https://api.github.com/repos/codetaylor/artisan-worktables","labels_url":"https://api.github.com/repos/codetaylor/artisan-worktables/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/codetaylor/artisan-worktables/issues/69/comments","events_url":"https://api.github.com/repos/codetaylor/artisan-worktables/issues/69/events","html_url":"https://github.com/codetaylor/artisan-worktables/issues/69","id":297307869,"number":69,"title":"Support creating recipes from existing crafting recipes, and then removing them","user":{"login":"Yuudaari","id":6081834,"avatar_url":"https://avatars3.githubusercontent.com/u/6081834?v=4","gravatar_id":"","url":"https://api.github.com/users/Yuudaari","html_url":"https://github.com/Yuudaari","followers_url":"https://api.github.com/users/Yuudaari/followers","following_url":"https://api.github.com/users/Yuudaari/following{/other_user}","gists_url":"https://api.github.com/users/Yuudaari/gists{/gist_id}","starred_url":"https://api.github.com/users/Yuudaari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yuudaari/subscriptions","organizations_url":"https://api.github.com/users/Yuudaari/orgs","repos_url":"https://api.github.com/users/Yuudaari/repos","events_url":"https://api.github.com/users/Yuudaari/events{/privacy}","received_events_url":"https://api.github.com/users/Yuudaari/received_events","type":"User","site_admin":false},"labels":[{"id":789236671,"url":"https://api.github.com/repos/codetaylor/artisan-worktables/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":{"login":"codetaylor","id":1240716,"avatar_url":"https://avatars1.githubusercontent.com/u/1240716?v=4","gravatar_id":"","url":"https://api.github.com/users/codetaylor","html_url":"https://github.com/codetaylor","followers_url":"https://api.github.com/users/codetaylor/followers","following_url":"https://api.github.com/users/codetaylor/following{/other_user}","gists_url":"https://api.github.com/users/codetaylor/gists{/gist_id}","starred_url":"https://api.github.com/users/codetaylor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codetaylor/subscriptions","organizations_url":"https://api.github.com/users/codetaylor/orgs","repos_url":"https://api.github.com/users/codetaylor/repos","events_url":"https://api.github.com/users/codetaylor/events{/privacy}","received_events_url":"https://api.github.com/users/codetaylor/received_events","type":"User","site_admin":false},"assignees":[{"login":"codetaylor","id":1240716,"avatar_url":"https://avatars1.githubusercontent.com/u/1240716?v=4","gravatar_id":"","url":"https://api.github.com/users/codetaylor","html_url":"https://github.com/codetaylor","followers_url":"https://api.github.com/users/codetaylor/followers","following_url":"https://api.github.com/users/codetaylor/following{/other_user}","gists_url":"https://api.github.com/users/codetaylor/gists{/gist_id}","starred_url":"https://api.github.com/users/codetaylor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codetaylor/subscriptions","organizations_url":"https://api.github.com/users/codetaylor/orgs","repos_url":"https://api.github.com/users/codetaylor/repos","events_url":"https://api.github.com/users/codetaylor/events{/privacy}","received_events_url":"https://api.github.com/users/codetaylor/received_events","type":"User","site_admin":false}],"milestone":null,"comments":22,"created_at":"2018-02-15T01:57:48Z","updated_at":"2018-02-24T01:01:02Z","closed_at":null,"author_association":"NONE","body":"It's likely the main use for most Artisan Worktables packs will be to move existing recipes over to the Worktable. However, doing it is a pain:\r\n\r\nThe workflow of creating a recipe is currently to copy the code of an existing builder and replace the stuff in it with the new recipe information. Alternatively you can use `/ct recipes hand`, however this puts the recipes into a file instead of copying them to your clipboard. It's usually only faster (for me, anyway) if the recipe is very complex.\r\n\r\nTo improve this workflow I suggest adding support for a multi-purpose RecipeBuilder method, which will inherit all the ingredients and output of an existing recipe (probably selecting the recipe by name), and then remove that existing recipe.\r\n\r\nHere's an example of how it looks now:\r\n\r\n```js\r\nrecipes.remove(<minecraft:piston>);\r\nWorktable.createRecipeBuilder(\"engineer\")\r\n    .setShaped([\r\n        [<ore:plankWood>, <ore:plankWood>, <ore:plankWood>],\r\n        [<ore:cobblestone>, <minecraft:iron_ingot>, <ore:cobblestone>],\r\n        [<ore:cobblestone>, <minecraft:redstone>, <ore:cobblestone>],\r\n    ])\r\n    .addTool(<ore:engineers_driver>, 1)\r\n    .addOutput(<minecraft:piston>)\r\n    .create();\r\n```\r\n\r\nAnd here's after my suggestion:\r\n\r\n```js\r\nWorktable.createRecipeBuilder(\"engineer\")\r\n    .fromRecipe(\"minecraft:piston\")\r\n    .addTool(<ore:engineers_driver>, 1)\r\n    .create();\r\n```\r\n\r\nThis has the benefit of making the ZenScript code *much* simpler and more succinct, while being many times easier to write."},"comment":{"url":"https://api.github.com/repos/codetaylor/artisan-worktables/issues/comments/368182140","html_url":"https://github.com/codetaylor/artisan-worktables/issues/69#issuecomment-368182140","issue_url":"https://api.github.com/repos/codetaylor/artisan-worktables/issues/69","id":368182140,"user":{"login":"codetaylor","id":1240716,"avatar_url":"https://avatars1.githubusercontent.com/u/1240716?v=4","gravatar_id":"","url":"https://api.github.com/users/codetaylor","html_url":"https://github.com/codetaylor","followers_url":"https://api.github.com/users/codetaylor/followers","following_url":"https://api.github.com/users/codetaylor/following{/other_user}","gists_url":"https://api.github.com/users/codetaylor/gists{/gist_id}","starred_url":"https://api.github.com/users/codetaylor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codetaylor/subscriptions","organizations_url":"https://api.github.com/users/codetaylor/orgs","repos_url":"https://api.github.com/users/codetaylor/repos","events_url":"https://api.github.com/users/codetaylor/events{/privacy}","received_events_url":"https://api.github.com/users/codetaylor/received_events","type":"User","site_admin":false},"created_at":"2018-02-24T01:01:02Z","updated_at":"2018-02-24T01:01:02Z","author_association":"OWNER","body":"```java\r\n// Copies recipe input and output with quantity\r\n@ZenMethod\r\nIZenRecipeBuilder copyRecipesWithOutput(IIngredient[] toCopy);\r\n\r\n// Copies recipe input and replaces output with copied quantity\r\n@ZenMethod\r\nIZenRecipeBuilder copyRecipesReplaceOutput(IIngredient[] toCopy, IItemStack newOutput);\r\n\r\n// Copies recipe input, but not output\r\n@ZenMethod\r\nIZenRecipeBuilder copyRecipesRemoveOutput(IIngredient[] toCopy);\r\n```\r\n\r\n> What’s the benefit of providing copyRecipesRemoveOutput, out of curiosity? Since you could just use addOutput to overwrite it later anyway?\r\n\r\n`addOutput` does not overwrite anything, it ... adds output. Since recipes can have multiple weighted outputs, `addOutput` adds outputs."}}
{"actor":{"display_login":"codetaylor"}}