Class IngredientTypeAdapter

All Implemented Interfaces:
RegistryAdapter<net.minecraft.resources.Identifier, IngredientTypeAdapter.IngredientType>

public class IngredientTypeAdapter extends GenericRegistryAdapter<IngredientTypeAdapter.IngredientType>
A registry adapter that can register new types of ingredients.
  • Constructor Details

  • Method Details

    • add

      public <T extends IngredientLogic<T>> RegistryReference<net.minecraft.resources.Identifier, IngredientTypeAdapter.IngredientType> add(String key, com.mojang.serialization.MapCodec<T> codec, net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, T> stream)
      Adds a new type of ingredient to the game.
      Type Parameters:
      T - The type of the ingredient logic.
      Parameters:
      key - The ID to register the value under. This ID only needs to be unique within your namespace.
      codec - A map codec that constructs the ingredient logic from map data like JSON.
      stream - A ByteBuf codec that constructs the ingredient logic from network data.
      Returns:
      A reference to the registry entry.