From ce8e37904d39647fe5170da63ffd1c899f0f75bd Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Sat, 25 Jun 2022 14:21:47 -0700 Subject: [PATCH] Fix CCE for SplashPotion and LingeringPotion spawning (#7758) --- .../api/Fix-Spigot-annotation-mistakes.patch | 23 +++++++++++++++++-- ...shPotion-and-LingeringPotion-spawnin.patch | 21 +++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 patches/server/Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch diff --git a/patches/api/Fix-Spigot-annotation-mistakes.patch b/patches/api/Fix-Spigot-annotation-mistakes.patch index 0ba3c95cc1..51bababe4a 100644 --- a/patches/api/Fix-Spigot-annotation-mistakes.patch +++ b/patches/api/Fix-Spigot-annotation-mistakes.patch @@ -294,10 +294,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/entity/LingeringPotion.java +++ b/src/main/java/org/bukkit/entity/LingeringPotion.java @@ -0,0 +0,0 @@ package org.bukkit.entity; + /** + * Represents a thrown lingering potion bottle * - * @deprecated lingering status depends on only on the potion item. +- * @deprecated lingering status depends on only on the potion item. ++ * @deprecated should not be used for anything, use {@link ThrownPotion} and ++ * set the potion via the methods there. */ -+@Deprecated // Paper ++@Deprecated(forRemoval = true) // Paper public interface LingeringPotion extends ThrownPotion { } diff --git a/src/main/java/org/bukkit/entity/Minecart.java b/src/main/java/org/bukkit/entity/Minecart.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 @@ -384,6 +388,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + @Deprecated(forRemoval = true) // Paper public void setBounce(boolean doesBounce); } +diff --git a/src/main/java/org/bukkit/entity/SplashPotion.java b/src/main/java/org/bukkit/entity/SplashPotion.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/entity/SplashPotion.java ++++ b/src/main/java/org/bukkit/entity/SplashPotion.java +@@ -0,0 +0,0 @@ package org.bukkit.entity; + /** + * Represents a thrown splash potion bottle + * +- * @deprecated splash status depends on only on the potion item. ++ * @deprecated should not be used for anything, use {@link ThrownPotion} and ++ * set the potion via the methods there. + */ +-@Deprecated ++@Deprecated(forRemoval = true) // Paper + public interface SplashPotion extends ThrownPotion { } diff --git a/src/main/java/org/bukkit/event/enchantment/PrepareItemEnchantEvent.java b/src/main/java/org/bukkit/event/enchantment/PrepareItemEnchantEvent.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/event/enchantment/PrepareItemEnchantEvent.java diff --git a/patches/server/Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch b/patches/server/Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch new file mode 100644 index 0000000000..9ba97fba10 --- /dev/null +++ b/patches/server/Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch @@ -0,0 +1,21 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic +Date: Thu, 21 Apr 2022 18:18:02 -0700 +Subject: [PATCH] Fix CCE for SplashPotion and LingeringPotion spawning + +Remove in 1.19 along with the SplashPotion and +LingeringPotion interfaces + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java +@@ -0,0 +0,0 @@ import org.bukkit.entity.ThrownPotion; + import org.bukkit.inventory.ItemStack; + import org.bukkit.potion.PotionEffect; + +-public class CraftThrownPotion extends CraftProjectile implements ThrownPotion { ++public class CraftThrownPotion extends CraftProjectile implements ThrownPotion, org.bukkit.entity.SplashPotion, org.bukkit.entity.LingeringPotion { // Paper - implement other classes to avoid violating spawn method generic contracts + public CraftThrownPotion(CraftServer server, net.minecraft.world.entity.projectile.ThrownPotion entity) { + super(server, entity); + }