Add worktable config option to allow repeat recipe insertion
codetaylor opened this issue ยท 3 comments
This implementation will allow a player to sneak+click on a worktable with a valid hammer to automatically place the previously completed recipe at a small cost to the hammer's durability. The feature will have a config option for hammer durability cost per recipe placement and a toggle to turn the feature on. The feature will be disabled by default.
This feature will work on both worktables. When using this feature with the stone worktable, one full recipe's worth of input items will be added to the table with each sneak+click up to a maximum of the smallest stack size on the table.
The feature will not immediately work when a world is reloaded because the worktable doesn't save the previous recipe. The data would have to be retained if the feature should work immediately on the load of the world.
Would it also be beneficial to implement sneak+click on the worktable with an empty hand to remove all items?
Can this be one of the specific durability toggle configs too? Like, even if you want normal crafting to cost durability, have a specific separate config for turning off repeat recipe durability loss.
Mostly, I'm thinking of people like Nooby, for whom this is a disability issue, who might like the normal crafting durability loss but not want to be punished with extra durability loss just for having shaky hands.
@Config.Comment({
"If this is true, a player will be allowed to sneak + click using an",
"empty hand to remove all items from the worktable's crafting grid.",
"The removed items will be placed into the player's inventory or on top",
"of the worktable if the player's inventory is full.",
"Default: " + false
})
public boolean ALLOW_RECIPE_CLEAR = false;
@Config.Comment({
"If this is true, a player will be allowed to sneak + click using a",
"hammer to automatically place items from their inventory into the",
"worktable's crafting grid that match the ingredients for the last",
"recipe completed. The hammer will be damaged, see RECIPE_REPEAT_TOOL_DAMAGE.",
"Default: " + false
})
public boolean ALLOW_RECIPE_REPEAT = false;
@Config.Comment({
"If ALLOW_RECIPE_REPEAT is enabled, this is the amount of damage that",
"will be applied to the hammer. Set to zero to disable.",
"Default: " + 1
})
@Config.RangeInt(min = 0)
public int RECIPE_REPEAT_TOOL_DAMAGE = 1;
It's been set up that way, yes. I just now improved the clarity of the damage comment to clearly indicate that the damage can be set to zero.