diff --git a/patches/server/More-Teleport-API.patch b/patches/server/More-Teleport-API.patch index bb2235faa3..88bcf406f6 100644 --- a/patches/server/More-Teleport-API.patch +++ b/patches/server/More-Teleport-API.patch @@ -121,15 +121,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public void setRotation(float yaw, float pitch) { - throw new UnsupportedOperationException("Cannot set rotation of players. Consider teleporting instead."); + // Paper start - Teleport API -+ Location targetLocation = this.getEyeLocation(); -+ targetLocation.setYaw(yaw); -+ targetLocation.setPitch(pitch); -+ -+ org.bukkit.util.Vector direction = targetLocation.getDirection(); -+ direction.multiply(9999999); // We need to move the target block.. FAR out -+ targetLocation.add(direction); -+ this.lookAt(targetLocation, io.papermc.paper.entity.LookAnchor.EYES); -+ // Paper end ++ if (this.getHandle().connection == null) return; ++ this.getHandle().forceSetRotation(yaw, pitch); ++ // Paper end - Teleportation API } @Override