Stops measuring distances across worlds
All checks were successful
EpicKnarvik97/Stargate/pipeline/head This commit looks good

This commit is contained in:
2026-01-23 13:33:18 +01:00
parent 07463f77d9
commit 99c3b611dc

View File

@@ -79,6 +79,7 @@ public class StargateTeleportListener implements Listener {
// Cancel end gateway teleportation to the same destination // Cancel end gateway teleportation to the same destination
if (event.getTo() != null && cause == PlayerTeleportEvent.TeleportCause.END_GATEWAY && if (event.getTo() != null && cause == PlayerTeleportEvent.TeleportCause.END_GATEWAY &&
PortalHandler.getByAdjacentEntrance(event.getFrom()) != null && PortalHandler.getByAdjacentEntrance(event.getFrom()) != null &&
event.getFrom().getWorld() != null && event.getFrom().getWorld().equals(event.getTo().getWorld()) &&
event.getFrom().distance(event.getTo()) <= 1) { event.getFrom().distance(event.getTo()) <= 1) {
event.setCancelled(true); event.setCancelled(true);
} }