Update Declare Recipes packet and add packet for unlock recipes#589
Update Declare Recipes packet and add packet for unlock recipes#589BL19 wants to merge 1 commit into
Conversation
|
Thank you for this PR. Will look into using this PR to complete the recipe wrappers and also update them to 1.20. |
| private final int width; | ||
| private final int height; | ||
| private final @NotNull String group; | ||
| private CraftingBookCategory category; |
There was a problem hiding this comment.
| private CraftingBookCategory category; | |
| private final CraftingBookCategory category; |
| private final @NotNull String group; | ||
| private final @NotNull Ingredient[] ingredients; | ||
| private final ItemStack result; | ||
| private CraftingBookCategory category; |
There was a problem hiding this comment.
| private CraftingBookCategory category; | |
| private final CraftingBookCategory category; |
| return result; | ||
| } | ||
|
|
||
| public CraftingBookCategory getCategory() { |
There was a problem hiding this comment.
Is the @Nullable annotation not needed?
| private final ItemStack result; | ||
|
|
||
| public ShapedRecipeData(final int width, final int height, final @NotNull String group, final @NotNull Ingredient[] ingredients, final ItemStack result) { | ||
| public ShapedRecipeData(final int width, final int height, final @NotNull String group, final @NotNull CraftingBookCategory category, final @NotNull Ingredient[] ingredients, final ItemStack result) { |
There was a problem hiding this comment.
Is the CraftingBookCategory version-specific? If yes, please make a second constructor
| super(packetType); | ||
| } | ||
|
|
||
| RecipeBookAction action; |
There was a problem hiding this comment.
Please add private final everywhere
| import com.github.retrooper.packetevents.wrapper.PacketWrapper; | ||
|
|
||
| public class WrapperPlayServerUnlockRecipes extends PacketWrapper<WrapperPlayServerUnlockRecipes> { | ||
|
|
| recipeIds[i] = readString(); | ||
| } | ||
|
|
||
| if(action == RecipeBookAction.INIT) { |
There was a problem hiding this comment.
| if(action == RecipeBookAction.INIT) { | |
| if (action == RecipeBookAction.INIT) { | |
| writeString(recipeId); | ||
| } | ||
|
|
||
| if(action == RecipeBookAction.INIT) { |
There was a problem hiding this comment.
| if(action == RecipeBookAction.INIT) { | |
| if (action == RecipeBookAction.INIT) { |
|
Hold up, I just saw the "WrapperPlayServerUnlockRecipes" class. It's definetly not cross-version and a duplicate of #382 |
|
Closing since I don't really have time to fix this and have no use for it anymore. Might open a new PR if I need this again. |
It adds the packet for unlocking recipes and updates the packet for declaring recipes to contain the CraftingBookCategory.
Tested on: 1.19.3 & 1.19.4