2020-01-22 02:02:07 +00:00
From 9a9c2c4e2b97c584ca1156e5798f405279213420 Mon Sep 17 00:00:00 2001
2016-12-20 04:08:31 +00:00
From: Aikar <aikar@aikar.co>
Date: Mon, 19 Dec 2016 23:07:42 -0500
Subject: [PATCH] Prevent Pathfinding out of World Border
This prevents Entities from trying to run outside of the World Border
diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java
2019-12-11 23:43:22 +00:00
index 39a0c45bb..bdd092e49 100644
2016-12-20 04:08:31 +00:00
--- a/src/main/java/net/minecraft/server/NavigationAbstract.java
+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java
2019-12-11 23:43:22 +00:00
@@ -123,7 +123,7 @@ public abstract class NavigationAbstract {
2019-07-20 04:01:24 +00:00
// Paper start - Pathfind event
boolean copiedSet = false;
for (BlockPosition possibleTarget : set) {
- if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(),
+ if (!getEntity().getWorld().getWorldBorder().isInBounds(possibleTarget) || !new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(), // Paper - don't path out of world border
MCUtil.toLocation(getEntity().world, possibleTarget), target == null ? null : target.getBukkitEntity()).callEvent()) {
if (!copiedSet) {
copiedSet = true;
2016-12-20 04:08:31 +00:00
--
2020-01-22 02:02:07 +00:00
2.25.0.windows.1
2016-12-20 04:08:31 +00:00