0
0
mirror of https://github.com/PaperMC/Paper.git synced 2025-03-01 05:41:29 +00:00

29 lines
1.8 KiB
Diff
Raw Permalink Normal View History

2025-01-13 01:50:22 +09:00
--- a/net/minecraft/world/effect/MobEffectInstance.java
+++ b/net/minecraft/world/effect/MobEffectInstance.java
@@ -216,6 +_,7 @@
int i = this.isInfiniteDuration() ? entity.tickCount : this.duration;
if (entity.level() instanceof ServerLevel serverLevel
&& 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() // Paper - Add EntityEffectTickEvent
&& !this.effect.value().applyEffectTick(serverLevel, entity, this.amplifier)) {
entity.removeEffect(this.effect);
}
2025-02-25 21:44:51 +01:00
@@ -408,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,
@@ -420,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
)