Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build-data/paper.at
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ public net.minecraft.world.damagesource.DamageSource <init>(Lnet/minecraft/core/
public net.minecraft.world.effect.MobEffect attributeModifiers
public net.minecraft.world.effect.MobEffect$AttributeTemplate
public net.minecraft.world.effect.MobEffectInstance hiddenEffect
public net.minecraft.world.effect.MobEffectInstance isShorterDurationThan(Lnet/minecraft/world/effect/MobEffectInstance;)Z
public net.minecraft.world.entity.AreaEffectCloud durationOnUse
public net.minecraft.world.entity.AreaEffectCloud owner
public net.minecraft.world.entity.AreaEffectCloud potionContents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -523,10 +523,10 @@ index 2cae59fbc6a279e70c388ea7cc6f6f5f749f46a1..8dcd36b3d29c3d9913675c918fa509d7
movement = this.maybeBackOffFromEdge(movement, type);
Vec3 vec3 = this.collide(movement);
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
index d5e304c9431bf3d7ad151e68e955b113d3c599ef..90483699b3f2efe9945c849adfdd38422e3a3458 100644
index d453c4c35a57622bcac71dce2a7619d0a1d15036..46bd6b31dd99e7c9176638460b166cb8a1698935 100644
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
@@ -3246,6 +3246,14 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
@@ -3258,6 +3258,14 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@
}
}

@@ -983,21 +_,57 @@
@@ -983,23 +_,71 @@
}

public final boolean addEffect(MobEffectInstance effectInstance) {
Expand Down Expand Up @@ -372,8 +372,12 @@
boolean flag = false;
+ // CraftBukkit start
+ boolean override = false;
+ // Paper start - Properly update hidden effects
+ boolean addAsHiddenEffect = false;
+ if (mobEffectInstance != null) {
+ override = new MobEffectInstance(mobEffectInstance).update(effectInstance);
+ addAsHiddenEffect = mobEffectInstance.getAmplifier() > effectInstance.getAmplifier() && mobEffectInstance.isShorterDurationThan(effectInstance);
+ // Paper end - Properly update hidden effects
+ }
+
+ if (fireEvent) { // Paper - Don't fire sync event during generation
Expand All @@ -395,7 +399,17 @@
+ mobEffectInstance.update(effectInstance);
this.onEffectUpdated(mobEffectInstance, true, entity);
flag = true;
+ // Paper start - Properly update hidden effects
+ } else if (addAsHiddenEffect) {
+ if (mobEffectInstance.hiddenEffect == null) {
+ mobEffectInstance.hiddenEffect = new MobEffectInstance(effectInstance);
+ } else {
+ mobEffectInstance.hiddenEffect.update(effectInstance);
+ }
+ // Paper end - Properly update hidden effects
}

effectInstance.onEffectStarted(this);
@@ -1036,11 +_,37 @@

@Nullable
Expand Down
Loading