Open Malarchist opened 3 years ago
This is already possible with CraftTweaker recipes using IRecipeFunctions. The linked IRecipeFunction documentation even gives a direct example of how to use them to create a recipe to repair a vanilla-style tool using marked ingredients. As the worktable supports using IRecipeFunctions, there's no change needed to Pyrotech to support this.
Of course, if Codetaylor wants to add a sharpening stone or whatever, I'm not going to argue against it…
I should clarify. I was hoping to be able to repair the tool you right-click the worktable with. The worktable is a very nice alternative and could even potentially be a complete replacement for vanilla's crafting in the right kind of modpacks. While I understand that crafttweaker can do vanilla repairing, and pyrotech could likely work just fine using this, being able to repair the tool you're right-clicking the worktable with would be a much more seamless and intuitive way of repairing with the worktable. However, I'd understand if this isn't worth the author's time or something they fundamentally don't agree with.
That makes more sense! For that, you could use an IRecipeAction (same documentation page) to modify the item that the player is holding in their main hand (probably double-checking that that tool matches the recipe tool, to avoid any mod-interaction shenanigans).
Also, just in case it's not clear: I don't dislike your idea, I'm just offering options that are already available to you.
Good suggestion, my complete lack of experience in programming always scares me away from those more advanced functions but your advice helped me know where to even start. Unfortunately, it didn't work out either. I'll leave some condensed notes of what I tried, all tested in separate sessions, in case you have any other ideas. I'm guessing the worktable requires extra scripting to identify the player since technically the crafting isn't happening "on the player" but rather the block, which I'm not even gonna bother testing since the whole idea falls apart without null outputs. I'm probably just gonna skip on repairing this way for the modpack but regardless, thanks for all your help!!
// Testing 1 - Base Pyrotech
// Draft: Worktable Tool Sharpen, Result: Doesn't initiate, no green particles
Worktable.buildShaped(null,
[[
// Experimental Test: Worktable Null Return, Result: Doesn't initiate, no green particles
Worktable.buildShaped(null,
[[
// Experimental Test: Worktable Tool Repair, Result: Tool durability doesn't increase
Worktable.buildShaped(
// Testing 2 - Pyrotech with Actions and Functions
// Control Test: Vanilla Action Item Return, Result: Returns potato and diamond pickaxe
recipes.addShaped("testthingy00",
// Experimental Test: Worktable Function Null Return, Result: Recipe doesn't initiate, no green particles
Worktable.buildShaped(
// Experimental Test: Worktable Action Item Return, Result: Recipe works but doesn't perform action, only returns apple
// "player.dropItem" doesn't trigger either
Worktable.buildShaped(
I've been playing around with Crafttweaker and an interesting idea that came up was repairing tools using the worktable. I tried setting the output to null and tool damage to -1 but shapeless recipes don't accept nulls, shaped recipes with null outputs register but still don't work, and negative tool damage displays as double negatives in JEI but are treated as 0 for tool damage in actuality. It'd be awesome if these worked.
Could also be a fun idea for the base mod too. Maybe there could be a sharpening stone made with diamonds or something and it has a high but still limited durability for repairing bladed tools. Place it on a worktable and "sharpen" the blade in your hand (configurable).
(Sorry if this breaks format. I'm not sure if this counts as multiple suggestions.)