From ae45e092235323c6709742b3a343504451df6319 Mon Sep 17 00:00:00 2001 From: ShaneBee Date: Sun, 2 Feb 2020 11:16:01 +1100 Subject: [PATCH] SPIGOT-5559: Add EntityPotionEffectEvent causes for bee, raiders and wither rose --- nms-patches/BlockWitherRose.patch | 11 +++++++++++ nms-patches/EntityBee.patch | 8 +++++++- nms-patches/EntityRaider.patch | 9 +++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 nms-patches/BlockWitherRose.patch diff --git a/nms-patches/BlockWitherRose.patch b/nms-patches/BlockWitherRose.patch new file mode 100644 index 0000000000..1e0256b9b0 --- /dev/null +++ b/nms-patches/BlockWitherRose.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/server/BlockWitherRose.java ++++ b/net/minecraft/server/BlockWitherRose.java +@@ -20,7 +20,7 @@ + EntityLiving entityliving = (EntityLiving) entity; + + if (!entityliving.isInvulnerable(DamageSource.WITHER)) { +- entityliving.addEffect(new MobEffect(MobEffects.WITHER, 40)); ++ entityliving.addEffect(new MobEffect(MobEffects.WITHER, 40), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.WITHER_ROSE); // CraftBukkit + } + } + diff --git a/nms-patches/EntityBee.patch b/nms-patches/EntityBee.patch index bff0add189..a1aa32f1eb 100644 --- a/nms-patches/EntityBee.patch +++ b/nms-patches/EntityBee.patch @@ -1,6 +1,12 @@ --- a/net/minecraft/server/EntityBee.java +++ b/net/minecraft/server/EntityBee.java -@@ -157,7 +157,7 @@ +@@ -152,12 +152,12 @@ + } + + if (b0 > 0) { +- ((EntityLiving) entity).addEffect(new MobEffect(MobEffects.POISON, b0 * 20, 0)); ++ ((EntityLiving) entity).addEffect(new MobEffect(MobEffects.POISON, b0 * 20, 0), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ATTACK); // CraftBukkit + } } this.setHasStung(true); diff --git a/nms-patches/EntityRaider.patch b/nms-patches/EntityRaider.patch index 2d89fc266b..fed93f7f42 100644 --- a/nms-patches/EntityRaider.patch +++ b/nms-patches/EntityRaider.patch @@ -1,5 +1,14 @@ --- a/net/minecraft/server/EntityRaider.java +++ b/net/minecraft/server/EntityRaider.java +@@ -131,7 +131,7 @@ + MobEffect mobeffect1 = new MobEffect(MobEffects.BAD_OMEN, 120000, i, false, false, true); + + if (!this.world.getGameRules().getBoolean(GameRules.DISABLE_RAIDS)) { +- entityhuman.addEffect(mobeffect1); ++ entityhuman.addEffect(mobeffect1, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.PATROL_CAPTAIN); // CraftBukkit + } + } + } @@ -397,7 +397,7 @@ while (iterator.hasNext()) { EntityRaider entityraider = (EntityRaider) iterator.next();