mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-23 17:09:29 +00:00
36 lines
1.7 KiB
Diff
36 lines
1.7 KiB
Diff
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 8baa17d2eadfa83b1fcb36fcd1408e917b883989..0d28c1b11dacd6487185d9f8a5a042afa3a9863b 100644
|
|
--- a/net/minecraft/world/entity/LivingEntity.java
|
|
+++ b/net/minecraft/world/entity/LivingEntity.java
|
|
@@ -950,6 +950,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
|
|
@@ -975,6 +976,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);
|
|
@@ -983,6 +986,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
|
}
|
|
}
|
|
this.effectsToProcess.clear();
|
|
+ } // Leaf - optimize tickEffects
|
|
// CraftBukkit end
|
|
if (this.effectsDirty) {
|
|
this.updateInvisibilityStatus();
|