9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2026-01-06 15:51:31 +00:00

backport: fix async pathfind bees in raid

This commit is contained in:
Taiyou06
2025-07-22 21:28:01 +02:00
parent 54022f0f12
commit e31d1587a9

View File

@@ -562,18 +562,26 @@ index 1f96fd5085bacb4c584576c7cb9f51e7898e9b03..8819717c5307a90abc493cf801b4e795
+ // 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 d5727999eb67ff30dbf47865d59452483338e170..110e49f17eb2c4fdf360263b00f4736de04ffcad 100644
index d5727999eb67ff30dbf47865d59452483338e170..14253587a6392cea0cd12073ff4d90fe5da07033 100644
--- a/net/minecraft/world/entity/animal/Bee.java
+++ b/net/minecraft/world/entity/animal/Bee.java
@@ -936,6 +936,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
} else {
@@ -937,6 +937,15 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
Bee.this.pathfindRandomlyTowards(Bee.this.hivePos);
}
+ //} else if (navigation.getPath() != null && navigation.getPath().isProcessed()) { // Kaiiju - petal - check processing // todo
} 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; // Wait for path to be processed
+ }
+ // Leaf end - async path processing fix
+
boolean flag = this.pathfindDirectlyTowards(Bee.this.hivePos);
if (!flag) {
@@ -990,7 +991,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
this.dropAndBlacklistHive();
@@ -990,7 +999,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
return true;
} else {
Path path = Bee.this.navigation.getPath();