Skip to content

Serializer

Properties

identifier

open override val identifier: ResourceLocation

The id this serializer is registered under; used to identify it in recipe JSON.

packetCodec

open override val packetCodec: StreamCodec<RegistryFriendlyByteBuf, ACustomDataIngredient>

The codec used to sync the ingredient to the client over the network.

Functions

getCodec

open override fun getCodec(allowEmpty: Boolean): MapCodec<ACustomDataIngredient>

The codec used to read the ingredient from recipe JSON files.

Parameters

  • allowEmpty: Whether an ingredient matching no items should be accepted, mirroring Ingredient.CODEC vs Ingredient.CODEC_NONEMPTY.