Document the getCodec method ()

* Document the getCodec method

* Update fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/api/recipe/v1/ingredient/CustomIngredientSerializer.java
This commit is contained in:
apple502j 2023-10-01 20:36:57 +09:00 committed by GitHub
parent e982ae85ea
commit 9650955252
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,6 +20,7 @@ import com.mojang.serialization.Codec;
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;
@ -54,6 +55,14 @@ public interface CustomIngredientSerializer<T extends CustomIngredient> {
*/
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);
/**