mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 17:01:56 +01:00
40748b3c8d
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 3dc4cdcd Update to Minecraft 1.14.3-pre4 88b25a8c SPIGOT-5098: Add a method to allow colored sign changes 6d913552 Update to Minecraft 1.14.3-pre4 CraftBukkit Changes:f1f33559
Update to Minecraft 1.14.38a3d3f49
SPIGOT-5098: Add a method to allow colored sign changes533290e2
SPIGOT-5100: Console warning from pig zombie targeting6dde4b9f
SPIGOT-5094: Allow opening merchant for wandering traders and hide the xp bar for custom merchants9af90077
SPIGOT-5097: Bukkit.clearRecipes() no longer working38fa220f
Fix setting game rules via the APIfe3930ce
Update to Minecraft 1.14.3-pre4da071ec5
Remove outdated build delay. Spigot Changes: 4d2f30f1 Update to Minecraft 1.14.3 f16400e3 Update to Minecraft 1.14.3-pre4
94 lines
No EOL
4.3 KiB
Diff
94 lines
No EOL
4.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Mon, 28 Mar 2016 21:22:26 -0400
|
|
Subject: [PATCH] EntityPathfindEvent
|
|
|
|
Fires when an Entity decides to start moving to a location.
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/Navigation.java b/src/main/java/net/minecraft/server/Navigation.java
|
|
index 04ccf141ce..e15728668e 100644
|
|
--- a/src/main/java/net/minecraft/server/Navigation.java
|
|
+++ b/src/main/java/net/minecraft/server/Navigation.java
|
|
@@ -0,0 +0,0 @@ public class Navigation extends NavigationAbstract {
|
|
|
|
@Override
|
|
public PathEntity a(Entity entity) {
|
|
- return this.b(new BlockPosition(entity));
|
|
+ return this.b(new BlockPosition(entity), entity); // Paper - Forward target entity
|
|
}
|
|
|
|
private int t() {
|
|
diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java
|
|
index 81dd8e4e89..130367099b 100644
|
|
--- a/src/main/java/net/minecraft/server/NavigationAbstract.java
|
|
+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java
|
|
@@ -0,0 +0,0 @@ import javax.annotation.Nullable;
|
|
|
|
public abstract class NavigationAbstract {
|
|
|
|
- protected final EntityInsentient a;
|
|
+ protected final EntityInsentient a; public Entity getEntity() { return a; } // Paper - OBFHELPER
|
|
protected final World b;
|
|
@Nullable
|
|
protected PathEntity c;
|
|
@@ -0,0 +0,0 @@ public abstract class NavigationAbstract {
|
|
return this.b(new BlockPosition(d0, d1, d2));
|
|
}
|
|
|
|
- @Nullable
|
|
- public PathEntity b(BlockPosition blockposition) {
|
|
+ // Paper start - Add target entity parameter for path find event
|
|
+ @Nullable public PathEntity b(BlockPosition blockposition) { return this.b(blockposition, null); }
|
|
+ @Nullable public PathEntity b(BlockPosition blockposition, Entity target) {
|
|
+ // Paper end
|
|
float f = (float) blockposition.getX() + 0.5F;
|
|
float f1 = (float) blockposition.getY() + 0.5F;
|
|
float f2 = (float) blockposition.getZ() + 0.5F;
|
|
|
|
- return this.a(blockposition, (double) f, (double) f1, (double) f2, 8, false);
|
|
+ return this.a(blockposition, target, (double) f, (double) f1, (double) f2, 8, false); // Paper - Path find event
|
|
}
|
|
|
|
@Nullable
|
|
@@ -0,0 +0,0 @@ public abstract class NavigationAbstract {
|
|
double d1 = entity.getBoundingBox().minY;
|
|
double d2 = entity.locZ;
|
|
|
|
- return this.a(blockposition, d0, d1, d2, 16, true);
|
|
+ return this.a(blockposition, entity, d0, d1, d2, 16, true); // Paper - Path find event
|
|
}
|
|
|
|
@Nullable
|
|
- protected PathEntity a(BlockPosition blockposition, double d0, double d1, double d2, int i, boolean flag) {
|
|
+ protected PathEntity a(BlockPosition blockposition, double d0, double d1, double d2, int i, boolean flag) { return this.a(blockposition, null, d0, d1, d2, i, flag); }
|
|
+ @Nullable protected PathEntity a(BlockPosition blockposition, Entity target, double d0, double d1, double d2, int i, boolean flag) {
|
|
if (this.a.locY < 0.0D) {
|
|
return null;
|
|
} else if (!this.a()) {
|
|
@@ -0,0 +0,0 @@ public abstract class NavigationAbstract {
|
|
} else if (this.c != null && !this.c.b() && blockposition.equals(this.q)) {
|
|
return this.c;
|
|
} else {
|
|
+ // Paper start - Pathfind event
|
|
+ if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(),
|
|
+ MCUtil.toLocation(getEntity().world, blockposition), target == null ? null : target.getBukkitEntity()).callEvent()) {
|
|
+ return null;
|
|
+ }
|
|
+ // Paper end
|
|
this.q = blockposition.immutableCopy();
|
|
float f = this.i();
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/NavigationFlying.java b/src/main/java/net/minecraft/server/NavigationFlying.java
|
|
index 9dfca6067f..551ff417bd 100644
|
|
--- a/src/main/java/net/minecraft/server/NavigationFlying.java
|
|
+++ b/src/main/java/net/minecraft/server/NavigationFlying.java
|
|
@@ -0,0 +0,0 @@ public class NavigationFlying extends NavigationAbstract {
|
|
|
|
@Override
|
|
public PathEntity a(Entity entity) {
|
|
- return this.b(new BlockPosition(entity));
|
|
+ return this.b(new BlockPosition(entity), entity); // Paper - Pathfind event
|
|
}
|
|
|
|
@Override
|
|
--
|