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
All checks were successful
EpicKnarvik97/Stargate/pipeline/head This commit looks good
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user