mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-02 04:49:14 +01:00
PlayerTeleportEndGatewayEvent
Allows you to access the Gateway being used in a teleport event
This commit is contained in:
parent
d84384e895
commit
5c20ef4c6b
1 changed files with 32 additions and 0 deletions
|
@ -0,0 +1,32 @@
|
|||
package com.destroystokyo.paper.event.player;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.block.EndGateway;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
/**
|
||||
* Fired when a teleport is triggered for an End Gateway
|
||||
*/
|
||||
@NullMarked
|
||||
public class PlayerTeleportEndGatewayEvent extends PlayerTeleportEvent {
|
||||
|
||||
private final EndGateway gateway;
|
||||
|
||||
@ApiStatus.Internal
|
||||
public PlayerTeleportEndGatewayEvent(final Player player, final Location from, final Location to, final EndGateway gateway) {
|
||||
super(player, from, to, PlayerTeleportEvent.TeleportCause.END_GATEWAY);
|
||||
this.gateway = gateway;
|
||||
}
|
||||
|
||||
/**
|
||||
* The gateway triggering the teleport
|
||||
*
|
||||
* @return EndGateway used
|
||||
*/
|
||||
public EndGateway getGateway() {
|
||||
return this.gateway;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue