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

BundleMeta setItems doesn't work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • This server is running CraftBukkit version 3124-Spigot-66f9d3c-384e116 (MC: 1.17) (Implementing API version 1.17-R0.1-SNAPSHOT)
    • Yes

      It looks like the bundle set code is nulling out the passed in items when it's intending to null out this.items: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBundle.java#117-128 which then causes the null check immediately after to always trigger.

      I believe updating https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBundle.java#119 to "this.items = null" should fix the issue.

       

      If needed, I have attached a test plugin that adds two recipes which test the following:

      • dirt = setItems
      • stone = individual addItem(s)

       

      The expected result would be that both recipes produce a bundle with the given two stacks of items. Currently, only the stone recipe (Individually adding items) does and the dirt recipe (setItems) gives an empty bundle.

       

      Plugin source code can be found here: https://github.com/haveric/TestPlugin/blob/bundle-set/testplugin/src/main/java/haveric/testplugin/TestPlugin.java

            md_5 md_5
            haveric Ryan Breuer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: