mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-28 03:19:21 +00:00
Paper PR: Fix async command building throwing CME in some cases
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: hayanesuru <hayanesuru@outlook.jp>
|
||||
Date: Sat, 30 Aug 2025 20:30:37 +0900
|
||||
Subject: [PATCH] optimize tickEffects
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||
index efbad651cd6fa1ea73265761f8e91f84c07316d5..dc5cbabe8909cedf79e915a6129bfe414d69d106 100644
|
||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -951,6 +951,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
|
||||
protected void tickEffects() {
|
||||
if (this.level() instanceof ServerLevel serverLevel) {
|
||||
+ if (!this.activeEffects.isEmpty()) { // Leaf - optimize tickEffects
|
||||
Iterator<Holder<MobEffect>> iterator = this.activeEffects.keySet().iterator();
|
||||
|
||||
this.isTickingEffects = true; // CraftBukkit
|
||||
@@ -976,6 +977,8 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
|
||||
// CraftBukkit start
|
||||
this.isTickingEffects = false;
|
||||
+ } // Leaf - optimize tickEffects
|
||||
+ if (!effectsToProcess.isEmpty()) { // Leaf - optimize tickEffects
|
||||
for (ProcessableEffect effect : this.effectsToProcess) {
|
||||
if (effect.effect != null) {
|
||||
this.addEffect(effect.effect, effect.cause);
|
||||
@@ -984,6 +987,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
}
|
||||
}
|
||||
this.effectsToProcess.clear();
|
||||
+ } // Leaf - optimize tickEffects
|
||||
// CraftBukkit end
|
||||
if (this.effectsDirty) {
|
||||
this.updateInvisibilityStatus();
|
||||
Reference in New Issue
Block a user