feat: 1.19.1
This commit is contained in:
@@ -752,7 +752,7 @@ index f610c06d7bb51ec2c63863dd46711712986a106a..ff5f0788e1df9ea7a96a8fea475cc010
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
||||
index 3f672d7c2377fca16a6d8d31cf7aaae4f009fdce..bcc368d3d3adf73ff9ff2395d2f2b321c6134efd 100644
|
||||
index efdd3069934e089863b07694e26b68ff567bd05b..eab95c7eae0bf9b448fb8edf50a5354d692b05ec 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
||||
@@ -151,6 +151,9 @@ public abstract class PathNavigation {
|
||||
@@ -768,7 +768,7 @@ index 3f672d7c2377fca16a6d8d31cf7aaae4f009fdce..bcc368d3d3adf73ff9ff2395d2f2b321
|
||||
@@ -177,11 +180,20 @@ public abstract class PathNavigation {
|
||||
PathNavigationRegion pathNavigationRegion = new PathNavigationRegion(this.level, blockPos.offset(-i, -i, -i), blockPos.offset(i, i, i));
|
||||
Path path = this.pathFinder.findPath(pathNavigationRegion, this.mob, positions, followRange, distance, this.maxVisitedNodesMultiplier);
|
||||
this.level.getProfiler().pop();
|
||||
//this.level.getProfiler().pop(); // Purpur
|
||||
- if (path != null && path.getTarget() != null) {
|
||||
- this.targetPos = path.getTarget();
|
||||
- this.reachRange = distance;
|
||||
@@ -869,10 +869,10 @@ index 8db20db72cd51046213625fac46c35854c59ec5d..11b386697279333ffd5f3abc9e1dbc9c
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
index a7c0c2a8b9b5c1336ce33418e24e0bfd77cec5b0..227a8d1381277ad2b8d545e9e2b951ff5f7a2e36 100644
|
||||
index 6e33790792e8d0b727fce7dd3bf8a848ca5180a3..d29c9121dc3cb1780c7d25e18f220daf8c25c6e1 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
@@ -1143,7 +1143,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
@@ -1146,7 +1146,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
} else {
|
||||
Bee.this.pathfindRandomlyTowards(Bee.this.hivePos);
|
||||
}
|
||||
@@ -881,7 +881,7 @@ index a7c0c2a8b9b5c1336ce33418e24e0bfd77cec5b0..227a8d1381277ad2b8d545e9e2b951ff
|
||||
boolean flag = this.pathfindDirectlyTowards(Bee.this.hivePos);
|
||||
|
||||
if (!flag) {
|
||||
@@ -1205,7 +1205,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
@@ -1208,7 +1208,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
} else {
|
||||
Path pathentity = Bee.this.navigation.getPath();
|
||||
|
||||
@@ -891,7 +891,7 @@ index a7c0c2a8b9b5c1336ce33418e24e0bfd77cec5b0..227a8d1381277ad2b8d545e9e2b951ff
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
index 8210aa958b8bc7d36f2959d261a750c444017fec..1ddb90fbd3ace1345f77b37fc517f924819f6d7a 100644
|
||||
index 6781e3a22f62c8159df516e44b3fab9097082431..0a8f3787cf815571212d2a1b8b0d18971ffe5e1b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
@@ -464,6 +464,14 @@ public class Frog extends Animal {
|
||||
@@ -963,10 +963,10 @@ index 2a335f277bd0e4b8ad0f60d8226eb8aaa80a871f..527f5fb55b596b44c7418a6f70e72434
|
||||
return false;
|
||||
} else if (o.nodes.size() != this.nodes.size()) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||
index d23481453717f715124156b5d83f6448f720d049..57bac2a4a8b2e4249daf3905dfa035592b3ef189 100644
|
||||
index a8af51a25b0f99c3a64d9150fdfcd6b818aa7581..86afc1bdc476b6d7654fec9de41d5ef4351b0be1 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||
@@ -25,36 +25,73 @@ public class PathFinder {
|
||||
@@ -25,36 +25,77 @@ public class PathFinder {
|
||||
private static final boolean DEBUG = false;
|
||||
private final BinaryHeap openSet = new BinaryHeap();
|
||||
|
||||
@@ -996,6 +996,10 @@ index d23481453717f715124156b5d83f6448f720d049..57bac2a4a8b2e4249daf3905dfa03559
|
||||
+ nodeEvaluator.prepare(world, mob);
|
||||
+ Node node = nodeEvaluator.getStart();
|
||||
if (node == null) {
|
||||
+ if (this.nodeEvaluatorGenerator != null) {
|
||||
+ host.bloom.pathfinding.NodeEvaluatorCache.returnNodeEvaluator(nodeEvaluator);
|
||||
+ }
|
||||
+
|
||||
return null;
|
||||
} else {
|
||||
// Paper start - remove streams - and optimize collection
|
||||
@@ -1032,8 +1036,8 @@ index d23481453717f715124156b5d83f6448f720d049..57bac2a4a8b2e4249daf3905dfa03559
|
||||
// Paper start - optimize collection
|
||||
private Path findPath(ProfilerFiller profiler, Node startNode, List<Map.Entry<Target, BlockPos>> positions, float followRange, int distance, float rangeMultiplier) {
|
||||
+ // readd the profiler code for sync
|
||||
profiler.push("find_path");
|
||||
profiler.markForCharting(MetricCategory.PATH_FINDING);
|
||||
//profiler.push("find_path"); // Purpur
|
||||
//profiler.markForCharting(MetricCategory.PATH_FINDING); // Purpur
|
||||
+
|
||||
+ try {
|
||||
+ return this.processPath(this.nodeEvaluator, startNode, positions, followRange, distance, rangeMultiplier);
|
||||
@@ -1049,7 +1053,7 @@ index d23481453717f715124156b5d83f6448f720d049..57bac2a4a8b2e4249daf3905dfa03559
|
||||
// Set<Target> set = positions.keySet();
|
||||
startNode.g = 0.0F;
|
||||
startNode.h = this.getBestH(startNode, positions); // Paper - optimize collection
|
||||
@@ -91,7 +128,7 @@ public class PathFinder {
|
||||
@@ -91,7 +132,7 @@ public class PathFinder {
|
||||
}
|
||||
|
||||
if (!(node.distanceTo(startNode) >= followRange)) {
|
||||
@@ -1058,7 +1062,7 @@ index d23481453717f715124156b5d83f6448f720d049..57bac2a4a8b2e4249daf3905dfa03559
|
||||
|
||||
for(int l = 0; l < k; ++l) {
|
||||
Node node2 = this.neighbors[l];
|
||||
@@ -123,9 +160,14 @@ public class PathFinder {
|
||||
@@ -123,9 +164,14 @@ public class PathFinder {
|
||||
if (best == null || comparator.compare(path, best) < 0)
|
||||
best = path;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user