From b407e24c843e6d1f1ebdadc842f93ad5f3994422 Mon Sep 17 00:00:00 2001 From: Spottedleaf <Spottedleaf@users.noreply.github.com> Date: Thu, 9 May 2024 23:07:32 -0700 Subject: [PATCH] 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. --- ...added-option-to-disable-pathfinding-updates-on-block.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/server/added-option-to-disable-pathfinding-updates-on-block.patch b/patches/server/added-option-to-disable-pathfinding-updates-on-block.patch index 4f1feda379..c94ecb5589 100644 --- a/patches/server/added-option-to-disable-pathfinding-updates-on-block.patch +++ b/patches/server/added-option-to-disable-pathfinding-updates-on-block.patch @@ -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 { }