NovaEngineering-Source / ModularMachinery-Community-Edition

Customize your machinery with more powerful features.
https://www.curseforge.com/minecraft/mc-mods/modularmachinery-community-edition
GNU General Public License v3.0
28 stars 12 forks source link

[Suggestion] Add fixed times to consume item #25

Closed RenanVieira88 closed 1 year ago

RenanVieira88 commented 1 year ago

A exemple:

{ "type": "item", "io-type": "input", "item": "contenttweaker:random_item", "amount": 1, "TimesRecipeMustBeExecutedToConsume": 1600 },

In this exemple, the Recipe must be executed (with results) 1600 to get consume the input Item

KasumiNova commented 1 year ago

Nice idea, consider added in R40.

RenanVieira88 commented 1 year ago

That's a great news

My workaroud for now is:

{ "machine": "fission", "registryName": "uranium", "recipeTime": 4, "requirements": [ { "type": "item", "io-type": "input", "item": "contenttweaker:cell_uranium", "chance": 0.0001 }, { "type": "fluid", "io-type": "input", "fluid": "coolant", "amount": 400 }, { "type": "fluid", "io-type": "output", "fluid": "hot_coolant", "amount": 400 }, { "type": "item", "io-type": "output", "item": "contenttweaker:cell_uranium_depleded", "chance": 0.0001 } ] }

So the main idea is: Uranium rod has consumed > after 4 ticks the machine spells 400mb of hot coolant and consume 400mb of coolant

It would be nice to put the uranium to be consumed at the beginning of the recipe, during the determined time (in this case 1600 ticks) it would continue consuming the 400mb of coolant every 4 ticks but not the uranium, and at the end of the 1600 ticks it would give an item like depleted uranium

Not sure if I

KasumiNova commented 1 year ago

If you use ZenScript to write recipes, you can use addFluidPerTickInput(<liquid:xxx>) to make each Tick consume fluid. Also support addFluidPerTickOutput(<liquid:xxx>).

RenanVieira88 commented 1 year ago

Hi, I've try this:

val uranim = mods.modularmachinery.RecipeBuilder.newBuilder("uranim", "fision", 200, 0);

uranim.addFluidPerTickInput(<liquid:coolant>);
uranim.addFluidPerTickOutput(<liquid:hot_coolant>);
uranim.addItemInput(<contenttweaker:cell_uranium>);
uranim.addItemOutput(<contenttweaker:cell_uranium_depleded>);

uranim.build();

Also add *400 to fluids, but does't work, I did something wrong?

RenanVieira88 commented 1 year ago

Nevermind, I've write the name of machine wrong.... :D

Works great!!!!!!!!!