#Mekanism Chemical Oxidizer
2 messages · Page 1 of 1 (latest)
Right now i am stuck on this i got most of the code from some random modpacks but i kinda dont know how it works and how to make it work xD
function MekanismHelper(event) {
/**
* Generate a recipe ID based on output, input and recipe type
* @param {string} type
* @param {Special.Item} output
* @param {$Ingredient_} input
* @returns {string} The generated recipe ID
*/
let makeRecipeId = (type, output, input) => {
return _makeRecipeID('mekanism', type, output, input);
};
return {
/**
* @param {$Chemical_} chemicalOutput
* @param {$ItemStack_} itemInput
* @param {Special.RecipeId} [recipeID] The recipe ID, can be used to overwrite recipes (optional, default is generated based on recipe parameters).
* */
oxidizing(chemicalOutput, itemInput, recipeID) {
/** @type {[number, $Chemical_]} */
let [chemicalAmount, chemicalId] = chemicalOutput.split('x ');
let recipe = {
type: 'mekanism:oxidizing',
input: Ingredient.of(itemInput).toJson(),
output: {
amount: parseInt(chemicalAmount),
id: chemicalId,
},
};
event.custom(recipe).id(recipeID ?? makeRecipeId('oxidizing', chemicalOutput, itemInput));
},
};
}
ServerEvents.recipes(e => {
const mekanism = MekanismHelper(e);
mekanism.oxidizing('80x mekanism:redstone', 'mekanism:enriched_redstone');
});