This update introduces a new ResultTarget feature for recipe results and fixes a lot of issues regarding Minecraft 1.17.
This update requires Java 16 and the latest WolfyUtilities to work!
ResultTarget The idea of the Target feature is that you can target specific ingredients of a recipe and use adapters to merge specific ItemMeta/NBT into the resulting ItemStack. This feature works for crafting, furnace, blast furnace, smoker, and smithing recipes. Everything works on a modular basis, which means you can select which adapters to use, and you can even code and register your own adapters to merge custom NBT, etc. More information here: https://github.com/WolfyScript/CustomCrafting-Wiki/wiki/Result-Target
EnchantMergeAdapter Takes the enchants from the targeted ingredients and adds them to the result.
EnchantedBookMergeAdapter Takes the enchants from the target enchanted books and adds them to the result.
DamageMergeAdapter Combines the durability of all the targeted items onto the result.
Fields to customize: repairBonus— Adds 5% of the max durability (of the result) to the total. additionalDamage— Adds additional damage to the total (negative = more durability, positive = less total durability).
For example, if you have two custom tools you combine/repair into one, these options would repair them the same as vanilla does: (Adds both durabilities together, adds the 5% bonus, and applies it to the result)
Or this recipe combining the durability of three swords. (Adds every durability together, adds the 5% bonus, adds 20 extra durability, and applies it to the result)
PlaceHolderAPIMergeAdapter Can replace placeholders inside the resulting item (name and lore). It supports placeholders and bracket placeholders.
Other than the previous adapters, it ignores the targeted slots and directly edits the result, so it's usually used at the end of the adapter chain. //proxy.spigotmc.org/988239631fade89e877b0bd34cb4240ee014e2df?url=https://i.gyazo.com/f559c41647fbc6dce393cd35e11e2825.png" rel="noopener nofollow" target="_blank">https://proxy.spigotmc.org/988239631fade89e877b0bd34cb4240ee014e2df?url=https://i.gyazo.com/f559c41647fbc6dce393cd35e11e2825.png" alt="[IMG]" data-url="https://i.gyazo.com/f559c41647fbc6dce393cd35e11e2825.png" />
There are some fields to customize the behavior: replaceName— looks for placeholders in the name. replaceLore— looks for placeholders in the lore. nameBracketPlaceholders— looks for bracket placeholders in the name. loreBracketPlaceholders— looks for bracket placeholders in the lore.
Conditions
Craft Delay Condition Allows you to set a delay that players need to wait for, to craft again. This is very useful to prevent lag when using the 6×6 Elite Crafting Table for example or other complex recipes.
Craft Limit Condition Allows limiting the number of times a recipe can be crafted.
ItemCreator The ItemCreator was rearranged and got a new "Save" button, that is displayed if the item being edited and will save the item to their previous saved location.
Further Features
Updated to Java 16
Added Result Target to Crafting, Furnace, Blast Furnace, and Smithing recipes to allow merging ingredient NBT into the result item.
Added Hide Dye flag to the ItemCreator.
Rearranged the ItemCreator (more toolbar space at the bottom)
Technical
Addedseparate result item cache for block recipes.
Addedcomplete error stack trace in case an Item or a Recipe fails to load.
AddedMergeAdapter which can be extended and registered using Registry.RECIPE_MERGE_ADAPTERS.register().
AddedgetResult(ItemStack[]), checkCondition(String, Data), and isDisabled() to the ICustomRecipe.
AddedcheckConditions() to ICustomRecipe to check conditions directly.
AddedConditions#check to check specific nullable conditions.
AddedNetworkHandler that receives client requests, verifies them and sends data to a client mod (disabled in production for now).
Addedmethod ICustomRecipe to write recipes into a ByteBuf.
RenamedCategories#indexCategories to Categories#index
ChangedCrafting, so it is ignored when the inventory click event is canceled before it.
Changedmaven groupId and artifactId
Combinedcrafting logic of Elite and Advanced crafting recipes into the specific interface.
ReplacedResultExtension#Provider with the new CustomTypeIdResolver.