diff options
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java index 43b9d96b..81e1a40c 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java @@ -31,6 +31,7 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta { static final ItemMetaKey AMBIENT = new ItemMetaKey("Ambient", "ambient"); static final ItemMetaKey DURATION = new ItemMetaKey("Duration", "duration"); static final ItemMetaKey SHOW_PARTICLES = new ItemMetaKey("ShowParticles", "has-particles"); + static final ItemMetaKey SHOW_ICON = new ItemMetaKey("ShowIcon", "has-icon"); static final ItemMetaKey POTION_EFFECTS = new ItemMetaKey("CustomPotionEffects", "custom-effects"); static final ItemMetaKey POTION_COLOR = new ItemMetaKey("CustomPotionColor", "custom-color"); static final ItemMetaKey ID = new ItemMetaKey("Id", "potion-id"); @@ -80,7 +81,8 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta { int duration = effect.getInt(DURATION.NBT); boolean ambient = effect.getBoolean(AMBIENT.NBT); boolean particles = effect.getBoolean(SHOW_PARTICLES.NBT); - customEffects.add(new PotionEffect(type, duration, amp, ambient, particles)); + boolean icon = tag.hasKeyOfType(SHOW_ICON.NBT, CraftMagicNumbers.NBT.TAG_BYTE) ? effect.getBoolean(SHOW_ICON.NBT) : particles; + customEffects.add(new PotionEffect(type, duration, amp, ambient, particles, icon)); } } } @@ -128,6 +130,7 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta { effectData.setInt(DURATION.NBT, effect.getDuration()); effectData.setBoolean(AMBIENT.NBT, effect.isAmbient()); effectData.setBoolean(SHOW_PARTICLES.NBT, effect.hasParticles()); + effectData.setBoolean(SHOW_ICON.NBT, effect.hasIcon()); effectList.add(effectData); } } |