1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-03-21 22:48:57 +01:00

Invalidate PathTypeCache when pathfinding updates are disabled

The configuration should not allow the cache to break. Additionally,
invalidating the cache is cheap and as such there is no gain to avoid
invalidating it.
This commit is contained in:
Spottedleaf 2024-05-09 23:07:32 -07:00
parent df07e2152f
commit b407e24c84

View file

@ -9,13 +9,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
this.getChunkSource().blockChanged(pos);
+ if(this.paperConfig().misc.updatePathfindingOnBlockUpdate) { // Paper - option to disable pathfinding updates
this.pathTypesByPosCache.invalidate(pos);
+ if (this.paperConfig().misc.updatePathfindingOnBlockUpdate) { // Paper - option to disable pathfinding updates
VoxelShape voxelshape = oldState.getCollisionShape(this, pos);
VoxelShape voxelshape1 = newState.getCollisionShape(this, pos);
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel {
}