GregTechCEu / GregTech-Modern

GregTech CE Unofficial for modern versions
GNU Lesser General Public License v3.0
266 stars 157 forks source link

KJS Multiblocks cannot overclock #330

Closed ursamina closed 1 year ago

ursamina commented 1 year ago

GregTech CEu Version

1.0.11.a

Recipe Viewer Installed

EMI

Environment

Singleplayer

Cross-Mod Interaction

Yes

Expected Behavior

A custom recipe set to consume 16EU/t should overclock in a custom multiblock using a HV energy hatch to 256EU/t

Actual Behavior

The multiblock only consumes 16EU/t despite the overclock being possible

Steps to Reproduce

Define a custom multiblock using KubeJS with a custom recipe type, add a recipe to the multiblock with an EU/t many tiers below the maximum capacity of the machine, then supply items and power

Additional Information

I have set up parallel recipe support by loading GTRecipeModifiers, but multiblocks still do not overclock even without parallel logic. I've also tried using the overclock logic of the EBF, Multi Smelter etc, but the multiblock does not start the recipe if those classes are loaded

Yefancy commented 1 year ago

whats your script looks like?

ursamina commented 1 year ago

A recreation of the greenhouse from the community pack:

GTCEuStartupEvents.registry('gtceu:machine', event => {
    event.create('greenhouse', 'multiblock')
        .rotationState(RotationState.NON_Y_AXIS)
        .recipeType('greenhouse')
        .appearanceBlock(GTBlocks.MACHINE_CASING_ULV )
        .pattern(definition => FactoryBlockPattern.start()
            .aisle("#BBB#", "#BBB#", "#BBB#", "#BBB#")
            .aisle("BBBBB", "BDDDB", "B###B", "BGGGB")
            .aisle("BBBBB", "BDDDB", "B###B", "BGGGB")
            .aisle("BBBBB", "BDDDB", "B###B", "BGGGB")
            .aisle("#BBB#", "#BEB#", "#BBB#", "#BBB#")
            .where('E', Predicates.controller(Predicates.blocks(definition.get())))
            .where('D', Predicates.blocks("minecraft:dirt"))
            .where('G', Predicates.blocks("gtceu:tempered_glass"))
            .where('B', Predicates.blocks("gtceu:ulv_machine_casing").setMinGlobalLimited(5).or(Predicates.autoAbilities(definition.getRecipeType())))
            .where('#', Predicates.air())
            .build())
        .workableCasingRenderer("gtceu:block/casings/voltage/ulv/side","gtceu:block/multiblock/implosion_compressor", true)
})

For an example, I provide the multiblock with LuV power with an LuV energy hatch:

2023-09-05_17 46 43

and ask it to do a custom MV recipe on circuit 1, as defined below:

event.recipes.gtceu.greenhouse('recipe_id')
   .notConsumable('item')
   .itemInputs('items_to_input')
   .itemOutputs('items_to_output')
   .duration(1200).EUt(60)
   .circuit(1)

2023-09-05_17 46 35

It doesn't overclock, taking the full 60 seconds to carry out the recipe at MV tier. I might be missing something to define the recipe as overclockable, or it might be necessary to tell the multiblock it's eligible for overclocking?

ursamina commented 1 year ago

My bad I have butter fingers anyway

Yefancy commented 1 year ago
.recipeModifier(GTRecipeModifiers.ELECTRIC_OVERCLOCK.apply(OverclockingLogic.NON_PERFECT_OVERCLOCK))

did you add it?

com.gregtechceu.gtceu.common.data.GTRecipeModifiers com.gregtechceu.gtceu.api.recipe.OverclockingLogic

screret commented 1 year ago

could you test again this with the latest release?

ursamina commented 1 year ago

Still occurs on latest release, multiblock does not overclock

.recipeModifier(GTRecipeModifiers.ELECTRIC_OVERCLOCK.apply(OverclockingLogic.NON_PERFECT_OVERCLOCK))

did you add it?

com.gregtechceu.gtceu.common.data.GTRecipeModifiers com.gregtechceu.gtceu.api.recipe.OverclockingLogic

Additionally tried this on latest release and provides the same result as the previous release