mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-26 18:39:23 +00:00
Current implementation of OP lock is not an appropriate solution to prevent plugins that contain backdoor or malicious code. There are many ways to bypass this check to manipulate the OP list or permissions. The best way to prevent this kind of grief is to get plugins from valid and trustworthy places.
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..1799cdc0b6c1e585e7e1eeab3828ea0252ae2097 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();
|