From d259503c92970fe2a055c84ab8b2a4606b1ee68a Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Fri, 22 Sep 2023 15:38:31 -0700
Subject: [PATCH] Fix recursion with pathfind entity event

With the function overload, need to pass the entity
through to the super call
---
 patches/server/0081-EntityPathfindEvent.patch | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/patches/server/0081-EntityPathfindEvent.patch b/patches/server/0081-EntityPathfindEvent.patch
index eccaebfdb1..0bab129aaf 100644
--- a/patches/server/0081-EntityPathfindEvent.patch
+++ b/patches/server/0081-EntityPathfindEvent.patch
@@ -19,7 +19,7 @@ index 3db41017c6690d4519564496edd8e7365b2f5a22..027eef4ace908147285c8d72b612d16e
  
      @Override
 diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java
-index 12564909abff7da4e5a4bb3d004a7ede2ffda12d..c0550a87dbc79090ccac8568186f22a49bb3837f 100644
+index 12564909abff7da4e5a4bb3d004a7ede2ffda12d..ac996b066415e461af1fcb71b19807401179c7f8 100644
 --- a/src/main/java/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java
 +++ b/src/main/java/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java
 @@ -41,7 +41,7 @@ public class GroundPathNavigation extends PathNavigation {
@@ -40,7 +40,14 @@ index 12564909abff7da4e5a4bb3d004a7ede2ffda12d..c0550a87dbc79090ccac8568186f22a4
                  }
  
                  while(blockPos.getY() < this.level.getMaxBuildHeight() && levelChunk.getBlockState(blockPos).isAir()) {
-@@ -69,14 +69,14 @@ public class GroundPathNavigation extends PathNavigation {
+@@ -63,20 +63,20 @@ public class GroundPathNavigation extends PathNavigation {
+             }
+ 
+             if (!levelChunk.getBlockState(target).isSolid()) {
+-                return super.createPath(target, distance);
++                return super.createPath(target, entity, distance); // Paper
+             } else {
+                 BlockPos blockPos2;
                  for(blockPos2 = target.above(); blockPos2.getY() < this.level.getMaxBuildHeight() && levelChunk.getBlockState(blockPos2).isSolid(); blockPos2 = blockPos2.above()) {
                  }