mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-01 20:50:41 +01:00
1718f61bf8
Doesn't compile yet. CraftBukkit Changes: 90d6905b Repackage NMS 69cf961d Repackage patches Spigot Changes: 79d53c28 Repackage NMS
20 lines
1.4 KiB
Diff
20 lines
1.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
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/world/entity/ai/navigation/NavigationAbstract.java b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java
|
|
index c50d792c3ef3277ecab229e866f052854edac19d..1664d47a61f1c502ece7f32aecdce759172c9f85 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java
|
|
@@ -147,7 +147,7 @@ public abstract class NavigationAbstract {
|
|
// 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;
|