mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-03 23:07:40 +01:00
Prevent Pathfinding out of World Border
This prevents Entities from trying to run outside of the World Border TODO: This doesn't prevent the pathfinder from using blocks outside the world border as nodes. We can fix this by adding code to all overrides in: NodeEvaluator: public abstract BlockPathTypes getBlockPathType(BlockGetter world, int x, int y, int z); to return BLOCKED if it is outside the world border.
This commit is contained in:
parent
68a47b98c6
commit
1f63668ee9
@ -50,7 +50,7 @@
|
||||
+ // Paper start - EntityPathfindEvent
|
||||
+ boolean copiedSet = false;
|
||||
+ 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
|
||||
+ io.papermc.paper.util.MCUtil.toLocation(this.mob.level(), possibleTarget), target == null ? null : target.getBukkitEntity()).callEvent()) {
|
||||
+ if (!copiedSet) {
|
||||
+ copiedSet = true;
|
||||
|
Loading…
Reference in New Issue
Block a user