mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 10:17:38 +01:00
SPIGOT-4047: Ignore non-existent potions
By: md_5 <git@md-5.net>
This commit is contained in:
parent
1185891544
commit
9f86013d8a
@ -71,6 +71,11 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta {
|
||||
for (int i = 0; i < length; i++) {
|
||||
NBTTagCompound effect = list.getCompound(i);
|
||||
PotionEffectType type = PotionEffectType.getById(effect.getByte(ID.NBT));
|
||||
// SPIGOT-4047: Vanilla just disregards these
|
||||
if (type == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int amp = effect.getByte(AMPLIFIER.NBT);
|
||||
int duration = effect.getInt(DURATION.NBT);
|
||||
boolean ambient = effect.getBoolean(AMBIENT.NBT);
|
||||
|
Loading…
Reference in New Issue
Block a user