Skip to content

Commit

Permalink
Document the getCodec method (#3343)
Browse files Browse the repository at this point in the history
* Document the getCodec method

* Update fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/api/recipe/v1/ingredient/CustomIngredientSerializer.java
  • Loading branch information
apple502j authored Oct 1, 2023
1 parent e982ae8 commit 9650955
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.jetbrains.annotations.Nullable;

import net.minecraft.network.PacketByteBuf;
import net.minecraft.recipe.Ingredient;
import net.minecraft.util.Identifier;

import net.fabricmc.fabric.impl.recipe.ingredient.CustomIngredientImpl;
Expand Down Expand Up @@ -54,6 +55,14 @@ static CustomIngredientSerializer<?> get(Identifier identifier) {
*/
Identifier getIdentifier();

/**
* {@return the codec}.
*
* <p>Codecs are used to read the ingredient from the recipe JSON files.
*
* @see Ingredient#ALLOW_EMPTY_CODEC
* @see Ingredient#DISALLOW_EMPTY_CODEC
*/
Codec<T> getCodec(boolean allowEmpty);

/**
Expand Down

0 comments on commit 9650955

Please sign in to comment.