aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower-stripped/net/minecraft/world/effect/MobEffectUtil.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/effect/MobEffectUtil.java.patch')
-rw-r--r--patch-remap/mache-vineflower-stripped/net/minecraft/world/effect/MobEffectUtil.java.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/effect/MobEffectUtil.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/effect/MobEffectUtil.java.patch
new file mode 100644
index 0000000000..34b576545d
--- /dev/null
+++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/effect/MobEffectUtil.java.patch
@@ -0,0 +1,40 @@
+--- a/net/minecraft/world/effect/MobEffectUtil.java
++++ b/net/minecraft/world/effect/MobEffectUtil.java
+@@ -43,21 +48,21 @@
+ return entity.hasEffect(MobEffects.WATER_BREATHING) || entity.hasEffect(MobEffects.CONDUIT_POWER);
+ }
+
+- public static List<ServerPlayer> addEffectToPlayersAround(
+- ServerLevel level, @Nullable Entity source, Vec3 pos, double radius, MobEffectInstance effect, int duration
+- ) {
+- MobEffect effect1 = effect.getEffect();
+- List<ServerPlayer> players = level.getPlayers(
+- serverPlayer -> serverPlayer.gameMode.isSurvival()
+- && (source == null || !source.isAlliedTo(serverPlayer))
+- && pos.closerThan(serverPlayer.position(), radius)
+- && (
+- !serverPlayer.hasEffect(effect1)
+- || serverPlayer.getEffect(effect1).getAmplifier() < effect.getAmplifier()
+- || serverPlayer.getEffect(effect1).endsWithin(duration - 1)
+- )
+- );
+- players.forEach(serverPlayer -> serverPlayer.addEffect(new MobEffectInstance(effect), source));
+- return players;
++ 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((entityplayer) -> {
++ entityplayer.addEffect(new MobEffectInstance(mobeffect), entity, cause); // CraftBukkit
++ });
++ return list;
++ }
+ }