Skip to content

Commit

Permalink
Recipe javadoc and getMatchingStacks fix (FabricMC#4018)
Browse files Browse the repository at this point in the history
  • Loading branch information
apple502j authored Oct 10, 2024
1 parent d65eac4 commit 23488c6
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 17 deletions.
6 changes: 3 additions & 3 deletions mappings/net/minecraft/recipe/Ingredient.mapping
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ CLASS net/minecraft/class_1856 net/minecraft/recipe/Ingredient
FIELD field_48355 PACKET_CODEC Lnet/minecraft/class_9139;
FIELD field_52595 OPTIONAL_PACKET_CODEC Lnet/minecraft/class_9139;
FIELD field_52596 ENTRIES_CODEC Lcom/mojang/serialization/Codec;
FIELD field_9018 matchingStacks Ljava/util/List;
FIELD field_9018 matchingItems Ljava/util/List;
FIELD field_9019 entries Lnet/minecraft/class_6885;
METHOD <init> (Lnet/minecraft/class_6885;)V
ARG 1 entries
Expand Down Expand Up @@ -31,7 +31,7 @@ CLASS net/minecraft/class_1856 net/minecraft/recipe/Ingredient
METHOD method_61680 (Lnet/minecraft/class_1856;)Lnet/minecraft/class_6885;
ARG 0 ingredient
METHOD method_64672 (Ljava/util/List;)Ljava/lang/Record;
ARG 0 displays
ARG 0 items
METHOD method_64673 toDisplay ()Lnet/minecraft/class_10302;
METHOD method_64980 toDisplay (Ljava/util/Optional;)Lnet/minecraft/class_10302;
ARG 0 ingredient
Expand All @@ -41,7 +41,7 @@ CLASS net/minecraft/class_1856 net/minecraft/recipe/Ingredient
ARG 0 items
METHOD method_8101 ofItem (Lnet/minecraft/class_1935;)Lnet/minecraft/class_1856;
ARG 0 item
METHOD method_8105 getMatchingStacks ()Ljava/util/List;
METHOD method_8105 getMatchingItems ()Ljava/util/List;
METHOD method_8106 fromTag (Lnet/minecraft/class_6885;)Lnet/minecraft/class_1856;
ARG 0 tag
METHOD test (Ljava/lang/Object;)Z
Expand Down
22 changes: 16 additions & 6 deletions mappings/net/minecraft/recipe/Recipe.mapping
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
CLASS net/minecraft/class_1860 net/minecraft/recipe/Recipe
COMMENT A recipe is an arrangement of item stacks in an inventory that can
COMMENT yield a product item stack.
COMMENT A recipe is an arrangement of items in an inventory that can
COMMENT yield a product item stack. <strong>Recipes are not used on the client side</strong>;
COMMENT the server syncs to the client a {@link RecipeDisplayEntry},
COMMENT which is used instead.
COMMENT
COMMENT <p>Recipes are loaded by and stored in the {@link RecipeManager}. They
COMMENT are part of the server's data packs and are sent to the client, governed
COMMENT by their {@linkplain #getSerializer() serializers}. Hence, recipes
COMMENT should not be stored, as they may become obsolete after reloads.
COMMENT <p>Recipes are loaded by and stored in the {@link ServerRecipeManager}. They
COMMENT are part of the server's data packs. Hence, recipes should not be stored,
COMMENT as they may become obsolete after reloads.
COMMENT
COMMENT <p>{@link RecipeEntry} is a pair of the recipe and its ID ({@linkplain
COMMENT net.minecraft.registry.RegistryKey a registry key}). The ID can be used to
COMMENT refer to recipes in saved data. However, the client does not receive the ID of
COMMENT recipes.
COMMENT
COMMENT <p>A few of the methods in this class are dedicated to crafting recipes
COMMENT or recipe books. Users can have stub implementations if they do not use
Expand All @@ -20,6 +26,10 @@ CLASS net/minecraft/class_1860 net/minecraft/recipe/Recipe
METHOD method_49188 showNotification ()Z
METHOD method_61671 getIngredientPlacement ()Lnet/minecraft/class_9887;
METHOD method_64664 getDisplays ()Ljava/util/List;
COMMENT {@link the list of recipe displays corresponding to the recipe}
COMMENT
COMMENT <p>Recipe displays are sent to the client and displayed in the recipe book.
COMMENT One recipe can have multiple displays.
METHOD method_64668 getRecipeBookTab ()Lnet/minecraft/class_10355;
METHOD method_8112 getGroup ()Ljava/lang/String;
COMMENT {@return a group this recipe belongs in, or an empty string} This is
Expand Down
3 changes: 2 additions & 1 deletion mappings/net/minecraft/recipe/RecipeDisplayEntry.mapping
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
CLASS net/minecraft/class_10297 net/minecraft/recipe/RecipeDisplayEntry
COMMENT A recipe that is synced to the clients. Note that this does not include
COMMENT the recipe's registry key.
COMMENT the recipe's ID; the recipe is instead referred to using {@link NetworkRecipeId},
COMMENT which is assigned at runtime.
FIELD field_54663 PACKET_CODEC Lnet/minecraft/class_9139;
METHOD method_64729 isCraftable (Lnet/minecraft/class_9875;)Z
ARG 1 finder
Expand Down
15 changes: 8 additions & 7 deletions mappings/net/minecraft/recipe/RecipeSerializer.mapping
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
CLASS net/minecraft/class_1865 net/minecraft/recipe/RecipeSerializer
COMMENT The recipe serializer controls the serialization and deserialization of
COMMENT recipe content. The caller should handle the serialization of recipes' IDs.
COMMENT The recipe serializer controls the deserialization of recipe content during
COMMENT data pack loading.
COMMENT
COMMENT <p>Even though they are referred to by the {@code type} field in recipe
COMMENT JSON format, they are stored in a registry with key
COMMENT {@code minecraft:root/minecraft:recipe_serializer}, and is hence named.
COMMENT
COMMENT <p>If a recipe's serializer exists only on the server but not on the
COMMENT client, the client will disconnect upon receiving the recipe; if a
COMMENT recipe JSON intended for an absent recipe serializer is read, it is
COMMENT skipped.
FIELD field_17084 BLASTING Lnet/minecraft/class_1865;
FIELD field_17085 SMOKING Lnet/minecraft/class_1865;
FIELD field_17347 CAMPFIRE_COOKING Lnet/minecraft/class_1865;
Expand All @@ -32,3 +27,9 @@ CLASS net/minecraft/class_1865 net/minecraft/recipe/RecipeSerializer
ARG 1 serializer
METHOD method_53736 codec ()Lcom/mojang/serialization/MapCodec;
METHOD method_56104 packetCodec ()Lnet/minecraft/class_9139;
COMMENT {@return the packet codec for serializing recipes over the network}
COMMENT
COMMENT @deprecated {@link Recipe} is no longer synced to the clients, making this
COMMENT obsolete.
COMMENT
COMMENT @see RecipeDisplayEntry

0 comments on commit 23488c6

Please sign in to comment.