mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-02 11:22:01 +01:00
PlayerTeleportEndGatewayEvent
Allows you to access the Gateway being used in a teleport event
This commit is contained in:
parent
d84384e895
commit
5c20ef4c6b
@ -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…
Reference in New Issue
Block a user