mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 05:47:45 +01:00
SPIGOT-5930: Add PlayerRespawnEvent#isAnchorSpawn
By: md_5 <git@md-5.net>
This commit is contained in:
parent
c66b18ca72
commit
f399ada24d
@ -13,11 +13,18 @@ public class PlayerRespawnEvent extends PlayerEvent {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private Location respawnLocation;
|
||||
private final boolean isBedSpawn;
|
||||
private final boolean isAnchorSpawn;
|
||||
|
||||
@Deprecated
|
||||
public PlayerRespawnEvent(@NotNull final Player respawnPlayer, @NotNull final Location respawnLocation, final boolean isBedSpawn) {
|
||||
this(respawnPlayer, respawnLocation, isBedSpawn, false);
|
||||
}
|
||||
|
||||
public PlayerRespawnEvent(@NotNull final Player respawnPlayer, @NotNull final Location respawnLocation, final boolean isBedSpawn, final boolean isAnchorSpawn) {
|
||||
super(respawnPlayer);
|
||||
this.respawnLocation = respawnLocation;
|
||||
this.isBedSpawn = isBedSpawn;
|
||||
this.isAnchorSpawn = isAnchorSpawn;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -51,6 +58,15 @@ public class PlayerRespawnEvent extends PlayerEvent {
|
||||
return this.isBedSpawn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets whether the respawn location is the player's respawn anchor.
|
||||
*
|
||||
* @return true if the respawn location is the player's respawn anchor.
|
||||
*/
|
||||
public boolean isAnchorSpawn() {
|
||||
return isAnchorSpawn;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
|
Loading…
Reference in New Issue
Block a user