CraftTweaker

CraftTweaker

151M Downloads

CraftTweaker recipe with Item giveBack AE2 Autocraft incompatibility

Fireztonez opened this issue ยท 7 comments

commented

Hello,
I have report to AE2 the fact of the autocraft system doesn't work with GiveBack and transformDamage recipe added by Crafttweaker, using item hoe is not pre-register for, and the issue have been closed because of the slightly hacky way CraftTweaker does this, so I want to know if this is possible to look that with AE2 dev possibly, question to get a fix for that, because this is really anoying and I'm pretty sure there have a way to get that fixed, without too mutch major performance issues, like Yueh say in is reply...

So, heres the issue I have open about that: AppliedEnergistics/Applied-Energistics-2#4047

After all, AE2 is into a lot of modpacks and Crafttweaker is in most good modpack, having a big issue like that closed without any change bothers me. So I think, question to get this fix, cooperation between AE2 dev and Crafttweaker dev can be good.

Thank's
Fireztonez

commented

@yueh
Regarding your slightly hacky comment:
It is correct, but only for one of two transformer types:

Crafttweaker has two so-called "ingredient transformer" classes, one called IItemTransformer and one called IItemTransformerNew

IItemTransformer
The old tranformer class is only used in .giveBack and does what you wrote above, it spawns the item to the player's inventory.
Honestly, that one is only there because of code compatibility to earlier versions, since this transformer is a function (IItemStack item, IPlayer byPlayer) => IItemStack that is supposed to literally set that slot in the crafting grid (since at that time, crafttweaker wanted to also support stuff like consuming more than one item at a time and so on).
This is the transformer that would not require compat as far as I am concerned.

IItemTransformerNew
Then there is the other transformer class IItemTransformerNew that is basically a function (IItemStack item) => IItemStack that is called by IRecipe#getRemainingItems(InventoryCrafting).

I do not know your autocrafting implementation, but does it call this method per craft or only once or not at all?

@Fireztonez
What you wrote in the CrT Discord lead me to believe that your used the new Transformer class, in other words <yourIngredient>.transformDamage() or <yourIngredient>.reuse()

commented

:o yeah my bad, I just see the Crafttweaker Github link goes to Documentations issue tracker...
Sorry for that!

commented

What crafttweaker github link? curseforge goes to the right place.

commented

@jaredlll08 I click on the GitHub link on the wiki, I just didn't think it will go on a documentation issue tracker. I will know for next time! I always have the crafttweaker wiki open, but the curseforge website I have to open and search for Crafttweaker. But anyways, this is not the subject of this issue!

commented

Yes, on my script we done in my main pack I do a transformDamage and yes, items always stay in crafting table. I have fixed my main script issue, because I used items I create my self with ContentTweaker with the function you give to me @kindlich but, the idea is to get that fixed.

If, like you say the giveBack is something slightly hacky I will try to avoid using it in the future and used more the reuse, transformDamage or transformNew... But now with AE2, no transformers work's at all with the auto-craft system. I think the less hacky ones should be possible to fixed without soo mutch performances issue...

commented

Transfered this issue to CraftTweaker since it's not related to the documentation

commented

I don't think there is a good way to deal with this in 1.12 as it stands, anything we add now would need to be supported and I just can't offer that support anymore (since I'm moving to 1.14, so no more 1.12 versions)