Recipe Converter - Low-Drag-MC/Multiblocked GitHub Wiki
Recipe Converter
This tool helps you to convert recipes from other sources into mbd recipes, for example you can import recipes from a furnace into a recipe map.
Examples
var Ingredient = java('net.minecraft.world.item.crafting.Ingredient')
//convert crafting recipe and smelting recipe to mbd recipe.
//event.register(String recipeType, String recipeMap, (recipe, map) =>{
// use map to add recipe.
//})
onEvent('mbd.recipe_converter_register', event => {
console.info("Starting conversion of recipes")
event.register('minecraft:smelting', 'converter_map', (recipe, map) => {
map.start().duration(1)
.inputItems(ArrayUtils.create(recipe.getIngredients(), Ingredient))//i'm not sure kubejs whether will help me to wrap a list to array.
.outputItems(recipe.getResultItem())
.buildAndRegister();
})
event.register('minecraft:crafting', 'crafting_map', (recipe, map) => {
map.start().duration(1)
.inputItems(ArrayUtils.create(recipe.getIngredients(), Ingredient))
.outputItems(recipe.getResultItem())
.buildAndRegister();
})
console.info("Finished conversion of recipes")
})