Package net.minecraft.recipe
Class SpecialRecipeSerializer<T extends Recipe<?>>
java.lang.Object
net.minecraft.recipe.SpecialRecipeSerializer<T>
- All Implemented Interfaces:
RecipeSerializer<T>
public class SpecialRecipeSerializer<T extends Recipe<?>>
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 cdcintermediary net/minecraft/class_1866named net/minecraft/recipe/SpecialRecipeSerializer
-
Field Summary
FieldsFields inherited from interface net.minecraft.recipe.RecipeSerializer
ARMOR_DYE, BANNER_DUPLICATE, BLASTING, BOOK_CLONING, CAMPFIRE_COOKING, FIREWORK_ROCKET, FIREWORK_STAR, FIREWORK_STAR_FADE, MAP_CLONING, MAP_EXTENDING, REPAIR_ITEM, SHAPED, SHAPELESS, SHIELD_DECORATION, SHULKER_BOX, SMELTING, SMITHING, SMOKING, STONECUTTING, SUSPICIOUS_STEW, TIPPED_ARROW -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionread(Identifier id, JsonObject json) Reads a recipe from a JSON object.read(Identifier id, PacketByteBuf buf) Reads a recipe from a packet byte buf, usually on the client.voidwrite(PacketByteBuf buf, T recipe) Writes a recipe to a packet byte buf, usually on the server.
-
Field Details
-
factory
- Mappings:
Namespace Name Mixin selector official vLcdc;v:Ljava/util/function/Function;intermediary field_9046Lnet/minecraft/class_1866;field_9046:Ljava/util/function/Function;named factoryLnet/minecraft/recipe/SpecialRecipeSerializer;factory:Ljava/util/function/Function;
-
-
Constructor Details
-
SpecialRecipeSerializer
- Mappings:
Namespace Name Mixin selector official <init>Lcdc;<init>(Ljava/util/function/Function;)Vintermediary <init>Lnet/minecraft/class_1866;<init>(Ljava/util/function/Function;)Vnamed <init>Lnet/minecraft/recipe/SpecialRecipeSerializer;<init>(Ljava/util/function/Function;)V
-
-
Method Details
-
read
Reads a recipe from a JSON object.- Specified by:
readin interfaceRecipeSerializer<T extends Recipe<?>>- Parameters:
id- the recipe's IDjson- the recipe JSON- Returns:
- the read recipe
- Mappings:
Namespace Name Mixin selector official aLccu;a(Laaj;Lcom/google/gson/JsonObject;)Lccs;intermediary method_8121Lnet/minecraft/class_1865;method_8121(Lnet/minecraft/class_2960;Lcom/google/gson/JsonObject;)Lnet/minecraft/class_1860;named readLnet/minecraft/recipe/RecipeSerializer;read(Lnet/minecraft/util/Identifier;Lcom/google/gson/JsonObject;)Lnet/minecraft/recipe/Recipe;
-
read
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:
readin interfaceRecipeSerializer<T extends Recipe<?>>- Parameters:
id- the recipe's IDbuf- the recipe buf- Returns:
- the read recipe
- Mappings:
Namespace Name Mixin selector official aLccu;a(Laaj;Lqx;)Lccs;intermediary method_8122Lnet/minecraft/class_1865;method_8122(Lnet/minecraft/class_2960;Lnet/minecraft/class_2540;)Lnet/minecraft/class_1860;named readLnet/minecraft/recipe/RecipeSerializer;read(Lnet/minecraft/util/Identifier;Lnet/minecraft/network/PacketByteBuf;)Lnet/minecraft/recipe/Recipe;
-
write
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:
writein interfaceRecipeSerializer<T extends Recipe<?>>- Parameters:
buf- the recipe bufrecipe- the recipe- Mappings:
Namespace Name Mixin selector official aLccu;a(Lqx;Lccs;)Vintermediary method_8124Lnet/minecraft/class_1865;method_8124(Lnet/minecraft/class_2540;Lnet/minecraft/class_1860;)Vnamed writeLnet/minecraft/recipe/RecipeSerializer;write(Lnet/minecraft/network/PacketByteBuf;Lnet/minecraft/recipe/Recipe;)V
-