Stops cancelling END_GATEWAY teleportation events, as those prevented teleportation from end gateways
All checks were successful
EpicKnarvik97/Stargate/pipeline/head This commit looks good

This commit is contained in:
2026-01-23 12:51:16 +01:00
parent 69e334c195
commit bbb5c5184e
2 changed files with 4 additions and 1 deletions

View File

@@ -69,9 +69,10 @@ public class StargateTeleportListener implements Listener {
//Block normal portal teleportation if teleporting from a stargate
if (!event.isCancelled() && (cause == PlayerTeleportEvent.TeleportCause.NETHER_PORTAL ||
cause == PlayerTeleportEvent.TeleportCause.END_GATEWAY ||
cause == PlayerTeleportEvent.TeleportCause.END_PORTAL)
&& PortalHandler.getByAdjacentEntrance(event.getFrom()) != null) {
Stargate.debug("StargateTeleportListener::onPlayerTeleport",
"Cancelled vanilla portal event to " + event.getTo());
event.setCancelled(true);
}
}

View File

@@ -69,10 +69,12 @@ public class PlayerTeleporter extends Teleporter {
//If no event is passed in, assume it's a teleport, and act as such
if (event == null) {
success &= player.teleport(exit);
Stargate.debug("PlayerTeleporter::teleportPlayer", "Teleported player to " + exit);
} else {
//Set the exit location of the event
success &= !event.isCancelled();
event.setTo(exit);
Stargate.debug("PlayerTeleporter::teleportPlayer", "Overwrote movement event to " + exit);
}
//Set the velocity of the teleported player after the teleportation is finished