Make thermal recipes easier to automate

This commit is contained in:
oitsjustjose 2022-08-06 01:04:41 -05:00
commit 37ecfbe5af

View file

@ -1,9 +1,9 @@
// Gate Thermal behind IE and Brass Age // Gate Thermal behind IE and Brass Age
/** onEvent('recipes', event => {
* @param {Internal.RecipeEventJS} event const CustomRecipeHandler = global.recipes(event);
*/
const redstoneServoRecipes = event => { const redstoneServoRecipes = () => {
const ins = Item.of('kubejs:incomplete_redstone_servo'); const ins = Item.of('kubejs:incomplete_redstone_servo');
// Hard recipe for these // Hard recipe for these
event.recipes.create event.recipes.create
@ -33,10 +33,7 @@ const redstoneServoRecipes = event => {
event.recipes.thermal.press('thermal:redstone_servo', [ins, '2x minecraft:piston']); event.recipes.thermal.press('thermal:redstone_servo', [ins, '2x minecraft:piston']);
}; };
/** const rfCoilRecipes = () => {
* @param {Internal.RecipeEventJS} event
*/
const rfCoilRecipes = event => {
const irc = Item.of('kubejs:incomplete_rf_coil'); const irc = Item.of('kubejs:incomplete_rf_coil');
event.recipes.create event.recipes.create
.sequenced_assembly( .sequenced_assembly(
@ -65,289 +62,201 @@ const rfCoilRecipes = event => {
event.recipes.thermal.press('thermal:rf_coil', [irc, '2x #forge:plates/gold']); event.recipes.thermal.press('thermal:rf_coil', [irc, '2x #forge:plates/gold']);
}; };
const machineRecipes = () => {
/** /**
* * @param {Internal.ItemStackJS} output
* @param {Internal.RecipeEventJS} event * @param {Internal.ItemStackJS[]} inputs
*/ */
const machineRecipes = event => { const fromTemplate = (output, inputs) => {
const CustomRecipeHandler = global.recipes(event); if (inputs.length !== 6) {
console.log(
`Inputs must contain 6 items from top-left to bottom-right. Contains ${inputs.length} items...`
);
return;
}
/* Rubber */ event.remove({output: output});
event.remove({output: 'thermal:rubber'}); CustomRecipeHandler.giant(output, ['SABCS', 'SRFLS', 'SXYZS', 'SIIIS'], {
// Latex -> Rubber recipe using IF S: {tag: 'immersiveengineering:scaffoldings/steel'},
event.recipes.thermal.chiller('thermal:rubber', [Fluid.of('industrialforegoing:latex', 100)]); I: {item: 'immersiveengineering:sheetmetal_iron'},
event.recipes.thermal.press('pneumaticcraft:plastic', ['3x thermal:rubber']); R: {item: 'immersiveengineering:rs_engineering'},
F: {item: 'thermal:machine_frame'},
L: {item: 'immersiveengineering:light_engineering'},
A: inputs[0].toJson(),
B: inputs[1].toJson(),
C: inputs[2].toJson(),
X: inputs[3].toJson(),
Y: inputs[4].toJson(),
Z: inputs[5].toJson(),
});
};
// Pulverizer
fromTemplate(Item.of('thermal:machine_pulverizer'), [
Item.of('minecraft:hopper'),
Item.of('minecraft:hopper'),
Item.of('minecraft:hopper'),
Item.of('create:crushing_wheel'),
Item.of('immersiveengineering:steel_fence'),
Item.of('create:crushing_wheel'),
]);
// Redstone Furnace
fromTemplate(Item.of('thermal:machine_furnace'), [
Item.of('minecraft:smoker'),
Item.of('minecraft:furnace'),
Item.of('minecraft:blast_furnace'),
Item.of('immersiveengineering:furnace_heater'),
Item.of('immersiveengineering:furnace_heater'),
Item.of('immersiveengineering:furnace_heater'),
]);
// Induction Smelter
fromTemplate(Item.of('thermal:machine_smelter'), [
Item.of('immersiveengineering:graphite_electrode'),
Item.of('immersiveengineering:graphite_electrode'),
Item.of('immersiveengineering:graphite_electrode'),
Item.of('immersiveengineering:alloybrick'),
Item.of('immersiveengineering:heavy_engineering'),
Item.of('immersiveengineering:alloybrick'),
]);
// Sawmill
fromTemplate(Item.of('thermal:machine_sawmill'), [
Item.of('create:mechanical_saw'),
Item.of('create:mechanical_saw'),
Item.of('create:mechanical_saw'),
Item.of('create:belt_connector'),
Item.of('create:belt_connector'),
Item.of('create:belt_connector'),
]);
// Phytogenic Insolator
fromTemplate(Item.of('thermal:machine_insolator'), [
Item.of('#forge:ingots/lumium'),
Item.of('#forge:ingots/lumium'),
Item.of('#forge:ingots/lumium'),
Item.of('farmersdelight:rich_soil'),
Item.of('immersiveengineering:cloche'),
Item.of('farmersdelight:rich_soil'),
]);
// Multiservo Press
fromTemplate(Item.of('thermal:machine_press'), [
Item.of('minecraft:piston'),
Item.of('create:mechanical_press'),
Item.of('minecraft:piston'),
Item.of('immersiveengineering:heavy_engineering'),
Item.of('create:depot'),
Item.of('immersiveengineering:heavy_engineering'),
]);
// Fluid Encapsulator
fromTemplate(Item.of('thermal:machine_bottler'), [
Item.of('create:fluid_tank'),
Item.of('create:spout'),
Item.of('create:fluid_tank'),
Item.of('create:depot'),
Item.of('immersiveengineering:heavy_engineering'),
Item.of('create:depot'),
]);
// Centrifuge
fromTemplate(Item.of('thermal:machine_centrifuge'), [
Item.of('pneumaticcraft:vacuum_pump'),
Item.of('create:rotation_speed_controller'),
Item.of('pneumaticcraft:vacuum_pump'),
Item.of('pneumaticcraft:pressure_gauge'),
Item.of('pneumaticcraft:pressure_gauge'),
Item.of('pneumaticcraft:pressure_gauge'),
]);
// Blast Chiller
fromTemplate(Item.of('thermal:machine_chiller'), [
Item.of('create:encased_fan'),
Item.of('create:encased_fan'),
Item.of('create:encased_fan'),
Item.of('architects_palette:moonstone'),
Item.of('architects_palette:moonstone'),
Item.of('architects_palette:moonstone'),
]);
// Magma Crucible
fromTemplate(Item.of('thermal:machine_crucible'), [
Item.of('architects_palette:sunstone'),
Item.of('architects_palette:sunstone'),
Item.of('architects_palette:sunstone'),
Item.of('create:encased_fan'),
Item.of('create:encased_fan'),
Item.of('create:encased_fan'),
]);
// Fractionating Still
fromTemplate(Item.of('thermal:machine_refinery'), [
Item.of('pneumaticcraft:refinery_output'),
Item.of('pneumaticcraft:refinery'),
Item.of('pneumaticcraft:refinery_output'),
Item.of('immersiveengineering:heavy_engineering'),
Item.of('immersiveengineering:heavy_engineering'),
Item.of('immersiveengineering:heavy_engineering'),
]);
// Pyrolizer
fromTemplate(Item.of('thermal:machine_pyrolyzer'), [
Item.of('immersiveengineering:cokebrick'),
Item.of('immersiveengineering:cokebrick'),
Item.of('immersiveengineering:cokebrick'),
Item.of('immersiveengineering:cokebrick'),
Item.of('immersiveengineering:cokebrick'),
Item.of('immersiveengineering:cokebrick'),
]);
// Imbuer
fromTemplate(Item.of('thermal:machine_brewer'), [
Item.of('create:mechanical_mixer'),
Item.of('create:mechanical_mixer'),
Item.of('create:mechanical_mixer'),
Item.of('create:basin'),
Item.of('minecraft:brewing_stand'),
Item.of('create:basin'),
]);
// Crafter
fromTemplate(Item.of('thermal:machine_crafter'), [
Item.of('create:mechanical_crafter'),
Item.of('create:mechanical_crafter'),
Item.of('create:mechanical_crafter'),
Item.of('create:mechanical_crafter'),
Item.of('create:mechanical_crafter'),
Item.of('create:mechanical_crafter'),
]);
};
event.remove({output: 'thermal:redstone_servo'});
event.remove({output: 'thermal:rf_coil'});
// Remove cheeky recipes for alloys
event.remove({input: 'minecraft:fire_charge', mod: 'thermal'});
event.remove({input: 'thermal:earth_charge'});
event.remove({output: 'thermal:drill_head'}); event.remove({output: 'thermal:drill_head'});
event.remove({output: 'thermal:saw_blade'}); event.remove({output: 'thermal:saw_blade'});
event.replaceInput({}, 'thermal:saw_blade', 'immersiveengineering:sawblade');
event.replaceInput({}, 'thermal:drill_head', 'immersiveengineering:drillhead_steel');
event.remove({output: 'thermal:rubber'});
event.recipes.thermal.chiller('thermal:rubber', [Fluid.of('industrialforegoing:latex', 100)]);
event.recipes.thermal.press('pneumaticcraft:plastic', ['3x thermal:rubber']);
event.replaceInput( event.replaceInput(
{output: 'thermal:enderium_dust'}, {output: 'thermal:enderium_dust'},
'#forge:ender_pearls', '#forge:ender_pearls',
'#forge:dusts/ender_pearl' '#forge:dusts/ender_pearl'
); );
const Items = {
furnace: {item: 'minecraft:furnace'},
furnaceHeater: {item: 'immersiveengineering:furnace_heater'},
hopper: {item: 'minecraft:hopper'},
lightEngineering: {item: 'immersiveengineering:light_engineering'},
heavyEngineering: {item: 'immersiveengineering:heavy_engineering'},
machineFrame: {item: 'thermal:machine_frame'},
rsEngineering: {item: 'immersiveengineering:rs_engineering'},
steelFence: {item: 'immersiveengineering:steel_fence'},
steelScaffold: {tag: 'immersiveengineering:scaffoldings/steel'},
kilnBrick: {item: 'immersiveengineering:alloybrick'},
blastFurnace: {item: 'minecraft:blast_furnace'},
ironSheetmetal: {item: 'immersiveengineering:sheetmetal_iron'},
conveyor: {item: 'immersiveengineering:conveyor_basic'},
piston: {item: 'minecraft:piston'},
};
// Pulverizer
event.remove({output: 'thermal:machine_pulverizer'});
CustomRecipeHandler.giant(
Item.of('thermal:machine_pulverizer'),
['SHHHS', 'RFCFL', 'SFFFL', 'SSLSL'],
{
C: Items.machineFrame,
F: Items.steelFence,
H: Items.hopper,
L: Items.lightEngineering,
R: Items.rsEngineering,
S: Items.steelScaffold,
}
);
// Redstone Furnace
event.remove({output: 'thermal:machine_furnace'});
CustomRecipeHandler.giant(
Item.of('thermal:machine_furnace'),
['ISBFI', 'IHCHI', 'IRHLI', 'IMMMI'],
{
B: Items.blastFurnace,
C: Items.machineFrame,
F: Items.furnace,
H: Items.furnaceHeater,
I: Items.steelScaffold,
L: Items.lightEngineering,
M: Items.ironSheetmetal,
R: Items.rsEngineering,
S: {item: 'minecraft:smoker'},
}
);
// Induction Smelter
event.remove({output: 'thermal:machine_smelter'});
CustomRecipeHandler.giant(
Item.of('thermal:machine_smelter'),
['SLRLS', 'SKFKS', 'SKKKS', 'SBBBS'],
{
B: Items.blastFurnace,
F: Items.machineFrame,
K: Items.kilnBrick,
L: Items.lightEngineering,
R: Items.rsEngineering,
S: Items.steelScaffold,
}
);
// Sawmill
event.remove({output: 'thermal:machine_sawmill'});
CustomRecipeHandler.giant(
Item.of('thermal:machine_sawmill'),
['SBBBS', 'SRFLS', 'SCCCS', 'SMMMS'],
{
B: {item: 'create:mechanical_saw'},
C: Items.conveyor,
F: Items.machineFrame,
L: Items.lightEngineering,
M: Items.ironSheetmetal,
R: Items.rsEngineering,
S: Items.steelScaffold,
}
);
// Phytogenic Insolator
event.remove({output: 'thermal:machine_insolator'});
CustomRecipeHandler.giant(
Item.of('thermal:machine_insolator'),
['SUUUS', 'SRFLS', 'SMCMS', 'SIIIS'],
{
C: {item: 'immersiveengineering:cloche'},
F: Items.machineFrame,
I: {item: 'farmersdelight:rich_soil'},
L: Items.lightEngineering,
M: Items.ironSheetmetal,
R: Items.rsEngineering,
S: Items.steelScaffold,
U: {tag: 'forge:ingots/lumium'},
}
);
// Multiservo Press
event.remove({output: 'thermal:machine_press'});
CustomRecipeHandler.giant(
Item.of('thermal:machine_press'),
['SPOPS', 'SRFLS', 'SDDDS', 'SMMMS'],
{
D: {item: 'create:depot'},
F: Items.machineFrame,
L: Items.lightEngineering,
M: Items.ironSheetmetal,
O: {item: 'create:mechanical_press'},
P: Items.piston,
R: Items.rsEngineering,
S: Items.steelScaffold,
}
);
// Fluid Encapsulator
event.remove({output: 'thermal:machine_bottler'});
CustomRecipeHandler.giant(
Item.of('thermal:machine_bottler'),
['SPPPS', 'SRFLS', 'SDDDS', 'SMMMS'],
{
D: {item: 'create:item_drain'},
F: Items.machineFrame,
L: Items.lightEngineering,
M: Items.ironSheetmetal,
P: {item: 'create:spout'},
R: Items.rsEngineering,
S: Items.steelScaffold,
}
);
// Centrifuge
event.remove({output: 'thermal:machine_centrifuge'});
CustomRecipeHandler.giant(
Item.of('thermal:machine_centrifuge'),
['STOTS', 'SRFLS', 'SGGGS', 'SMMMS'],
{
F: Items.machineFrame,
G: {item: 'pneumaticcraft:pressure_gauge'},
L: Items.lightEngineering,
M: Items.ironSheetmetal,
O: {item: 'create:rotation_speed_controller'},
R: Items.rsEngineering,
S: Items.steelScaffold,
T: {item: 'pneumaticcraft:vacuum_pump'},
}
);
// Blast Chiller
event.remove({output: 'thermal:machine_chiller'});
CustomRecipeHandler.giant(
Item.of('thermal:machine_chiller'),
['SIIIS', 'SRFLS', 'SEEES', 'SMMMS'],
{
E: {item: 'create:encased_fan'},
F: Items.machineFrame,
I: {item: 'minecraft:packed_ice'},
L: Items.lightEngineering,
M: {item: 'architects_palette:moonstone'},
R: Items.rsEngineering,
S: Items.steelScaffold,
}
);
// Magma Crucible
event.remove({output: 'thermal:machine_crucible'});
CustomRecipeHandler.giant(
Item.of('thermal:machine_crucible'),
['SIIIS', 'SRFLS', 'SEEES', 'SMMMS'],
{
E: {item: 'create:encased_fan'},
F: Items.machineFrame,
I: {item: 'minecraft:lava_bucket'},
L: Items.lightEngineering,
M: {item: 'architects_palette:sunstone'},
R: Items.rsEngineering,
S: Items.steelScaffold,
}
);
// Fractionating Still
event.remove({output: 'thermal:machine_refinery'});
CustomRecipeHandler.giant(
Item.of('thermal:machine_refinery'),
['SBABS', 'SRFLS', 'SHHHS', 'SMMMS'],
{
A: {item: 'pneumaticcraft:refinery'},
B: {item: 'pneumaticcraft:refinery_output'},
F: Items.machineFrame,
H: Items.heavyEngineering,
L: Items.lightEngineering,
M: Items.ironSheetmetal,
R: Items.rsEngineering,
S: Items.steelScaffold,
}
);
// Pyrolizer
event.remove({output: 'thermal:machine_pyrolyzer'});
CustomRecipeHandler.giant(
Item.of('thermal:machine_pyrolyzer'),
['SCCCS', 'SRFLS', 'SCCCS', 'SMMMS'],
{
C: {item: 'immersiveengineering:cokebrick'},
F: Items.machineFrame,
L: Items.lightEngineering,
M: Items.ironSheetmetal,
R: Items.rsEngineering,
S: Items.steelScaffold,
}
);
// Imbuer
event.remove({output: 'thermal:machine_brewer'});
CustomRecipeHandler.giant(
Item.of('thermal:machine_brewer'),
['SXXXS', 'SRFLS', 'SBWBS', 'SMMMS'],
{
B: {item: 'create:basin'},
F: Items.machineFrame,
L: Items.lightEngineering,
M: Items.ironSheetmetal,
R: Items.rsEngineering,
S: Items.steelScaffold,
W: {item: 'minecraft:brewing_stand'},
X: {item: 'create:mechanical_mixer'},
}
);
// Crafter
event.remove({output: 'thermal:machine_crafter'});
CustomRecipeHandler.giant(
Item.of('thermal:machine_crafter'),
['SMMMS', 'SRFLS', 'SMMMS', 'SHHHS'],
{
F: Items.machineFrame,
H: Items.heavyEngineering,
L: Items.lightEngineering,
M: {item: 'create:mechanical_crafter'},
R: Items.rsEngineering,
S: Items.steelScaffold,
}
);
};
const itemRecipes = event => {
// Remove cheeky recipes for alloys
event.remove({input: 'minecraft:fire_charge', mod: 'thermal'});
event.replaceInput({}, 'thermal:saw_blade', 'immersiveengineering:sawblade');
event.replaceInput({}, 'thermal:drill_head', 'immersiveengineering:drillhead_steel');
event.remove({output: 'thermal:redstone_servo'});
event.remove({output: 'thermal:rf_coil'});
event.remove({input: 'thermal:earth_charge'});
redstoneServoRecipes(event);
rfCoilRecipes(event);
};
onEvent('recipes', event => {
event.remove({id: 'thermal:machines/pulverizer/pulverizer_diamond_armor'}); event.remove({id: 'thermal:machines/pulverizer/pulverizer_diamond_armor'});
event.recipes.thermal.pulverizer('minecraft:diamond', '#forge:armor/diamond'); event.recipes.thermal.pulverizer('minecraft:diamond', '#forge:armor/diamond');
machineRecipes(event);
itemRecipes(event); redstoneServoRecipes();
rfCoilRecipes();
machineRecipes();
}); });