From eed4457419417a768f3d16c6a4d9365089022b8d Mon Sep 17 00:00:00 2001 From: Helvetica Volubi Date: Tue, 13 Jan 2026 21:06:48 +0800 Subject: [PATCH] add removed check before all checks start in addEffects --- ...ck-before-all-checks-start-in-addEffe.patch | 18 ++++++++++++++++++ qodana.yaml | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 lophine-server/minecraft-patches/features/0042-Add-removed-check-before-all-checks-start-in-addEffe.patch diff --git a/lophine-server/minecraft-patches/features/0042-Add-removed-check-before-all-checks-start-in-addEffe.patch b/lophine-server/minecraft-patches/features/0042-Add-removed-check-before-all-checks-start-in-addEffe.patch new file mode 100644 index 0000000..3777a4d --- /dev/null +++ b/lophine-server/minecraft-patches/features/0042-Add-removed-check-before-all-checks-start-in-addEffe.patch @@ -0,0 +1,18 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Helvetica Volubi +Date: Tue, 13 Jan 2026 21:04:59 +0800 +Subject: [PATCH] Add removed check before all checks start in addEffect + + +diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java +index 0e019e3b870c9a2fc1ed788d444c3e2be2a2b5f2..4f7cf7c51dc47acdd29d45f571636dc77c6c006f 100644 +--- a/net/minecraft/world/entity/LivingEntity.java ++++ b/net/minecraft/world/entity/LivingEntity.java +@@ -1186,6 +1186,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.isRemoved()) return false; // Lophine - shouldn't be possible to add effects to removed entity + if (!this.hasNullCallback()) ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this, "Cannot add effects to entities asynchronously"); // Folia - region threading + if (this.isTickingEffects) { + this.effectsToProcess.add(new ProcessableEffect(effectInstance, cause)); diff --git a/qodana.yaml b/qodana.yaml index ff32305..8e7b8ce 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -3,7 +3,7 @@ #################################################################################################################### version: "1.0" -linter: jetbrains/qodana-jvm:2025.2 +linter: jetbrains/qodana-jvm:2025.3 profile: name: qodana.recommended include: