From 567fce6c76809eee37c24eddc8b1a93f24691fd5 Mon Sep 17 00:00:00 2001 From: Jason <11360596+jpenilla@users.noreply.github.com> Date: Thu, 21 Apr 2022 17:07:56 -0700 Subject: [PATCH] Don't apply previous potion when item is potion (fixes #7756) (#7757) --- patches/server/0873-More-Projectile-API.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/patches/server/0873-More-Projectile-API.patch b/patches/server/0873-More-Projectile-API.patch index 0e2e4acf0c..0b52fff0e5 100644 --- a/patches/server/0873-More-Projectile-API.patch +++ b/patches/server/0873-More-Projectile-API.patch @@ -132,7 +132,7 @@ index 6bfa984781a483d048ef4318761203c701d8a632..5e0c2c5094e1578162d1a50d50701fbd + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java -index b08739dd1ffd041f0885af6c1f57dca9027763b6..2edaae449f936b210a48c52ab8d921544c8a0005 100644 +index b08739dd1ffd041f0885af6c1f57dca9027763b6..c1594f62c06a49ba2d0c2c6e6befcda7d1fe6e1b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java @@ -39,11 +39,26 @@ public class CraftThrownPotion extends CraftProjectile implements ThrownPotion { @@ -141,10 +141,10 @@ index b08739dd1ffd041f0885af6c1f57dca9027763b6..2edaae449f936b210a48c52ab8d92154 // The ItemStack must be a potion. - Validate.isTrue(item.getType() == Material.LINGERING_POTION || item.getType() == Material.SPLASH_POTION, "ItemStack must be a lingering or splash potion. This item stack was " + item.getType() + "."); + //Validate.isTrue(item.getType() == Material.LINGERING_POTION || item.getType() == Material.SPLASH_POTION, "ItemStack must be a lingering or splash potion. This item stack was " + item.getType() + "."); // Paper - Projectile API -+ var meta = getPotionMeta(); // Paper - Projectile API ++ org.bukkit.inventory.meta.PotionMeta meta = (item.getType() == Material.LINGERING_POTION || item.getType() == Material.SPLASH_POTION) ? null : this.getPotionMeta(); // Paper - Projectile API this.getHandle().setItem(CraftItemStack.asNMSCopy(item)); -+ setPotionMeta(meta); // Paper - Projectile API ++ if (meta != null) this.setPotionMeta(meta); // Paper - Projectile API } + // Paper start - Projectile API