From d41636f445de25934198927d2097978cef65b031 Mon Sep 17 00:00:00 2001 From: Aya <31237389+tal5@users.noreply.github.com> Date: Sat, 15 Jun 2024 20:49:08 +0100 Subject: [PATCH] Add back RecipeIterator fixes patch (#10887) --- .../0789-Improve-logging-and-errors.patch | 2 +- ...removing-recipes-from-RecipeIterator.patch | 41 +++++++++++++++++++ ...hunk-System-Starlight-from-Moonrise.patch} | 0 ...> 0991-Rewrite-dataconverter-system.patch} | 0 ...92-disable-forced-empty-world-ticks.patch} | 0 ...dBounds-and-getBlockState-for-inlin.patch} | 0 ...tem-frames-performance-and-bug-fixe.patch} | 0 ...ing-for-EntityLiving-hasLineOfSight.patch} | 0 ...Manager-and-add-advanced-packet-sup.patch} | 0 ...97-Allow-Saving-of-Oversized-Chunks.patch} | 0 ...998-Flat-bedrock-generator-settings.patch} | 0 ...=> 0999-Entity-Activation-Range-2.0.patch} | 0 ...1000-Optional-per-player-mob-spawns.patch} | 0 ...0-Anti-Xray.patch => 1001-Anti-Xray.patch} | 0 ...-Eigencraft-redstone-implementation.patch} | 0 ...ate-Current-redstone-implementation.patch} | 0 ...g-PreCreatureSpawnEvent-with-per-pl.patch} | 0 ...city-compression-and-cipher-natives.patch} | 0 ...alSelector-Goal.Flag-Set-operations.patch} | 0 ...pers.patch => 1007-Optimize-Hoppers.patch} | 0 ...> 1008-Optimize-Voxel-Shape-Merging.patch} | 0 ...Optimize-Bit-Operations-by-inlining.patch} | 0 ...> 1010-Remove-streams-from-hot-code.patch} | 0 ...er-Remove-Streams-Optimized-collect.patch} | 0 ...ementation-for-blockstate-state-loo.patch} | 0 ...-type-tags-suggestions-in-selectors.patch} | 0 ...-Oversized-block-entities-in-chunks.patch} | 0 ...> 1015-API-for-checking-sent-chunks.patch} | 0 28 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 patches/server/0989-Fix-removing-recipes-from-RecipeIterator.patch rename patches/server/{0989-Chunk-System-Starlight-from-Moonrise.patch => 0990-Chunk-System-Starlight-from-Moonrise.patch} (100%) rename patches/server/{0990-Rewrite-dataconverter-system.patch => 0991-Rewrite-dataconverter-system.patch} (100%) rename patches/server/{0991-disable-forced-empty-world-ticks.patch => 0992-disable-forced-empty-world-ticks.patch} (100%) rename patches/server/{0992-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch => 0993-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch} (100%) rename patches/server/{0993-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch => 0994-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch} (100%) rename patches/server/{0994-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch => 0995-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch} (100%) rename patches/server/{0995-Optimize-Network-Manager-and-add-advanced-packet-sup.patch => 0996-Optimize-Network-Manager-and-add-advanced-packet-sup.patch} (100%) rename patches/server/{0996-Allow-Saving-of-Oversized-Chunks.patch => 0997-Allow-Saving-of-Oversized-Chunks.patch} (100%) rename patches/server/{0997-Flat-bedrock-generator-settings.patch => 0998-Flat-bedrock-generator-settings.patch} (100%) rename patches/server/{0998-Entity-Activation-Range-2.0.patch => 0999-Entity-Activation-Range-2.0.patch} (100%) rename patches/server/{0999-Optional-per-player-mob-spawns.patch => 1000-Optional-per-player-mob-spawns.patch} (100%) rename patches/server/{1000-Anti-Xray.patch => 1001-Anti-Xray.patch} (100%) rename patches/server/{1001-Eigencraft-redstone-implementation.patch => 1002-Eigencraft-redstone-implementation.patch} (100%) rename patches/server/{1002-Add-Alternate-Current-redstone-implementation.patch => 1003-Add-Alternate-Current-redstone-implementation.patch} (100%) rename patches/server/{1003-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch => 1004-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch} (100%) rename patches/server/{1004-Use-Velocity-compression-and-cipher-natives.patch => 1005-Use-Velocity-compression-and-cipher-natives.patch} (100%) rename patches/server/{1005-Optimize-GoalSelector-Goal.Flag-Set-operations.patch => 1006-Optimize-GoalSelector-Goal.Flag-Set-operations.patch} (100%) rename patches/server/{1006-Optimize-Hoppers.patch => 1007-Optimize-Hoppers.patch} (100%) rename patches/server/{1007-Optimize-Voxel-Shape-Merging.patch => 1008-Optimize-Voxel-Shape-Merging.patch} (100%) rename patches/server/{1008-Optimize-Bit-Operations-by-inlining.patch => 1009-Optimize-Bit-Operations-by-inlining.patch} (100%) rename patches/server/{1009-Remove-streams-from-hot-code.patch => 1010-Remove-streams-from-hot-code.patch} (100%) rename patches/server/{1010-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch => 1011-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch} (100%) rename patches/server/{1011-Custom-table-implementation-for-blockstate-state-loo.patch => 1012-Custom-table-implementation-for-blockstate-state-loo.patch} (100%) rename patches/server/{1012-Fix-entity-type-tags-suggestions-in-selectors.patch => 1013-Fix-entity-type-tags-suggestions-in-selectors.patch} (100%) rename patches/server/{1013-Handle-Oversized-block-entities-in-chunks.patch => 1014-Handle-Oversized-block-entities-in-chunks.patch} (100%) rename patches/server/{1014-API-for-checking-sent-chunks.patch => 1015-API-for-checking-sent-chunks.patch} (100%) diff --git a/patches/server/0789-Improve-logging-and-errors.patch b/patches/server/0789-Improve-logging-and-errors.patch index 42d1e7b166..e4489ef6a7 100644 --- a/patches/server/0789-Improve-logging-and-errors.patch +++ b/patches/server/0789-Improve-logging-and-errors.patch @@ -82,7 +82,7 @@ index ed1d3d30404dfc6303e746f31295b6b1aa40f204..8d7565eda4536e8aa42dd3dcbcfac38c set.add(string); } else { diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java -index b068a31c8052091840956e26ef6547a1a3595e4c..ac99aa7a275b7c2e91d51f952dbf0a1ce44e02d5 100644 +index 3270bb6fe1c8b08411e6cad14d48cec886085ee7..407f3c1938b5b5d893b09705fe4930dbdafa3c8e 100644 --- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java +++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java @@ -79,7 +79,7 @@ public class RecipeManager extends SimpleJsonResourceReloadListener { diff --git a/patches/server/0989-Fix-removing-recipes-from-RecipeIterator.patch b/patches/server/0989-Fix-removing-recipes-from-RecipeIterator.patch new file mode 100644 index 0000000000..461c3eb854 --- /dev/null +++ b/patches/server/0989-Fix-removing-recipes-from-RecipeIterator.patch @@ -0,0 +1,41 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake +Date: Sat, 15 Jun 2024 18:50:18 +0100 +Subject: [PATCH] Fix removing recipes from RecipeIterator + +== AT == +public net.minecraft.world.item.crafting.RecipeManager byName + +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/RecipeIterator.java b/src/main/java/org/bukkit/craftbukkit/inventory/RecipeIterator.java +index 78a2afa981407de793ac940d6eb7315c5cd53b8f..33cd12d55786356dc89ab9d3872b2f7d266c3de2 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/RecipeIterator.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/RecipeIterator.java +@@ -9,6 +9,7 @@ import org.bukkit.inventory.Recipe; + + public class RecipeIterator implements Iterator { + private final Iterator, RecipeHolder>> recipes; ++ private Recipe currentRecipe; // Paper - fix removing recipes from RecipeIterator + + public RecipeIterator() { + this.recipes = MinecraftServer.getServer().getRecipeManager().byType.entries().iterator(); +@@ -21,11 +22,19 @@ public class RecipeIterator implements Iterator { + + @Override + public Recipe next() { +- return this.recipes.next().getValue().toBukkitRecipe(); ++ // Paper start - fix removing recipes from RecipeIterator ++ this.currentRecipe = this.recipes.next().getValue().toBukkitRecipe(); ++ return this.currentRecipe; ++ // Paper end - fix removing recipes from RecipeIterator + } + + @Override + public void remove() { ++ // Paper start - fix removing recipes from RecipeIterator ++ if (this.currentRecipe instanceof org.bukkit.Keyed keyed) { ++ MinecraftServer.getServer().getRecipeManager().byName.remove(org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(keyed.getKey())); ++ } ++ // Paper end - fix removing recipes from RecipeIterator + this.recipes.remove(); + } + } diff --git a/patches/server/0989-Chunk-System-Starlight-from-Moonrise.patch b/patches/server/0990-Chunk-System-Starlight-from-Moonrise.patch similarity index 100% rename from patches/server/0989-Chunk-System-Starlight-from-Moonrise.patch rename to patches/server/0990-Chunk-System-Starlight-from-Moonrise.patch diff --git a/patches/server/0990-Rewrite-dataconverter-system.patch b/patches/server/0991-Rewrite-dataconverter-system.patch similarity index 100% rename from patches/server/0990-Rewrite-dataconverter-system.patch rename to patches/server/0991-Rewrite-dataconverter-system.patch diff --git a/patches/server/0991-disable-forced-empty-world-ticks.patch b/patches/server/0992-disable-forced-empty-world-ticks.patch similarity index 100% rename from patches/server/0991-disable-forced-empty-world-ticks.patch rename to patches/server/0992-disable-forced-empty-world-ticks.patch diff --git a/patches/server/0992-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch b/patches/server/0993-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch similarity index 100% rename from patches/server/0992-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch rename to patches/server/0993-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch diff --git a/patches/server/0993-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch b/patches/server/0994-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch similarity index 100% rename from patches/server/0993-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch rename to patches/server/0994-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch diff --git a/patches/server/0994-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch b/patches/server/0995-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch similarity index 100% rename from patches/server/0994-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch rename to patches/server/0995-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch diff --git a/patches/server/0995-Optimize-Network-Manager-and-add-advanced-packet-sup.patch b/patches/server/0996-Optimize-Network-Manager-and-add-advanced-packet-sup.patch similarity index 100% rename from patches/server/0995-Optimize-Network-Manager-and-add-advanced-packet-sup.patch rename to patches/server/0996-Optimize-Network-Manager-and-add-advanced-packet-sup.patch diff --git a/patches/server/0996-Allow-Saving-of-Oversized-Chunks.patch b/patches/server/0997-Allow-Saving-of-Oversized-Chunks.patch similarity index 100% rename from patches/server/0996-Allow-Saving-of-Oversized-Chunks.patch rename to patches/server/0997-Allow-Saving-of-Oversized-Chunks.patch diff --git a/patches/server/0997-Flat-bedrock-generator-settings.patch b/patches/server/0998-Flat-bedrock-generator-settings.patch similarity index 100% rename from patches/server/0997-Flat-bedrock-generator-settings.patch rename to patches/server/0998-Flat-bedrock-generator-settings.patch diff --git a/patches/server/0998-Entity-Activation-Range-2.0.patch b/patches/server/0999-Entity-Activation-Range-2.0.patch similarity index 100% rename from patches/server/0998-Entity-Activation-Range-2.0.patch rename to patches/server/0999-Entity-Activation-Range-2.0.patch diff --git a/patches/server/0999-Optional-per-player-mob-spawns.patch b/patches/server/1000-Optional-per-player-mob-spawns.patch similarity index 100% rename from patches/server/0999-Optional-per-player-mob-spawns.patch rename to patches/server/1000-Optional-per-player-mob-spawns.patch diff --git a/patches/server/1000-Anti-Xray.patch b/patches/server/1001-Anti-Xray.patch similarity index 100% rename from patches/server/1000-Anti-Xray.patch rename to patches/server/1001-Anti-Xray.patch diff --git a/patches/server/1001-Eigencraft-redstone-implementation.patch b/patches/server/1002-Eigencraft-redstone-implementation.patch similarity index 100% rename from patches/server/1001-Eigencraft-redstone-implementation.patch rename to patches/server/1002-Eigencraft-redstone-implementation.patch diff --git a/patches/server/1002-Add-Alternate-Current-redstone-implementation.patch b/patches/server/1003-Add-Alternate-Current-redstone-implementation.patch similarity index 100% rename from patches/server/1002-Add-Alternate-Current-redstone-implementation.patch rename to patches/server/1003-Add-Alternate-Current-redstone-implementation.patch diff --git a/patches/server/1003-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch b/patches/server/1004-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch similarity index 100% rename from patches/server/1003-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch rename to patches/server/1004-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch diff --git a/patches/server/1004-Use-Velocity-compression-and-cipher-natives.patch b/patches/server/1005-Use-Velocity-compression-and-cipher-natives.patch similarity index 100% rename from patches/server/1004-Use-Velocity-compression-and-cipher-natives.patch rename to patches/server/1005-Use-Velocity-compression-and-cipher-natives.patch diff --git a/patches/server/1005-Optimize-GoalSelector-Goal.Flag-Set-operations.patch b/patches/server/1006-Optimize-GoalSelector-Goal.Flag-Set-operations.patch similarity index 100% rename from patches/server/1005-Optimize-GoalSelector-Goal.Flag-Set-operations.patch rename to patches/server/1006-Optimize-GoalSelector-Goal.Flag-Set-operations.patch diff --git a/patches/server/1006-Optimize-Hoppers.patch b/patches/server/1007-Optimize-Hoppers.patch similarity index 100% rename from patches/server/1006-Optimize-Hoppers.patch rename to patches/server/1007-Optimize-Hoppers.patch diff --git a/patches/server/1007-Optimize-Voxel-Shape-Merging.patch b/patches/server/1008-Optimize-Voxel-Shape-Merging.patch similarity index 100% rename from patches/server/1007-Optimize-Voxel-Shape-Merging.patch rename to patches/server/1008-Optimize-Voxel-Shape-Merging.patch diff --git a/patches/server/1008-Optimize-Bit-Operations-by-inlining.patch b/patches/server/1009-Optimize-Bit-Operations-by-inlining.patch similarity index 100% rename from patches/server/1008-Optimize-Bit-Operations-by-inlining.patch rename to patches/server/1009-Optimize-Bit-Operations-by-inlining.patch diff --git a/patches/server/1009-Remove-streams-from-hot-code.patch b/patches/server/1010-Remove-streams-from-hot-code.patch similarity index 100% rename from patches/server/1009-Remove-streams-from-hot-code.patch rename to patches/server/1010-Remove-streams-from-hot-code.patch diff --git a/patches/server/1010-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch b/patches/server/1011-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch similarity index 100% rename from patches/server/1010-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch rename to patches/server/1011-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch diff --git a/patches/server/1011-Custom-table-implementation-for-blockstate-state-loo.patch b/patches/server/1012-Custom-table-implementation-for-blockstate-state-loo.patch similarity index 100% rename from patches/server/1011-Custom-table-implementation-for-blockstate-state-loo.patch rename to patches/server/1012-Custom-table-implementation-for-blockstate-state-loo.patch diff --git a/patches/server/1012-Fix-entity-type-tags-suggestions-in-selectors.patch b/patches/server/1013-Fix-entity-type-tags-suggestions-in-selectors.patch similarity index 100% rename from patches/server/1012-Fix-entity-type-tags-suggestions-in-selectors.patch rename to patches/server/1013-Fix-entity-type-tags-suggestions-in-selectors.patch diff --git a/patches/server/1013-Handle-Oversized-block-entities-in-chunks.patch b/patches/server/1014-Handle-Oversized-block-entities-in-chunks.patch similarity index 100% rename from patches/server/1013-Handle-Oversized-block-entities-in-chunks.patch rename to patches/server/1014-Handle-Oversized-block-entities-in-chunks.patch diff --git a/patches/server/1014-API-for-checking-sent-chunks.patch b/patches/server/1015-API-for-checking-sent-chunks.patch similarity index 100% rename from patches/server/1014-API-for-checking-sent-chunks.patch rename to patches/server/1015-API-for-checking-sent-chunks.patch