mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-25 09:59:15 +00:00
direct iteration on Sensing.tick()
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Taiyou06 <kaandindar21@gmail.com>
|
||||
Date: Sun, 23 Mar 2025 20:48:16 +0100
|
||||
Subject: [PATCH] Direct iteration on Sensing.tick
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/ai/sensing/Sensing.java b/net/minecraft/world/entity/ai/sensing/Sensing.java
|
||||
index cc25f5838aec5ed9fca2fb8b0322fafad9397a46..2ea5095a4290f5236caad7ea30a59d9b3eb32aaa 100644
|
||||
--- a/net/minecraft/world/entity/ai/sensing/Sensing.java
|
||||
+++ b/net/minecraft/world/entity/ai/sensing/Sensing.java
|
||||
@@ -34,12 +34,16 @@ public class Sensing {
|
||||
|
||||
public void tick() {
|
||||
if (this.expiring == null) { // Gale - Petal - reduce line of sight updates
|
||||
- this.seen.clear();
|
||||
+ this.seen.clear();
|
||||
// Gale start - Petal - reduce line of sight updates
|
||||
} else {
|
||||
var expiringNow = this.expiring[this.nextToExpireIndex];
|
||||
|
||||
- expiringNow.forEach(this.seen::remove);
|
||||
+ // Leaf - use direct iteration
|
||||
+ var iterator = expiringNow.iterator();
|
||||
+ while (iterator.hasNext()) {
|
||||
+ this.seen.remove(iterator.nextInt());
|
||||
+ }
|
||||
expiringNow.clear();
|
||||
|
||||
this.currentCacheAddIndex++;
|
||||
Reference in New Issue
Block a user