diff options
author | md_5 <git@md-5.net> | 2018-08-03 19:57:09 +1000 |
---|---|---|
committer | md_5 <git@md-5.net> | 2018-08-03 19:57:09 +1000 |
commit | 9331153551c33d719c35bb533f84e9ef6b254766 (patch) | |
tree | a4291fe3ff81ec052ba2513142e310d55345b860 /src/main/java/org | |
parent | 69970127c11e52c579cc17d4ce263a344735940a (diff) | |
download | craftbukkit-9331153551c33d719c35bb533f84e9ef6b254766.tar craftbukkit-9331153551c33d719c35bb533f84e9ef6b254766.tar.gz craftbukkit-9331153551c33d719c35bb533f84e9ef6b254766.tar.lz craftbukkit-9331153551c33d719c35bb533f84e9ef6b254766.tar.xz craftbukkit-9331153551c33d719c35bb533f84e9ef6b254766.zip |
SPIGOT-4217: Account for ShowIcon to allow custom tipped arrows to merge
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); } } |