PaperMC/paper-server/nms-patches/net/minecraft/world/effect/MobEffectUtil.patch
CraftBukkit/Spigot 8b26bb8f3e Update to Minecraft 1.19.3
By: md_5 <git@md-5.net>
2022-12-08 03:00:00 +11:00

23 lines
1.5 KiB
Diff

--- a/net/minecraft/world/effect/MobEffectUtil.java
+++ b/net/minecraft/world/effect/MobEffectUtil.java
@@ -44,13 +44,19 @@
}
public static List<EntityPlayer> addEffectToPlayersAround(WorldServer worldserver, @Nullable Entity entity, Vec3D vec3d, double d0, MobEffect mobeffect, int i) {
+ // CraftBukkit start
+ return addEffectToPlayersAround(worldserver, entity, vec3d, d0, mobeffect, i, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.UNKNOWN);
+ }
+
+ public static List<EntityPlayer> addEffectToPlayersAround(WorldServer worldserver, @Nullable Entity entity, Vec3D vec3d, double d0, MobEffect mobeffect, int i, org.bukkit.event.entity.EntityPotionEffectEvent.Cause cause) {
+ // CraftBukkit end
MobEffectList mobeffectlist = mobeffect.getEffect();
List<EntityPlayer> list = worldserver.getPlayers((entityplayer) -> {
return entityplayer.gameMode.isSurvival() && (entity == null || !entity.isAlliedTo((Entity) entityplayer)) && vec3d.closerThan(entityplayer.position(), d0) && (!entityplayer.hasEffect(mobeffectlist) || entityplayer.getEffect(mobeffectlist).getAmplifier() < mobeffect.getAmplifier() || entityplayer.getEffect(mobeffectlist).getDuration() < i);
});
list.forEach((entityplayer) -> {
- entityplayer.addEffect(new MobEffect(mobeffect), entity);
+ entityplayer.addEffect(new MobEffect(mobeffect), entity, cause); // CraftBukkit
});
return list;
}