[ci skip] Add more identifying patch comments
This commit is contained in:
@@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
public class RecipeIterator implements Iterator<Recipe> {
|
||||
private final Iterator<Map.Entry<RecipeType<?>, Object2ObjectLinkedOpenHashMap<ResourceLocation, RecipeHolder<?>>>> recipes;
|
||||
private Iterator<RecipeHolder<?>> current;
|
||||
+ private Recipe currentRecipe; // Paper - fix removing recipes
|
||||
+ private Recipe currentRecipe; // Paper - fix removing recipes from RecipeIterator
|
||||
|
||||
public RecipeIterator() {
|
||||
this.recipes = MinecraftServer.getServer().getRecipeManager().recipes.entrySet().iterator();
|
||||
@@ -23,28 +23,28 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
if (this.current == null || !this.current.hasNext()) {
|
||||
this.current = this.recipes.next().getValue().values().iterator();
|
||||
- return this.next();
|
||||
+ // Paper start - fix removing recipes
|
||||
+ // Paper start - fix removing recipes from RecipeIterator
|
||||
+ this.currentRecipe = this.next();
|
||||
+ return this.currentRecipe;
|
||||
+ // Paper end
|
||||
+ // Paper end - fix removing recipes from RecipeIterator
|
||||
}
|
||||
|
||||
- return this.current.next().toBukkitRecipe();
|
||||
+ // Paper start - fix removing recipes
|
||||
+ // Paper start - fix removing recipes from RecipeIterator
|
||||
+ this.currentRecipe = this.current.next().toBukkitRecipe();
|
||||
+ return this.currentRecipe;
|
||||
+ // Paper end
|
||||
+ // Paper end - fix removing recipes from RecipeIterator
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
Preconditions.checkState(this.current != null, "next() not yet called");
|
||||
+
|
||||
+ // Paper start - fix removing recipes
|
||||
+ // 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
|
||||
+ // Paper end - fix removing recipes from RecipeIterator
|
||||
this.current.remove();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user