Class SpecialRecipeSerializer<T extends CraftingRecipe>

java.lang.Object
net.minecraft.recipe.SpecialRecipeSerializer<T>
All Implemented Interfaces:
RecipeSerializer<T>

public class SpecialRecipeSerializer<T extends CraftingRecipe> extends Object implements RecipeSerializer<T>
A serializer for hardcoded recipes. The recipes with this serializer don't transport any extra data besides their ID when read from JSON or synchronized over network.

The name "special" comes from the fact that in vanilla, recipes using this serializer have IDs starting with crafting_special_. All of their logic and ingredients are also defined in code, which distinguishes them from "non-special" recipes.

Mappings:
Namespace Name
official cmu
intermediary net/minecraft/class_1866
named net/minecraft/recipe/SpecialRecipeSerializer
  • Field Details

    • factory

      private final SpecialRecipeSerializer.Factory<T extends CraftingRecipe> factory
      Mappings:
      Namespace Name Mixin selector
      official x Lcmu;x:Lcmu$a;
      intermediary field_9046 Lnet/minecraft/class_1866;field_9046:Lnet/minecraft/class_1866$class_7711;
      named factory Lnet/minecraft/recipe/SpecialRecipeSerializer;factory:Lnet/minecraft/recipe/SpecialRecipeSerializer$Factory;
    • codec

      private final com.mojang.serialization.Codec<T extends CraftingRecipe> codec
      Mappings:
      Namespace Name Mixin selector
      official y Lcmu;y:Lcom/mojang/serialization/Codec;
      intermediary field_46106 Lnet/minecraft/class_1866;field_46106:Lcom/mojang/serialization/Codec;
      named codec Lnet/minecraft/recipe/SpecialRecipeSerializer;codec:Lcom/mojang/serialization/Codec;
  • Constructor Details

    • SpecialRecipeSerializer

      public SpecialRecipeSerializer(SpecialRecipeSerializer.Factory<T> factory)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lcmu;<init>(Lcmu$a;)V
      intermediary <init> Lnet/minecraft/class_1866;<init>(Lnet/minecraft/class_1866$class_7711;)V
      named <init> Lnet/minecraft/recipe/SpecialRecipeSerializer;<init>(Lnet/minecraft/recipe/SpecialRecipeSerializer$Factory;)V
  • Method Details

    • codec

      public com.mojang.serialization.Codec<T> codec()
      Specified by:
      codec in interface RecipeSerializer<T extends CraftingRecipe>
      Mappings:
      Namespace Name Mixin selector
      official a Lcmm;a()Lcom/mojang/serialization/Codec;
      intermediary method_53736 Lnet/minecraft/class_1865;method_53736()Lcom/mojang/serialization/Codec;
      named codec Lnet/minecraft/recipe/RecipeSerializer;codec()Lcom/mojang/serialization/Codec;
    • read

      public T read(PacketByteBuf packetByteBuf)
      Description copied from interface: RecipeSerializer
      Reads a recipe from a packet byte buf, usually on the client.

      This can throw whatever exception the packet byte buf throws. This may be called in the netty event loop than the client game engine thread.

      Specified by:
      read in interface RecipeSerializer<T extends CraftingRecipe>
      Returns:
      the read recipe
      Mappings:
      Namespace Name Mixin selector
      official b Lcmu;b(Lso;)Lclz;
      intermediary method_45444 Lnet/minecraft/class_1866;method_45444(Lnet/minecraft/class_2540;)Lnet/minecraft/class_3955;
      named read Lnet/minecraft/recipe/SpecialRecipeSerializer;read(Lnet/minecraft/network/PacketByteBuf;)Lnet/minecraft/recipe/CraftingRecipe;
    • write

      public void write(PacketByteBuf packetByteBuf, T t)
      Description copied from interface: RecipeSerializer
      Writes a recipe to a packet byte buf, usually on the server.

      The recipe's ID is already written into the buf when this is called.

      This can throw whatever exception the packet byte buf throws. This may be called in the netty event loop than the server game engine thread.

      Specified by:
      write in interface RecipeSerializer<T extends CraftingRecipe>
      Parameters:
      packetByteBuf - the recipe buf
      t - the recipe
      Mappings:
      Namespace Name Mixin selector
      official a Lcmu;a(Lso;Lclz;)V
      intermediary method_45442 Lnet/minecraft/class_1866;method_45442(Lnet/minecraft/class_2540;Lnet/minecraft/class_3955;)V
      named write Lnet/minecraft/recipe/SpecialRecipeSerializer;write(Lnet/minecraft/network/PacketByteBuf;Lnet/minecraft/recipe/CraftingRecipe;)V