From 2891c40adb020f67512577151591c932dab9b18c Mon Sep 17 00:00:00 2001 From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Date: Sun, 23 Jun 2024 22:08:13 +0200 Subject: [PATCH] Add missing effect cause and deprecate PATROL_CAPTAIN cause (#10958) --- patches/api/Fix-Spigot-annotation-mistakes.patch | 15 +++++++++++++++ patches/server/Missing-effect-cause.patch | 13 +++++++++++++ 2 files changed, 28 insertions(+) diff --git a/patches/api/Fix-Spigot-annotation-mistakes.patch b/patches/api/Fix-Spigot-annotation-mistakes.patch index 6475c17f43..4bc451792a 100644 --- a/patches/api/Fix-Spigot-annotation-mistakes.patch +++ b/patches/api/Fix-Spigot-annotation-mistakes.patch @@ -1003,6 +1003,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return offers; } +diff --git a/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java b/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java ++++ b/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java +@@ -0,0 +0,0 @@ public class EntityPotionEffectEvent extends EntityEvent implements Cancellable + MILK, + /** + * When a player gets bad omen after killing a patrol captain. ++ * ++ * @deprecated no longer used, player now gets an ominous bottle instead + */ ++ @Deprecated(since = "1.21") // Paper + PATROL_CAPTAIN, + /** + * When a potion effect is modified through the plugin methods. diff --git a/src/main/java/org/bukkit/event/entity/EntityTargetLivingEntityEvent.java b/src/main/java/org/bukkit/event/entity/EntityTargetLivingEntityEvent.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/event/entity/EntityTargetLivingEntityEvent.java diff --git a/patches/server/Missing-effect-cause.patch b/patches/server/Missing-effect-cause.patch index e4a8c0a517..d9b0567594 100644 --- a/patches/server/Missing-effect-cause.patch +++ b/patches/server/Missing-effect-cause.patch @@ -30,6 +30,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } if (stack.isEmpty()) { +diff --git a/src/main/java/net/minecraft/world/item/OminousBottleItem.java b/src/main/java/net/minecraft/world/item/OminousBottleItem.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/item/OminousBottleItem.java ++++ b/src/main/java/net/minecraft/world/item/OminousBottleItem.java +@@ -0,0 +0,0 @@ public class OminousBottleItem extends Item { + if (!world.isClientSide) { + world.playSound(null, user.blockPosition(), SoundEvents.OMINOUS_BOTTLE_DISPOSE, user.getSoundSource(), 1.0F, 1.0F); + Integer integer = stack.getOrDefault(DataComponents.OMINOUS_BOTTLE_AMPLIFIER, Integer.valueOf(0)); +- user.addEffect(new MobEffectInstance(MobEffects.BAD_OMEN, 120000, integer, false, false, true)); ++ user.addEffect(new MobEffectInstance(MobEffects.BAD_OMEN, 120000, integer, false, false, true), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.POTION_DRINK); // Paper - Add missing effect cause + } + + stack.consume(1, user); diff --git a/src/main/java/net/minecraft/world/item/SuspiciousStewItem.java b/src/main/java/net/minecraft/world/item/SuspiciousStewItem.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/item/SuspiciousStewItem.java