9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2026-01-06 15:51:33 +00:00
Files
LeavesMC/leaves-server/minecraft-patches/features/0137-Bring-back-LivingEntity-effect-CME.patch
2025-09-28 09:45:17 +08:00

20 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MC_XiaoHei <xor7xiaohei@gmail.com>
Date: Sat, 2 Aug 2025 14:38:52 +0800
Subject: [PATCH] Bring back LivingEntity effect CME
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
index e7737ba60e7e2460553b096fbdf9550242eb75b6..d4a3e4261301e587be1ee4ac7331b64a69608c17 100644
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
@@ -1157,7 +1157,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
public boolean addEffect(MobEffectInstance effectInstance, @Nullable Entity entity, EntityPotionEffectEvent.Cause cause, boolean fireEvent) {
// Paper end - Don't fire sync event during generation
// org.spigotmc.AsyncCatcher.catchOp("effect add"); // Spigot // Paper - move to API
- if (this.isTickingEffects) {
+ if (this.isTickingEffects && cause == org.bukkit.event.entity.EntityPotionEffectEvent.Cause.PLUGIN) { // Leaves - bring back LivingEntity effect CME
this.effectsToProcess.add(new ProcessableEffect(effectInstance, cause));
return true;
}