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

fix async pathfind bees in raid (#422)

This commit is contained in:
Taiyou
2025-07-22 20:49:07 +02:00
committed by GitHub
parent aa6668fc03
commit 847cafc34d

View File

@@ -560,20 +560,25 @@ index 1f96fd5085bacb4c584576c7cb9f51e7898e9b03..03b6c8c8dcd42e864751e68be9d35d20
+ // Leaf end - Kaiiju - await on async path processing
}
diff --git a/net/minecraft/world/entity/animal/Bee.java b/net/minecraft/world/entity/animal/Bee.java
index 7573f1be88ca23096e02efe2fa933429fa4421ba..c25b100fb56f5ac02dcb6fd5c7a11662c43852b4 100644
index 7573f1be88ca23096e02efe2fa933429fa4421ba..4821ec280cbd6f4b19241748c3bcc3fb66149ac2 100644
--- a/net/minecraft/world/entity/animal/Bee.java
+++ b/net/minecraft/world/entity/animal/Bee.java
@@ -937,7 +937,8 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
} else {
@@ -938,6 +938,14 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
Bee.this.pathfindRandomlyTowards(Bee.this.hivePos);
}
- } else {
+ //} else if (navigation.getPath() != null && navigation.getPath().isProcessed()) { // Kaiiju - petal - check processing // todo
+ } else {
} else {
+ // Leaf start - async path processing fix
+ // Wait for path processing before making navigation decisions
+ Path currentPath = Bee.this.navigation.getPath();
+ if (org.dreeam.leaf.config.modules.async.AsyncPathfinding.enabled && currentPath != null && !currentPath.isProcessed()) {
+ return;
+ }
+ // Leaf end - async path processing fix
+
boolean flag = this.pathfindDirectlyTowards(Bee.this.hivePos);
if (!flag) {
this.dropAndBlacklistHive();
@@ -991,7 +992,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
@@ -991,7 +999,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
return true;
} else {
Path path = Bee.this.navigation.getPath();