
[Enhancement ๐ก] KubeJs support ?
Elnhomantia opened this issue ยท 8 comments
Could you add a kubeJs support please ? Or provide the way to make recipes in the json format ?
Hey ๐ @Elnhomantia
KubeJS compat is planned, I dont know for now how I will implement it. But for now, you can just see how to create custom recipes in KubeJS on their wiki and just change the recipe type or others fields like my JSON recipes ones like Here for casting brass ingot recipe.
I don't think it will be that easy. I didn't really think about how to do it afterwards so idk, and also I'm on Java not JavaScript
Yep, try doing something like this in your script:
let alloying = (input, time, fluidType, fluidAmount, heat) => {
event.custom({
"type": "createmetallurgy:alloying",
"ingredients": input,
"processingTime": time,
"results": [
{
"fluid": fluidType,
"amount": fluidAmount
}
],
"heatRequirement": heat
})
}
and use it later on
alloying(
[
{"fluid": "createmetallurgy:molten_copper", "amount": 10},
{"fluid": "createmetallurgy:molten_zinc", "amount": 10}
],
80, "createmetallurgy:molten_brass", 20, "heated"
);
Actually I forgot I could actually go and see on the repo xD. Thx a lot for the help.
This actually work and let me add anything as input/ouput :
/**
* Add melting recipe with create metallurgy
* @param {{item: 'tag'}|{fluid: 'tag', amount: number}[]} input
* @param {number} time
* @param {{item: 'tag'}|{fluid: 'tag', amount: number}[]} output
* @param {'no'|'heated'|'superheated'} heat
*/
let melting = (input, time, output, heat) => {
event.custom({
type: "createmetallurgy:melting",
ingredients: input,
processingTime: time,
results: output,
heatRequirement: heat,
});
};
/**
* Add alloying recipe with create metallurgy
* @param {{item: 'tag'}|{fluid: 'tag', amount: number}[]} input
* @param {number} time
* @param {{item: 'tag'}|{fluid: 'tag', amount: number}[]} output
* @param {'no'|'heated'|'superheated'} heat
*/
let alloying = (input, time, output, heat) => {
event.custom({
type: "createmetallurgy:alloying",
ingredients: input,
processingTime: time,
results: output,
heatRequirement: heat,
});
};
Here it is! Now Create Metallurgy will be compatible with KubeJS. I will make a little wiki page to help people use it.
Here is the commit