From c1dbe281a6b72a704b445ff77b66b95c02033f8e Mon Sep 17 00:00:00 2001 From: Ruakij Date: Tue, 11 May 2021 12:55:01 +0200 Subject: [PATCH] Preserve pitch and yaw from player --- .../listener/OnCustomPlayerMove.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnCustomPlayerMove.java b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnCustomPlayerMove.java index b86b049..e04d0ee 100644 --- a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnCustomPlayerMove.java +++ b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnCustomPlayerMove.java @@ -104,8 +104,15 @@ public class OnCustomPlayerMove implements CustomPlayerMoveEventListener { playerBeaconLocation.put(uuid, lbtBlockPartner); // Teleport + Location loc = safeBlock.getLocation(); + // Middle of block + loc.add(0.5, 0, 0.5); + // Preserve pitch and yaw from player + loc.setPitch(p.getLocation().getPitch()); + loc.setYaw(p.getLocation().getYaw()); + e.player().teleport( - safeBlock.getLocation().add(0.5, 0, 0.5) + loc ); } }