diff --git a/src/de/steamwar/lobby/portal/TeleportPortal.java b/src/de/steamwar/lobby/portal/TeleportPortal.java index eab3251..0b11a16 100644 --- a/src/de/steamwar/lobby/portal/TeleportPortal.java +++ b/src/de/steamwar/lobby/portal/TeleportPortal.java @@ -81,8 +81,9 @@ public class TeleportPortal implements PortalHandler { if (target.getDepth() != 0.0) { normalized.setX(1 - portal.normalize(from).getX()); } - player.playSound(player.getLocation(), Sound.BLOCK_ENCHANTMENT_TABLE_USE, 0.25f, 1.0f); - player.teleport(target.denormalize(normalized).toLocation(to.getWorld(), (float) (to.getYaw() - Math.toDegrees(target.getYrotation() - portal.getYrotation())), to.getPitch()), PlayerTeleportEvent.TeleportCause.PLUGIN); + Location portalTo = target.denormalize(normalized).toLocation(to.getWorld(), (float) (to.getYaw() - Math.toDegrees(target.getYrotation() - portal.getYrotation())), to.getPitch()); + player.teleport(portalTo, PlayerTeleportEvent.TeleportCause.PLUGIN); + player.playSound(portalTo, Sound.BLOCK_ENCHANTMENT_TABLE_USE, 0.25f, 1.0f); } @Override