Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional compat for Super Factory Manager #951

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions kubejs/server_scripts/mods/optionalCompats/sfm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// SFM compact script. Gated behind HV circuits and some chemistry, but recipes can be made in MV machines
if (Platform.isLoaded('sfm')) {
console.log('SuperFactoryManager found, loading compat scripts...');

ServerEvents.recipes((event) => {
// Remove most SFM recipes
for (const recipe of [
'sfm:manager',
'sfm:cable',
'sfm:water_tank',
'sfm:disk',
'sfm:labelgun',
'sfm:network_tool',
'sfm:xp_goop',
]) {
event.remove({ output: recipe });
}

// Remove copying of enchanted books
event.remove({id:'sfm:enchanted_book_copy'});

// Re-add Inventory Cable
event.recipes.gtceu
.assembler('kubejs:sfm_cable')
.itemOutputs('8x sfm:cable')
.itemInputs([
'gtceu:cupronickel_large_item_pipe',
'gtceu:aluminium_large_fluid_pipe',
'4x minecraft:iron_bars',
])
.inputFluids(Fluid.of('gtceu:black_steel', 288))
.duration(100)
.EUt(120);

// Factory Manager
event.recipes.gtceu
.assembler('kubejs:sfm_manager')
.itemOutputs('1x sfm:manager')
.itemInputs([
'4x sfm:cable',
'2x gtceu:mv_fluid_regulator',
'2x gtceu:mv_robot_arm',
'2x #gtceu:circuits/hv',
])
.duration(200)
.EUt(120);

// Factory Manager Program Disk
event.recipes.gtceu
.circuit_assembler('kubejs:sfm_disk')
.itemOutputs('4x sfm:disk')
.itemInputs([
'gtceu:ruby_plate',
'4x gtceu:ram_chip',
'2x gtceu:cpu_chip',
'kubejs:resonating_crystal',
'16x gtceu:fine_red_alloy_wire',
])
.duration(200)
.EUt(120);

// Label Gun
event.shaped('sfm:labelgun', [' EC', ' RS', 'R '], {
E: 'gtceu:mv_emitter',
C: 'gtceu:terminal',
R: 'gtceu:aluminium_rod',
S: 'gtceu:mv_sensor',
});

// Networking Tool
event.shaped('sfm:network_tool', [' T ', 'PSP', 'PCP'], {
T: 'gtceu:terminal',
P: '#forge:plates/black_steel',
C: 'gtceu:aluminium_single_wire',
S: 'gtceu:mv_sensor',
});
});

console.log('SFM compat scripts successfully loaded!');
}