9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-21 16:09:19 +00:00

[ci skip] cleanup

This commit is contained in:
Dreeam
2025-06-11 03:59:45 +08:00
parent b6ec152037
commit ccab3256c2
92 changed files with 135 additions and 139 deletions

View File

@@ -0,0 +1,29 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Taiyou06 <kaandindar21@gmail.com>
Date: Mon, 12 May 2025 19:11:16 +0200
Subject: [PATCH] Remove streams in MobSensor
diff --git a/net/minecraft/world/entity/ai/sensing/MobSensor.java b/net/minecraft/world/entity/ai/sensing/MobSensor.java
index bda210b4809a5aade7ab4d0f26fdda4d5f53f619..2271196768bfc90626e007a70602f818c832e348 100644
--- a/net/minecraft/world/entity/ai/sensing/MobSensor.java
+++ b/net/minecraft/world/entity/ai/sensing/MobSensor.java
@@ -40,10 +40,15 @@ public class MobSensor<T extends LivingEntity> extends Sensor<T> {
public void checkForMobsNearby(T sensingEntity) {
Optional<List<LivingEntity>> memory = sensingEntity.getBrain().getMemory(MemoryModuleType.NEAREST_LIVING_ENTITIES);
if (!memory.isEmpty()) {
- boolean flag = memory.get().stream().anyMatch(livingEntity -> this.mobTest.test(sensingEntity, livingEntity));
- if (flag) {
- this.mobDetected(sensingEntity);
+ // Leaf start - Remove streams in MobSensor
+ List<LivingEntity> entities = memory.get();
+ for (LivingEntity livingEntity : entities) {
+ if (this.mobTest.test(sensingEntity, livingEntity)) {
+ this.mobDetected(sensingEntity);
+ break;
+ }
}
+ // Leaf end - Remove streams in MobSensor
}
}