GregTechCEu / GregTech-Modern

GregTech CE Unofficial for modern versions
GNU Lesser General Public License v3.0
268 stars 162 forks source link

Builder option for weighted outputs #1942

Closed JuiceyBeans closed 2 weeks ago

JuiceyBeans commented 2 weeks ago

Cross-mod Integration

No

Feature Description

A builder option that lets you add weighted outputs for recipes

.weightedOutput(ingredient, weight)

The ability to add bonus rolls, while not necessary, would be useful to have

Example:

ASSEMBLER_RECIPES.recipeBuilder("test_recipe")
                .inputItems(Items.DIRT)
                .weightedOutput(Items.SAND, 9)
                .weightedOutput(Items.DIAMOND, 1)
                .circuitMeta(1)
                .duration(200).EUt(VA[LV]).save(provider);

Would generate a recipe with 90% chance to output dirt and 10% chance to output a diamond

screret commented 2 weeks ago

wait this is actually possible sorry

JuiceyBeans commented 2 weeks ago

bro

screret commented 2 weeks ago

do .chancedItemOutputLogic(ChanceLogic.XOR) and then add the outputs as normal

JuiceyBeans commented 2 weeks ago

Do it support weights?