TarantelTM / Recipe-GUI

1 stars 1 forks source link

[Request] Multiple recipes on one script #2

Open BitBlitObviMormon opened 2 years ago

BitBlitObviMormon commented 2 years ago

Currently script files that already exist are overwritten by a script containing one line of code. I request that a recipe be appended to the end of the specified script if it doesn't already exist on that script (so we don't have hundreds of loose recipe files).

TarantelTM commented 1 year ago

Will add this Feature in the next updates soon.

BitBlitObviMormon commented 1 year ago

Since I reckon reading code and interpreting the recipes to check for duplicates would be painfully slow, one possible option to make things easier is to append ZenScript comments that are used internally by CraftTweaker-GUI to identify scripts it generated and detect duplicates. For instance, CraftTweaker-GUI could generate a hash from the recipe each time it generates a script and if it finds a hash in the comments that matches the one it just generated then that would mean that the recipes are duplicates. I reckon these hashes could also be used for recipe naming so that you never end up with duplicate recipe names no matter which file they're on (unless somebody created the same recipe on two different files).

An example of this could be an SHA1 hash from a shaped dirt to diamond recipe: "minecraft:shaped; minecraft:diamond; [minecraft:dirt, minecraft:dirt, minecraft:dirt, minecraft:dirt, minecraft:dirt, minecraft:dirt, minecraft:dirt, minecraft:dirt, minecraft:dirt]" => 6a8122d370825bb6bf6cc7fed92d13e30cdf6c95 This recipe will always generate this hash and the probability of generating the same hash from something else is extremely unlikely (basically never).

Though that would also mean you'd have to implement a way to edit recipes on your mod so that users don't have to edit the files manually and thereby invalidate the hash (make it look like a different recipe than it actually is).

TarantelTM commented 1 year ago

Yeah i cant confirm that i add this system in the future. The basic idea behind CraftTweaker GUI was to help new Modpack Devs with Recipes. Will try to do my best with my time.

TarantelTM commented 1 year ago

Currently script files that already exist are overwritten by a script containing one line of code. I request that a recipe be appended to the end of the specified script if it doesn't already exist on that script (so we don't have hundreds of loose recipe files).

Atm working on a new Categorysplit to support this. For CT and KubeJS oneline recipes. For basic JSON Recipes its not possible.

TarantelTM commented 1 year ago

Will also try to remove recipes/modify them. Or Tag support if the Mod allow it.

TarantelTM commented 1 year ago

But it will never be a full solution. CT and KubeJS are too complex to do this via a GUI ingame xD