Improve performance of RecipeMap#removeRecipe

This commit is contained in:
Jake Potrebic
2024-10-31 20:36:41 -07:00
parent 7acf73ce66
commit 9467a08b36
3 changed files with 37 additions and 16 deletions

View File

@@ -32,5 +32,9 @@ public class RecipeIterator implements Iterator<Recipe> {
public void remove() {
MinecraftServer.getServer().getRecipeManager().recipes.byKey.remove(this.currentRecipe.id()); // Paper - fix removing recipes from RecipeIterator
this.recipes.remove();
// Paper start - correctly reload recipes
MinecraftServer.getServer().getRecipeManager().finalizeRecipeLoading();
MinecraftServer.getServer().getPlayerList().reloadRecipes();
// Paper end - correctly reload recipes
}
}