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

PotionData arguments flipped in Potion.toItemStack

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • None

      The PotionData constructor used in org.bukkit.potion.Potion.toItemStack is:

      PotionData(PotionType type, boolean extended, boolean upgraded)
      

      but the upgraded & extended arguments are flipped (Potion, line 324)

      meta.setBasePotionData(new PotionData(type, level == 2, extended));
      

      changing the above to

      meta.setBasePotionData(new PotionData(type, extended, level == 2));
      

      seems to fix the java.lang.IllegalArgumentException: Potion Type is not upgradable (and similar) errors I've been getting since the reworked potions API commits.

            Unassigned Unassigned
            zreed zreed
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: