mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-09 04:09:54 +01:00
SPIGOT-4217: Account for ShowIcon to allow custom tipped arrows to merge
This commit is contained in:
parent
69970127c1
commit
9331153551
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user