Files
Shiroha/camellia-server/minecraft-patches/features/0019-Fix-teleport-yam-and-pitch-were-ignored-during-telep.patch
T

23 lines
1.2 KiB
Diff
Raw Normal View History

2026-07-09 00:03:09 +08:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <mrhua269@gmail.com>
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(