Skip to content

Commit

Permalink
Improve docs for IRecipeSlotBuilder#addFluidStack
Browse files Browse the repository at this point in the history
  • Loading branch information
mezz committed Aug 11, 2024
1 parent e7edb34 commit 8ec38a2
Showing 1 changed file with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -94,4 +96,44 @@ <T> IRecipeSlotBuilder setCustomRenderer(
IIngredientType<T> ingredientType,
IIngredientRenderer<T> 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);
}

0 comments on commit 8ec38a2

Please sign in to comment.