mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-29 11:42:55 +01:00
SPIGOT-678: Fix the particles flag being ignored in PotionMeta
This commit is contained in:
parent
7a30c3117e
commit
294d07dcc0
1 changed files with 4 additions and 1 deletions
|
@ -24,6 +24,7 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta {
|
|||
static final ItemMetaKey AMPLIFIER = new ItemMetaKey("Amplifier", "amplifier");
|
||||
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 POTION_EFFECTS = new ItemMetaKey("CustomPotionEffects", "custom-effects");
|
||||
static final ItemMetaKey ID = new ItemMetaKey("Id", "potion-id");
|
||||
|
||||
|
@ -55,7 +56,8 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta {
|
|||
int amp = effect.getByte(AMPLIFIER.NBT);
|
||||
int duration = effect.getInt(DURATION.NBT);
|
||||
boolean ambient = effect.getBoolean(AMBIENT.NBT);
|
||||
customEffects.add(new PotionEffect(type, duration, amp, ambient));
|
||||
boolean particles = effect.getBoolean(SHOW_PARTICLES.NBT);
|
||||
customEffects.add(new PotionEffect(type, duration, amp, ambient, particles));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -90,6 +92,7 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta {
|
|||
effectData.setByte(AMPLIFIER.NBT, (byte) effect.getAmplifier());
|
||||
effectData.setInt(DURATION.NBT, effect.getDuration());
|
||||
effectData.setBoolean(AMBIENT.NBT, effect.isAmbient());
|
||||
effectData.setBoolean(SHOW_PARTICLES.NBT, effect.hasParticles());
|
||||
effectList.add(effectData);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue