GregTechCEu Modern

GregTechCEu Modern

6M Downloads

Additional RecipeModifiers for KubeJS scripts, to enable custom machines and multiblocks to act like native machines and multiblocks.

AncientShotgun opened this issue · 0 comments

commented

Cross-mod Integration

KubeJS, Rhino

Feature Description

Currently, adding native RecipeModifiers that are not explicitly defined as RecipeModifier object instances to KubeJS custom multiblocks and machines is difficult if not downright impossible. Rhino cannot recognize RecipeModifier as a functional interface, and can therefore not convert 4-param 1-output methods such as GTRecipeModifiers.crackerOverclock or GTRecipeModifiers.multiSmelterParallelinto RecipeModifier instances. I have even tried script-level interface implementation à la
recmod-func-converter
but this causes fatal NoSuchMethodErrors to be thrown as Rhino struggles to instantiate the implicit JavaAdapter required to perform this task.

Is there an easier way/workaround to do this in JS? If there isn't, then I would like to request more RecipeModifiers, such that packdevs can apply overclocking and parallelization modifiers from native machines and multiblocks to theirs.
In particular, it would be convenient to have:

  1. A RecipeModifier that performs equivalently to SimpleGeneratorMachine::recipeModifier, but without the restriction of the metaMachine needing to be a simple generator (so generators of any size, single-block or multiblock, can use it). Implementing this one would also implicitly resolve both #1633 and #2015, if it works as I understand it to.
  2. A RecipeModifier for each unique CoilWorkableElectricMultiblockMachine-specific RecipeModifier method. These will probably still need to keep their metaMachine restriction.
  3. Maybe also an easier way for packmakers to create their own RecipeModifiers for deep custom functionality (stares pointedly at GT:NH waterline/Volcanus)

Many thanks in advance for taking this feature request into consideration.