CraftTweaker

CraftTweaker

151M Downloads

Request for a new event to be fired immediately before actions are applied

codetaylor opened this issue ยท 1 comments

commented

What:

I would like to add a CraftTweaker (CrT) event that is fired from CrT's onPostInit, immediately before any actions are applied.

Why:

My mod Artisan Worktables (AW) provides a convenient way to copy recipes. In an attempt to ensure that all recipes are available when the copy code runs, I used an ugly hack into CrT. I inserted a custom Action into the MCRecipeManager.recipesToRemove collection at index 0. This ensured that my copy code would run first, before CrT deleted any recipes.

Since 957e003, I can no longer use this ugly approach because, as you can see, the MCRecipeManager.recipesToRemove collection is no longer resolved first.

I have fallen back to hooking the ScriptRunEvent.Post event, but mods that create recipes after CrT fires this event are not being properly copied: codetaylor/artisan-worktables-1.12#132.

How:

I am inquiring about adding a new event, something like ActionResolutionEvent.Pre that would be fired immediately before CrT's action resolution in onPostInit here. This would allow the AW recipe copy code to execute at the latest possible moment, immediately before any recipes are removed by CrT.

Thank you for your time.

commented

@jaredlll08 Thank you very much!