mirror of
https://github.com/PaperMC/Paper.git
synced 2025-04-12 17:04:42 +02:00
Add back RecipeIterator fixes patch (#10887)
This commit is contained in:
parent
c1aefeecc6
commit
d41636f445
28 changed files with 42 additions and 1 deletions
patches/server
0789-Improve-logging-and-errors.patch0989-Fix-removing-recipes-from-RecipeIterator.patch0990-Chunk-System-Starlight-from-Moonrise.patch0991-Rewrite-dataconverter-system.patch0992-disable-forced-empty-world-ticks.patch0993-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch0994-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch0995-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch0996-Optimize-Network-Manager-and-add-advanced-packet-sup.patch0997-Allow-Saving-of-Oversized-Chunks.patch0998-Flat-bedrock-generator-settings.patch0999-Entity-Activation-Range-2.0.patch1000-Optional-per-player-mob-spawns.patch1001-Anti-Xray.patch1002-Eigencraft-redstone-implementation.patch1003-Add-Alternate-Current-redstone-implementation.patch1004-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch1005-Use-Velocity-compression-and-cipher-natives.patch1006-Optimize-GoalSelector-Goal.Flag-Set-operations.patch1007-Optimize-Hoppers.patch1008-Optimize-Voxel-Shape-Merging.patch1009-Optimize-Bit-Operations-by-inlining.patch1010-Remove-streams-from-hot-code.patch1011-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch1012-Custom-table-implementation-for-blockstate-state-loo.patch1013-Fix-entity-type-tags-suggestions-in-selectors.patch1014-Handle-Oversized-block-entities-in-chunks.patch1015-API-for-checking-sent-chunks.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 {
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jake <jake.m.potrebic@gmail.com>
|
||||
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<Recipe> {
|
||||
private final Iterator<Map.Entry<RecipeType<?>, 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<Recipe> {
|
||||
|
||||
@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();
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue