Missing effect cause

This commit is contained in:
Lulu13022002 2022-08-16 19:44:55 +02:00
parent bde548833e
commit b24b187864
2 changed files with 15 additions and 2 deletions

View file

@ -124,6 +124,15 @@
this.setFlag(2, nearTarget);
}
@@ -602,7 +636,7 @@
if (mobeffect != null) {
this.usePlayerItem(player, hand, itemstack);
if (!this.level().isClientSide) {
- this.addEffect(mobeffect);
+ this.addEffect(mobeffect, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.FOOD); // Paper - Add missing effect cause
}
return InteractionResult.SUCCESS;
@@ -671,8 +705,14 @@
if (this.isInvulnerableTo(world, source)) {
return false;

View file

@ -28,7 +28,7 @@
}
@Override
@@ -414,7 +421,7 @@
@@ -414,10 +421,10 @@
int i = mobeffect != null ? mobeffect.getDuration() : 0;
int j = Math.min(2400, 100 + i);
@ -36,7 +36,11 @@
+ player.addEffect(new MobEffectInstance(MobEffects.REGENERATION, j, 0), this, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.AXOLOTL); // CraftBukkit
}
player.removeEffect(MobEffects.DIG_SLOWDOWN);
- player.removeEffect(MobEffects.DIG_SLOWDOWN);
+ player.removeEffect(MobEffects.DIG_SLOWDOWN, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.AXOLOTL); // Paper - Add missing effect cause
}
@Override
@@ -464,7 +471,7 @@
@Override