[SPIGOT-1899] PotionData arguments flipped in Potion.toItemStack Created: 12/Mar/16  Updated: 11/Jul/16  Resolved: 12/Mar/16

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: zreed Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: bug, potion

Issue Links:
Relates
relates to SPIGOT-2044 AreaEffectCloudApplyEvent not complete Resolved

 Description   

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.



 Comments   
Comment by md_5 [ 12/Mar/16 ]

Thanks for the fix.

Generated at Thu Mar 27 04:25:24 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.