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
|
//Block normal portal teleportation if teleporting from a stargate
|
||||||
if (!event.isCancelled() && (cause == PlayerTeleportEvent.TeleportCause.NETHER_PORTAL ||
|
if (!event.isCancelled() && (cause == PlayerTeleportEvent.TeleportCause.NETHER_PORTAL ||
|
||||||
cause == PlayerTeleportEvent.TeleportCause.END_GATEWAY ||
|
|
||||||
cause == PlayerTeleportEvent.TeleportCause.END_PORTAL)
|
cause == PlayerTeleportEvent.TeleportCause.END_PORTAL)
|
||||||
&& PortalHandler.getByAdjacentEntrance(event.getFrom()) != null) {
|
&& PortalHandler.getByAdjacentEntrance(event.getFrom()) != null) {
|
||||||
|
Stargate.debug("StargateTeleportListener::onPlayerTeleport",
|
||||||
|
"Cancelled vanilla portal event to " + event.getTo());
|
||||||
event.setCancelled(true);
|
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 no event is passed in, assume it's a teleport, and act as such
|
||||||
if (event == null) {
|
if (event == null) {
|
||||||
success &= player.teleport(exit);
|
success &= player.teleport(exit);
|
||||||
|
Stargate.debug("PlayerTeleporter::teleportPlayer", "Teleported player to " + exit);
|
||||||
} else {
|
} else {
|
||||||
//Set the exit location of the event
|
//Set the exit location of the event
|
||||||
success &= !event.isCancelled();
|
success &= !event.isCancelled();
|
||||||
event.setTo(exit);
|
event.setTo(exit);
|
||||||
|
Stargate.debug("PlayerTeleporter::teleportPlayer", "Overwrote movement event to " + exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Set the velocity of the teleported player after the teleportation is finished
|
//Set the velocity of the teleported player after the teleportation is finished
|
||||||
|
|||||||
Reference in New Issue
Block a user