2022-06-07 18:00:00 +02:00
|
|
|
--- a/net/minecraft/world/effect/MobEffectUtil.java
|
|
|
|
+++ b/net/minecraft/world/effect/MobEffectUtil.java
|
2024-04-23 17:15:00 +02:00
|
|
|
@@ -50,13 +50,19 @@
|
2022-06-07 18:00:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
2024-04-23 17:15:00 +02:00
|
|
|
Holder<MobEffectList> holder = mobeffect.getEffect();
|
2022-06-07 18:00:00 +02:00
|
|
|
List<EntityPlayer> list = worldserver.getPlayers((entityplayer) -> {
|
2024-04-23 17:15:00 +02:00
|
|
|
return entityplayer.gameMode.isSurvival() && (entity == null || !entity.isAlliedTo((Entity) entityplayer)) && vec3d.closerThan(entityplayer.position(), d0) && (!entityplayer.hasEffect(holder) || entityplayer.getEffect(holder).getAmplifier() < mobeffect.getAmplifier() || entityplayer.getEffect(holder).endsWithin(i - 1));
|
2022-06-07 18:00:00 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
list.forEach((entityplayer) -> {
|
|
|
|
- entityplayer.addEffect(new MobEffect(mobeffect), entity);
|
|
|
|
+ entityplayer.addEffect(new MobEffect(mobeffect), entity, cause); // CraftBukkit
|
|
|
|
});
|
|
|
|
return list;
|
|
|
|
}
|