From 8ec38a27b58537034aa4b84ce22e2ffcd94730a9 Mon Sep 17 00:00:00 2001 From: mezz Date: Sun, 11 Aug 2024 21:41:11 +0900 Subject: [PATCH] Improve docs for IRecipeSlotBuilder#addFluidStack --- .../api/gui/builder/IRecipeSlotBuilder.java | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/CommonApi/src/main/java/mezz/jei/api/gui/builder/IRecipeSlotBuilder.java b/CommonApi/src/main/java/mezz/jei/api/gui/builder/IRecipeSlotBuilder.java index d5c19f852..f3244570d 100644 --- a/CommonApi/src/main/java/mezz/jei/api/gui/builder/IRecipeSlotBuilder.java +++ b/CommonApi/src/main/java/mezz/jei/api/gui/builder/IRecipeSlotBuilder.java @@ -7,6 +7,8 @@ import mezz.jei.api.ingredients.IIngredientType; import mezz.jei.api.recipe.category.IRecipeCategory; import mezz.jei.api.registration.IModIngredientRegistration; +import net.minecraft.core.component.DataComponentPatch; +import net.minecraft.world.level.material.Fluid; import org.jetbrains.annotations.ApiStatus; /** @@ -94,4 +96,44 @@ IRecipeSlotBuilder setCustomRenderer( IIngredientType ingredientType, IIngredientRenderer ingredientRenderer ); + + /** + * Convenience helper to add one Fluid ingredient. + * + * To add multiple Fluid ingredients, you can call this multiple times. + * + * By default, fluids amounts below 1000 (i.e. one bucket) are rendered using a partial sprite, + * and fluid amounts above 1000 are rendered using a full sprite. + * + * The default renderer can be tweaked using {@link #setFluidRenderer}. + * For example, {@code .setFluidRenderer(1, false, 16, 16)} to always draw a full 16x16 sprite + * even if there is only a little fluid. + * + * To completely customize rendering, see {@link #setCustomRenderer(IIngredientType, IIngredientRenderer)} + * + * @see #addFluidStack(Fluid, long, DataComponentPatch) to add a Fluid with a {@link DataComponentPatch}. + * @since 11.1.0 + */ + @Override + IRecipeSlotBuilder addFluidStack(Fluid fluid, long amount); + + /** + * Convenience helper to add one Fluid ingredient with a {@link DataComponentPatch}. + * + * To add multiple Fluid ingredients, you can call this multiple times. + * + * By default, fluids amounts below 1000 (i.e. one bucket) are rendered using a partial sprite, + * and fluid amounts above 1000 are rendered using a full sprite. + * + * The default renderer can be tweaked using {@link #setFluidRenderer}. + * For example, {@code .setFluidRenderer(1, false, 16, 16)} to always draw a full 16x16 sprite + * even if there is only a little fluid. + * + * To completely customize rendering, see {@link #setCustomRenderer(IIngredientType, IIngredientRenderer)} + * + * @see #addFluidStack(Fluid, long) to add a Fluid without a {@link DataComponentPatch}. + * @since 18.0.0 + */ + @Override + IRecipeSlotBuilder addFluidStack(Fluid fluid, long amount, DataComponentPatch component); }