diff options
Diffstat (limited to 'patch-remap/og/net/minecraft/world/effect/MobEffectUtil.patch')
-rw-r--r-- | patch-remap/og/net/minecraft/world/effect/MobEffectUtil.patch | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/effect/MobEffectUtil.patch b/patch-remap/og/net/minecraft/world/effect/MobEffectUtil.patch new file mode 100644 index 0000000000..f243643eea --- /dev/null +++ b/patch-remap/og/net/minecraft/world/effect/MobEffectUtil.patch @@ -0,0 +1,23 @@ +--- a/net/minecraft/world/effect/MobEffectUtil.java ++++ b/net/minecraft/world/effect/MobEffectUtil.java +@@ -49,13 +49,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).endsWithin(i - 1)); + }); + + list.forEach((entityplayer) -> { +- entityplayer.addEffect(new MobEffect(mobeffect), entity); ++ entityplayer.addEffect(new MobEffect(mobeffect), entity, cause); // CraftBukkit + }); + return list; + } |