mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-07 19:05:49 +00:00
Co-authored-by: Bjarne Koll <git@lynxplay.dev> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Co-authored-by: MiniDigger | Martin <admin@minidigger.dev> Co-authored-by: Nassim Jahnke <nassim@njahnke.dev> Co-authored-by: Noah van der Aa <ndvdaa@gmail.com> Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Co-authored-by: Shane Freeder <theboyetronic@gmail.com> Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com> Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com> Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
30 lines
1.9 KiB
Diff
30 lines
1.9 KiB
Diff
--- a/net/minecraft/world/effect/MobEffectInstance.java
|
|
+++ b/net/minecraft/world/effect/MobEffectInstance.java
|
|
@@ -219,7 +_,7 @@
|
|
return false;
|
|
} else {
|
|
int i = this.isInfiniteDuration() ? entity.tickCount : this.duration;
|
|
- if (this.effect.value().shouldApplyEffectTickThisTick(i, this.amplifier) && !this.effect.value().applyEffectTick(level, entity, this.amplifier)) {
|
|
+ if (this.effect.value().shouldApplyEffectTickThisTick(i, this.amplifier) && new io.papermc.paper.event.entity.EntityEffectTickEvent(entity.getBukkitLivingEntity(), org.bukkit.craftbukkit.potion.CraftPotionEffectType.minecraftHolderToBukkit(this.effect), this.amplifier).callEvent() && !this.effect.value().applyEffectTick(level, entity, this.amplifier)) { // Paper - Add EntityEffectTickEvent
|
|
return false;
|
|
} else {
|
|
this.tickDownDuration();
|
|
@@ -415,7 +_,7 @@
|
|
.apply(instance, MobEffectInstance.Details::create)
|
|
)
|
|
);
|
|
- public static final StreamCodec<ByteBuf, MobEffectInstance.Details> STREAM_CODEC = StreamCodec.recursive(
|
|
+ public static final StreamCodec<net.minecraft.network.FriendlyByteBuf, MobEffectInstance.Details> STREAM_CODEC = StreamCodec.recursive( // Paper - Track codec depth
|
|
codec -> StreamCodec.composite(
|
|
ByteBufCodecs.VAR_INT,
|
|
MobEffectInstance.Details::amplifier,
|
|
@@ -427,7 +_,7 @@
|
|
MobEffectInstance.Details::showParticles,
|
|
ByteBufCodecs.BOOL,
|
|
MobEffectInstance.Details::showIcon,
|
|
- codec.apply(ByteBufCodecs::optional),
|
|
+ codec.apply(ByteBufCodecs::increaseDepth).apply(ByteBufCodecs::optional), // Paper - Track codec depth
|
|
MobEffectInstance.Details::hiddenEffect,
|
|
MobEffectInstance.Details::new
|
|
)
|