mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Add missing effect cause and deprecate PATROL_CAPTAIN cause (#10958)
This commit is contained in:
parent
ef2ce51913
commit
2891c40adb
2 changed files with 28 additions and 0 deletions
|
@ -1003,6 +1003,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
return offers;
|
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
|
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
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/org/bukkit/event/entity/EntityTargetLivingEntityEvent.java
|
--- a/src/main/java/org/bukkit/event/entity/EntityTargetLivingEntityEvent.java
|
||||||
|
|
|
@ -30,6 +30,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stack.isEmpty()) {
|
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
|
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
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/item/SuspiciousStewItem.java
|
--- a/src/main/java/net/minecraft/world/item/SuspiciousStewItem.java
|
||||||
|
|
Loading…
Reference in a new issue