aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/world/effect/MobEffectUtil.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/effect/MobEffectUtil.java.patch')
-rw-r--r--patch-remap/mache-spigotflower-stripped/net/minecraft/world/effect/MobEffectUtil.java.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/effect/MobEffectUtil.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/effect/MobEffectUtil.java.patch
new file mode 100644
index 0000000000..c566068ab2
--- /dev/null
+++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/effect/MobEffectUtil.java.patch
@@ -0,0 +1,29 @@
+--- a/net/minecraft/world/effect/MobEffectUtil.java
++++ b/net/minecraft/world/effect/MobEffectUtil.java
+@@ -48,14 +48,20 @@
+ return livingentity.hasEffect(MobEffects.WATER_BREATHING) || livingentity.hasEffect(MobEffects.CONDUIT_POWER);
+ }
+
+- public static List<ServerPlayer> addEffectToPlayersAround(ServerLevel serverlevel, @Nullable Entity entity, Vec3 vec3, double d0, MobEffectInstance mobeffectinstance, int i) {
+- MobEffect mobeffect = mobeffectinstance.getEffect();
+- List<ServerPlayer> list = serverlevel.getPlayers((serverplayer) -> {
+- return serverplayer.gameMode.isSurvival() && (entity == null || !entity.isAlliedTo((Entity) serverplayer)) && vec3.closerThan(serverplayer.position(), d0) && (!serverplayer.hasEffect(mobeffect) || serverplayer.getEffect(mobeffect).getAmplifier() < mobeffectinstance.getAmplifier() || serverplayer.getEffect(mobeffect).endsWithin(i - 1));
++ public static List<ServerPlayer> addEffectToPlayersAround(ServerLevel level, @Nullable Entity source, Vec3 pos, double radius, MobEffectInstance mobeffect, int effect) {
++ // CraftBukkit start
++ return addEffectToPlayersAround(level, source, pos, radius, mobeffect, effect, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.UNKNOWN);
++ }
++
++ public static List<ServerPlayer> addEffectToPlayersAround(ServerLevel worldserver, @Nullable Entity entity, Vec3 vec3d, double d0, MobEffectInstance mobeffect, int i, org.bukkit.event.entity.EntityPotionEffectEvent.Cause cause) {
++ // CraftBukkit end
++ MobEffect mobeffectlist = mobeffect.getEffect();
++ List<ServerPlayer> 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((serverplayer) -> {
+- serverplayer.addEffect(new MobEffectInstance(mobeffectinstance), entity);
++ list.forEach((entityplayer) -> {
++ entityplayer.addEffect(new MobEffectInstance(mobeffect), entity, cause); // CraftBukkit
+ });
+ return list;
+ }