Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-3308

RecipeIterator cannot longer remove recipes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None

      In others versions you were able to remove recipes from RecipeIterator. Check https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/inventory/RecipeIterator.java#47

      So, in 1.12 it seems that Minecraft Server returns now an immutable iterator, and when the server executes removeFrom.remove(); it throws an UnsupportedOperationException, from Guava.

      at com.google.common.collect.UnmodifiableIterator.remove(UnmodifiableIterator.java:46)
      at org.bukkit.craftbukkit.v1_12_R1.inventory.RecipeIterator.remove(RecipeIterator.java:51)

      As I can see in net.minecraft.server.RegistryMaterials, recipes comes from RegistryMaterials and that class is not decompiled for me.

      A solution could me a patch to remove Iterators.unmodifiableIterator from the internal minecraft server class, but it maybe will break crafting book...? I don't know how it works

      An usefull thread with more info is https://www.spigotmc.org/threads/problem-remove-recipe.242988/

            Unassigned Unassigned
            Cadiducho Cadiducho
            Votes:
            4 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: