mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-26 19:07:40 +01:00
SPIGOT-678: Fix the particles flag being ignored in PotionMeta
This commit is contained in:
parent
7a30c3117e
commit
294d07dcc0
@ -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 New Issue
Block a user