Fix ground pathfinding (#7683)

This commit is contained in:
Jake Potrebic
2022-09-20 14:06:11 -07:00
parent bb10a5d633
commit 99640f47f1
2 changed files with 53 additions and 14 deletions

View File

@@ -22,6 +22,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
for (BlockPos possibleTarget : positions) {
- if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(this.mob.getBukkitEntity(),
+ if (!this.mob.getCommandSenderWorld().getWorldBorder().isWithinBounds(possibleTarget) || !new com.destroystokyo.paper.event.entity.EntityPathfindEvent(this.mob.getBukkitEntity(), // Paper - don't path out of world border
MCUtil.toLocation(this.mob.level, possibleTarget), target == null ? null : target.getBukkitEntity()).callEvent()) {
net.minecraft.server.MCUtil.toLocation(this.mob.level, possibleTarget), target == null ? null : target.getBukkitEntity()).callEvent()) {
if (!copiedSet) {
copiedSet = true;