WolfyScript / CustomCrafting

Spigot based plugin to create your own custom Recipes & Items. Designed to be easy to use with in-game GUI and tons of configuration possibilities.
https://modrinth.com/plugin/customcrafting
GNU General Public License v3.0
114 stars 36 forks source link

Add Item Type Merge Adapter #292

Closed WolfyScript closed 1 year ago

WolfyScript commented 1 year ago

The item type merge adapter allows recipes to change the type of the result stack depending on an ingredient.

This is useful for repair recipes, and similar recipes inside the crafting grid, where the type of the ingredient should determine the result type. The id of the merge adapter is customcrafting:item.

One example is for a recipe that converts swords into axes:

target {
  mergeOptions : [ {
    slots : [ 4 ]
    adapters : [ {
      key : "customcrafting:item"
      typeMappings { // Maps the sword types of the ingredient to a type for the result stack
        wooden_sword = wooden_axe
        stone_sword = stone_axe
        iron_sword  = iron_axe
        golden_sword = golden_axe
        diamond_sword = diamond_axe
      }
    } ]
  } ]
}

For the recipe to work, it of course needs to allow all the different variants of items.
You can do that by shift + right-click on ingredient slots!

This is not meant to replace type specific recipes like for boats, doors, etc. For those it is still required to create separate recipes, because this can only ever target a single ingredient!