9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-23 17:09:29 +00:00

Step3, Where is my Doritos?

This commit is contained in:
Dreeam
2024-12-13 21:19:57 -05:00
parent dcb406aae5
commit ed40c14ed5
83 changed files with 662 additions and 583 deletions

View File

@@ -0,0 +1,32 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Taiyou06 <kaandindar21@gmail.com>
Date: Tue, 9 Nov 2077 00:00:00 +0800
Subject: [PATCH] Remove stream in GateBehavior
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java b/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java
index d4581127366736c54f74e4ef7479236b18fb487d..67aa59deebdf47e53d9f6949b26c9b313de45035 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java
@@ -73,9 +73,20 @@ public class GateBehavior<E extends LivingEntity> implements BehaviorControl<E>
}
}
// Paper end - Perf: Remove streams from hot code
- if (this.behaviors.stream().noneMatch(task -> task.getStatus() == Behavior.Status.RUNNING)) {
+
+ // Leaf start - Remove more streams in GateBehavior
+ boolean hasRunningTask = false;
+ for (final BehaviorControl<? super E> task : this.behaviors) {
+ if (task.getStatus() == Behavior.Status.RUNNING) {
+ hasRunningTask = true;
+ break;
+ }
+ }
+
+ if (!hasRunningTask) {
this.doStop(world, entity, time);
}
+ // Leaf end - Remove more streams in GateBehavior
}
@Override