Conversation
|
Hi, Thanks for the PR, yeah looks like the logic its called twice.. this also happen with the removeRecipe, if you can remove that reload too i feel this PR its ok. maybe deprecate that methods because are always reloaded internally... |
| if (toAdd == null) return false; | ||
| toAdd.addToRecipeManager(); | ||
| // Paper start - API for updating recipes on clients | ||
| if (true || resendRecipes) { // Always needs to be resent now... TODO |
There was a problem hiding this comment.
Since this was with a TODO, maybe it would make sense to make it false && and update the command to say that it's already resent?
There was a problem hiding this comment.
i dont see a reason for keep this in code when NMS already make the reload maybe mention here in the addToRecipeMananger with a comment about how that call a reloadResources -> reloadRecipes
There was a problem hiding this comment.
For sure add a comment would be better. My bad
I've added them in new commit
If there's any issue you may change it directly cuz I may not reply timely thx
| @@ -1644,10 +1640,8 @@ public boolean removeRecipe(NamespacedKey recipeKey, boolean resendRecipes) { | |||
|
|
|||
| // Paper start - resend recipes on successful removal | |||
There was a problem hiding this comment.
This comments can be removed (the Paper end too and maybe inline the return with the remove)
There was a problem hiding this comment.
Got that. Removed in latest commit
|
Can be good deprecate the methods where the bool is passed because its totally ignored. |
|
this is actually covered in my pre-existing recipe PR here: #13945 |
Which I see now I need to update with paper's update to the new mc version |
I forgot to create a new branch first sry
While trying to add a recipe through this method, the server will resent the
ClientboundUpdateRecipesPackettwice.I found this when I was testing my custom recipe loading plugin. When I tried to reload all the custom recipes (had 150 of them...) my client had no response for a half a minute. After checking client logs I found that my client reloaded the recipe book for 600 times.
The full calling chain before:
We'd see that the playerList.reloadRecipes() ran twice in total, and remove the second reloadRecipes() didn't affect the reloading at all.
So here's the fixed logic (after):
I didn't remove the 2nd param for backward compatibility issues.
Sorry for my poor English expression🙏🏻