diff --git a/Spigot-Server-Patches/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch b/Spigot-Server-Patches/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch index ea3e27963..7af28cc7b 100644 --- a/Spigot-Server-Patches/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch +++ b/Spigot-Server-Patches/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch @@ -12,11 +12,25 @@ diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java +@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + + // CraftBukkit start + private static final int CURRENT_LEVEL = 2; ++ boolean preserveMotion = true; // Paper - keep initial motion on first setPositionRotation + static boolean isLevelAtLeast(NBTTagCompound tag, int level) { + return tag.hasKey("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level; + } @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } public void setPositionRotation(double d0, double d1, double d2, float f, float f1) { -+ this.mot = new Vec3D(0, 0, 0); // Paper - cancel entity velocity if teleported ++ // Paper - cancel entity velocity if teleported ++ if (!preserveMotion) { ++ this.mot = Vec3D.ORIGIN; ++ } else { ++ this.preserveMotion = false; ++ } ++ // Paper end this.g(d0, d1, d2); this.yaw = f; this.pitch = f1;