From 84304b43febaff05b11bec70e7a920db1330ba05 Mon Sep 17 00:00:00 2001 From: NanaChiyo0721 Date: Sun, 12 Jul 2026 19:30:52 +0800 Subject: [PATCH] Fix teleport missing original rotation and velocity Co-authored-by: Helvetica Volubi <88063803+suisuroru@users.noreply.github.com> --- ...ssing-original-rotation-and-velocity.patch | 47 +++++++++++++++++++ ...-and-pitch-were-ignored-during-telep.patch | 22 --------- 2 files changed, 47 insertions(+), 22 deletions(-) create mode 100644 camellia-server/minecraft-patches/features/0019-Fix-teleport-missing-original-rotation-and-velocity.patch delete mode 100644 camellia-server/minecraft-patches/features/0019-Fix-teleport-yam-and-pitch-were-ignored-during-telep.patch diff --git a/camellia-server/minecraft-patches/features/0019-Fix-teleport-missing-original-rotation-and-velocity.patch b/camellia-server/minecraft-patches/features/0019-Fix-teleport-missing-original-rotation-and-velocity.patch new file mode 100644 index 0000000..c3ce6a2 --- /dev/null +++ b/camellia-server/minecraft-patches/features/0019-Fix-teleport-missing-original-rotation-and-velocity.patch @@ -0,0 +1,47 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MrHua269 +Date: Wed, 8 Jul 2026 21:37:19 +0800 +Subject: [PATCH] Fix teleport missing original rotation and velocity + + +diff --git a/io/papermc/paper/threadedregions/TeleportUtils.java b/io/papermc/paper/threadedregions/TeleportUtils.java +index 2a64a5b2cf049661fe3f5a22ddfa39979624f5ec..335e9775e0d9a61f0e9641aba691a3bdf3ac7f2b 100644 +--- a/io/papermc/paper/threadedregions/TeleportUtils.java ++++ b/io/papermc/paper/threadedregions/TeleportUtils.java +@@ -41,7 +41,7 @@ public final class TeleportUtils { + return; + } + (useFromRootVehicle ? realFrom.getRootVehicle() : realFrom).teleportAsync( +- ((CraftWorld)loc.getWorld()).getHandle(), pos, null, null, null, ++ ((CraftWorld)loc.getWorld()).getHandle(), pos, yaw, pitch, null, // Camellia - Fix teleport missing original rotation and velocity + cause, teleportFlags, onComplete + ); + }, +diff --git a/net/minecraft/server/commands/TeleportCommand.java b/net/minecraft/server/commands/TeleportCommand.java +index 13d7965fd4f99f0848b080349df41f8b1c31a19b..9c5583886ccabb536a519e5a998ed798227ec5fd 100644 +--- a/net/minecraft/server/commands/TeleportCommand.java ++++ b/net/minecraft/server/commands/TeleportCommand.java +@@ -248,8 +248,8 @@ public class TeleportCommand { + // Folia start - region threading + if (true) { + Vec3 posFinal = new Vec3(x, y, z); +- Float yawFinal = Float.valueOf(newYRot); +- Float pitchFinal = Float.valueOf(newXRot); ++ Float yawFinal = Float.valueOf(newYRot + victim.getYRot()); // Camellia - Fix teleport missing original rotation and velocity ++ Float pitchFinal = Float.valueOf(newXRot + victim.getXRot()); // Camellia - Fix teleport missing original rotation and velocity + victim.getBukkitEntity().taskScheduler.schedule((Entity nmsEntity) -> { + nmsEntity.stopRiding(); + nmsEntity.teleportAsync( +diff --git a/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownEnderpearl.java b/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownEnderpearl.java +index a5870da96da005ed682bc25eac3af6c771dee851..4672d76ecf926975948135598f55405518e0007b 100644 +--- a/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownEnderpearl.java ++++ b/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownEnderpearl.java +@@ -99,7 +99,7 @@ public class ThrownEnderpearl extends ThrowableItemProjectile { + } + + entity.teleportAsync( +- checkWorld, to, null, null, null, ++ checkWorld, to, null, null, entity.getDeltaMovement(), // Camellia - Fix teleport missing original rotation and velocity + org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.ENDER_PEARL, + // chunk could have been unloaded + Entity.TELEPORT_FLAG_TELEPORT_PASSENGERS | Entity.TELEPORT_FLAG_LOAD_CHUNK, diff --git a/camellia-server/minecraft-patches/features/0019-Fix-teleport-yam-and-pitch-were-ignored-during-telep.patch b/camellia-server/minecraft-patches/features/0019-Fix-teleport-yam-and-pitch-were-ignored-during-telep.patch deleted file mode 100644 index fdee9e2..0000000 --- a/camellia-server/minecraft-patches/features/0019-Fix-teleport-yam-and-pitch-were-ignored-during-telep.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: MrHua269 -Date: Wed, 8 Jul 2026 21:37:19 +0800 -Subject: [PATCH] Fix teleport yam and pitch were ignored during teleport - command - - -diff --git a/net/minecraft/server/commands/TeleportCommand.java b/net/minecraft/server/commands/TeleportCommand.java -index 13d7965fd4f99f0848b080349df41f8b1c31a19b..54a8747351fd50ddd794a777aa405431a0dc6311 100644 ---- a/net/minecraft/server/commands/TeleportCommand.java -+++ b/net/minecraft/server/commands/TeleportCommand.java -@@ -248,8 +248,8 @@ public class TeleportCommand { - // Folia start - region threading - if (true) { - Vec3 posFinal = new Vec3(x, y, z); -- Float yawFinal = Float.valueOf(newYRot); -- Float pitchFinal = Float.valueOf(newXRot); -+ Float yawFinal = Float.valueOf(newYRot + victim.getYRot()); // Camellia - Fix teleport yaw issue -+ Float pitchFinal = Float.valueOf(newXRot + victim.getXRot()); // Camellia - Fix teleport pitch issue - victim.getBukkitEntity().taskScheduler.schedule((Entity nmsEntity) -> { - nmsEntity.stopRiding(); - nmsEntity.teleportAsync(