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

Bukkit.resetRecipes() / Server.resetRecipes() do not reset the list of crafting recipes to the default.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • Java 11.0.1 Windows
      IDE: IntelliJ

    • git-Spigot-d05d3c1-a2275f1 (MC: 1.14.3) (Implementing API version 1.14.3-R0.1-SNAPSHOT)
    • Yes

      Unless I'm going completely mad. I'm pretty sure Bukkit.resetRecipes() / Server.resetRecipes() currently do not reset the list of crafting recipes to the default.

      I'm creating a plugin in which crafting recipes will be added. When trying to write the logic to reload the plugin without restarting the server, I was trying to reset the recipes to the default ones, to then add the new ones from the (potentially) updated config file.
      This didn't work, the 'old' recipes would just stay active.
      I then proceeded to clear ALL recipes with .clearRecipes() (this worked fine) to reset them back to default after that with .resetRecipes(). When I tried it out, I noticed ALL (including default) recipes would still be removed. The only conclusion I have is that .resetRecipes() currently is not working as it's supposed to.
      I could probably start iterating through all of them to try and get the recipe list back to default but this isn't really a solution.

       

      I tested the functionality of resetRecipes() on 1.13.2 and it worked fine.

      I created a plugin for 1.14.3 (attached below) that does nothing except showcasing the bug.
      It clears all recipes on start and tries to reset them by typing the command /test.

      How to test (Since I couldn't assume the reader knows anything): Load up my plugin and try putting a gold bar into a crafting table. It should produce 9 golden nuggets, but it will not because all recipes are cleared in the onEnable method of the test plugin. When typing the command /test, Bukkit.resetRecipes() is run and the gold bar should now produce 9 nuggets again, but it doesn't.
      Once again, when recreating this test plugin in 1.13.2, everything will work as intended.

      It took me a couple of hours to come to the conclusion there was a bug in the API, following the steps to report this bug took about 30 minutes.

            Unassigned Unassigned
            OliPulse Oliver Maenen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: