GregTechCEu / GregTech-Modern

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

Custom KJS Multiblock generator energy dupe #1633

Open Xefyr0 opened 2 months ago

Xefyr0 commented 2 months ago

Checked for existing issues

Tested 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

AncientShotgun commented 1 week ago

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:

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.