GregTechCEu Modern

GregTechCEu Modern

6M Downloads

Custom KJS Multiblock generator energy dupe

Xefyr0 opened this issue ยท 1 comments

commented

Checked for existing issues

  • I have checked for existing issues, and have found none.

Tested latest version

  • I have checked that this occurs on the latest version.

GregTech CEu Version

v1.3.1

Minecraft Version

1.20.1

Recipe Viewer Installed

REI

Environment

Singleplayer

Cross-Mod Interaction

No

Other Installed Mods

KubeJS, GTCEu, Jade, REI, & their respective dependencies.
Reproducible in Monifactory Alpha.

Expected Behavior

When a custom KJS multiblock is running a recipe with any output EU/t, (For example, a custom generator) stalling the recipe due to insufficient output space in the Dynamo Hatch or insufficient energy in the Energy Hatch will not cause the recipe to lose progress.

Actual Behavior

Custom KJS Multiblocks that produce energy in a continuous stream while processing a recipe lose progress on the recipe when stalled. (due to, for example, a full dynamo hatch)
As a result, a player could intentionally choose to use a small Dynamo hatch, forcing the recipe to intentionally stall the recipe enough to keep the recipe from completing while generating energy, thus generating energy without the consumption of item or fluid inputs for the generator.

Steps to Reproduce

Startup & Server scripts used:
kjs_scripts.zip

Provide a Diamond Block to the input bus & some power to the Energy hatch. If the Dynamo hatch is a low enough tier, the hatch will eventually fill, halting recipe progress while still generating some amount of energy (Depending on the hatch tier)

Additional Information

No response

commented

Have you made absolutely sure that the issue you are experiencing is not just your multiblock completing the recipe as defined, but really, really slowly? Your recipe produces 16A of UV power, which would take an amusingly long time to complete with an LV dynamo hatch, even with continuous and unrestricted output.
Some other stuff to note/try, if you want:

  • You haven't set .generator(true) in your generator's definition, which is best practice for GTCEu's native EU generators, both simple and multiblock.
  • You may want to set .setEUIO(IO.BOTH) in your generator's recipe type definition, to let GTCEu know that you intend for this multiblock to both produce and consume energy.
  • If all else fails, set your recipe's .EUt() input and output to their respective amperage amounts in LV, your recipe duration to what it would be were it to be done at LV power and not UV (probably something around 104_857_600 ticks, still well below Integer.MAX_VALUE), and make the recipe overclockable, but only allow UV energy/dynamo hatches of the requisite amperages in your multiblock structure via filtering BlockPredicates.
  • Heck, even just limiting the tier of energy/dynamo hatches in your multiblock definition to only UV might go a long way to resolving this problem.

GTCEu Modern largely avoids this exact problem you are having by defining almost all EU generation recipes in terms of their energy output at LV tier. Those that are not, namely the plasma turbine recipes, are all at EV tier (1A EV, to be precise), and are generally not intended to be used with a dynamo hatch of any size smaller than 16A MV installed.