2017-01-05 10:44:26 +01:00
|
|
|
--- a/net/minecraft/server/PathfinderGoalFollowOwner.java
|
|
|
|
+++ b/net/minecraft/server/PathfinderGoalFollowOwner.java
|
2019-04-23 04:00:00 +02:00
|
|
|
@@ -1,6 +1,11 @@
|
2017-01-05 10:44:26 +01:00
|
|
|
package net.minecraft.server;
|
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
import java.util.EnumSet;
|
2017-01-05 10:44:26 +01:00
|
|
|
+// CraftBukkit start
|
|
|
|
+import org.bukkit.Location;
|
|
|
|
+import org.bukkit.craftbukkit.entity.CraftEntity;
|
|
|
|
+import org.bukkit.event.entity.EntityTeleportEvent;
|
|
|
|
+// CraftBukkit end
|
2019-04-23 04:00:00 +02:00
|
|
|
|
2017-01-05 10:44:26 +01:00
|
|
|
public class PathfinderGoalFollowOwner extends PathfinderGoal {
|
|
|
|
|
2019-12-10 23:00:00 +01:00
|
|
|
@@ -104,7 +109,18 @@
|
|
|
|
} else if (!this.a(new BlockPosition(i, j, k))) {
|
|
|
|
return false;
|
|
|
|
} else {
|
|
|
|
- this.a.setPositionRotation((double) ((float) i + 0.5F), (double) j, (double) ((float) k + 0.5F), this.a.yaw, this.a.pitch);
|
|
|
|
+ // CraftBukkit start
|
|
|
|
+ CraftEntity entity = this.a.getBukkitEntity();
|
|
|
|
+ Location to = new Location(entity.getWorld(), (double) ((float) i + 0.5F), (double) j, (double) ((float) k + 0.5F), this.a.yaw, this.a.pitch);
|
|
|
|
+ EntityTeleportEvent event = new EntityTeleportEvent(entity, entity.getLocation(), to);
|
|
|
|
+ this.a.world.getServer().getPluginManager().callEvent(event);
|
|
|
|
+ if (event.isCancelled()) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ to = event.getTo();
|
2017-01-05 10:44:26 +01:00
|
|
|
+
|
2019-12-10 23:00:00 +01:00
|
|
|
+ this.a.setPositionRotation(to.getX(), to.getY(), to.getZ(), to.getYaw(), to.getPitch());
|
|
|
|
+ // CraftBukkit end
|
|
|
|
this.e.o();
|
|
|
|
return true;
|
|
|
|
}
|