mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-19 15:09:25 +00:00
33 lines
1.4 KiB
Diff
33 lines
1.4 KiB
Diff
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
|